0
votes

I'm using JAXWS in my spring project to communicate with server and there is an error of XSD reading in my application context xml. Here is the application context -

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

  //**error at this below line -**  **cvc-complex-type.2.4.c: The matching wildcard is   strict, but no declaration can be found for element 'wss:binding'.**
  <wss:binding url="/hello">
    <wss:service>
        <ws:service bean="#helloWs"/>
    </wss:service>
   </wss:binding>

  <!-- Web service methods -->
  <bean id="helloWs" class="com.mkyong.ws.HelloWorldWS">
    <property name="helloWorldBo" ref="HelloWorldBo" />
  </bean>

  <bean id="HelloWorldBo" class="com.mkyong.bo.impl.HelloWorldBoImpl" />

Can any one please let me know what could be the reason for this error and any solution. Thanks for any help.!

2
Is this the same issue: stackoverflow.com/questions/14741729/…OQJF

2 Answers

3
votes

Why don't you try the following xml:

<?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:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://jax-ws.dev.java.net/spring/core http://jax-ws.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet http://jax-ws.java.net/spring/servlet.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<wss:binding url="/hello">
<wss:service>
    <ws:service bean="#helloWs"/>
</wss:service>
</wss:binding>

<!-- Web service methods -->
<bean id="helloWs" class="com.mkyong.ws.HelloWorldWS">
<property name="helloWorldBo" ref="HelloWorldBo" />
</bean>
<bean id="HelloWorldBo" class="com.mkyong.bo.impl.HelloWorldBoImpl" /> </beans>
2
votes

are you using spring in your project?, I had the same problem, but when I included spring-jaxws in my maven dependencies the problem solved, in fact, yo can see in that jar that the META-INF/spring.schemas file is redefining the XSDs locations:

http\://jax-ws.java.net/spring/core.xsd=spring-jax-ws-core.xsd http\://jax-ws.java.net/spring/servlet.xsd=spring-jax-ws-servlet.xsd http\://jax-ws.java.net/spring/local-transport.xsd=spring-jax-ws-local-transport.xsd

I wish it helps!