spring / metro / webservice问题

时间:2011-02-04 20:01:53

标签: web-services spring jax-ws spring-ws java-metro-framework

我们尝试使用带有metro堆栈的spring来实现webservices。

设置似乎没问题,但我们在applicationContext.xml

中遇到错误
  

cvc-complex-type.2.4.c:匹配   通配符是严格的,但没有声明   可以找到元素   'WSS:结合'。

我认为已发布的示例已过时,对于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>

如何配置绑定,或者在哪里可以找到说明。

1 个答案:

答案 0 :(得分: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