2011-02-04 36 views
1

我們嘗試使用彈簧與地鐵堆棧來實現web服務。春/地鐵/ web服務問題

的設置似乎是確定的,但我們在applicationContext.xml

CVC-複雜type.2.4.c得到一個錯誤:匹配 通配符是嚴格的,但沒有申報 可發現元素 'wss:binding'。

我認爲已發佈的例子已過時,對於Spring 3,綁定必須以不同的方式定義。

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:p="http://www.springframework.org/schema/p" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xmlns:tx="http://www.springframework.org/schema/tx" 
     xmlns:ws="http://jax-ws.java.net/spring/core" 
     xmlns:wss="http://jax-ws.java.net/spring/servlet" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     http://www.springframework.org/schema/aop 
     http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
     http://www.springframework.org/schema/tx 
     http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> 

    <wss:binding url="/ws"> 
     <wss:service> 
      <ws:service bean="#webService"/> 
     </wss:service> 
    </wss:binding> 
    <!-- this bean implements web service methods --> 
    <bean id="webService" class="com.test.TestService"/> 
</beans> 

我該如何配置綁定,或在哪裏可以找到說明。

回答

3

一開始,你似乎在你schemaLocation中缺少這樣的:

http://jax-ws.java.net/spring/core http://jax-ws.java.net/spring/core.xsd 
http://jax-ws.java.net/spring/servlet http://jax-ws.java.net/spring/servlet.xsd 

more here, but I guess you've seen it already

+0

這就是它!現在http://metro.java.net/guide/Using_Metro_With_Spring_and_NetBeans_6_1.html作品中的例子 – ABX 2011-02-05 20:17:04