spring / Metro / Web服务问题

发布于 2024-10-16 02:35:31 字数 1443 浏览 14 评论 0原文

我们尝试使用 Spring 和 Metro Stack 来实现 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>

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

we try to use spring with metro stack to implement webservices.

The setup seems to be ok, but we get an error in the applicationContext.xml

cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration
can be found for element
'wss:binding'.

I think that the published examples are out of date and that, for Spring 3, the binding has to be defined in a different way.

<?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>

How do I have to configure the binding, or where can I find a description.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

錯遇了你 2024-10-23 02:35:31

首先,您似乎在 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在这里,但我想你已经看过了

For a start, you seem to be missing this in your 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文