【问题标题】:spring / metro / webservice problemspring/metro/webservice 问题
【发布时间】:2011-02-04 20:01:53
【问题描述】:

我们尝试使用带有 Metro 堆栈的 Spring 来实现 Web 服务。

设置似乎没问题,但我们在 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>

我必须如何配置绑定,或者在哪里可以找到描述。

【问题讨论】:

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


    【解决方案1】:

    首先,您的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)

    【讨论】:

    猜你喜欢
    • 2011-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-21
    • 2017-07-29
    • 2011-05-20
    相关资源
    最近更新 更多