web-servicesspringjax-wsspring-wsjava-metro-framework

spring / metro / webservice problem


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.


Solution

  • 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)