Our Spring WS 2.0 app can be "Run On Server" and returns the dynamically generated wsdl as expected -- until I import the applicationContext-ws.xml configuration into the applicationContext. It fails during maven package when it tries to load the applicationContext for the JUnit tests with the error:
I followed the Spring WS 2.0 airline example for my configuration but I noticed that they don't use @ContextConfiguration("applicationContext.xml") in any of their tests.Code:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schema' defined in class path resource [META-INF/spring/applicationContext-ws.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: xsd 'class path resource [WEB-INF/qcim.xsd]' does not exit Caused by: java.lang.IllegalArgumentException: xsd 'class path resource [WEB-INF/qcim.xsd]' does not exit
NOTE: the classpath does include src/main/java, src/main/resources and src/main/webapp with no Exclusions.
src/resources/META-INF/spring/applicationContext-ws.xml
NOTE: qcim.xsd is found in src/webapp/WEB-INF/ and it is successfully used by spring-ws-servlet.xml in order to generate the wsdl using:Code:<?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:context="http://www.springframework.org/schema/context" xmlns:sws="http://www.springframework.org/schema/web-services" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd"> <sws:annotation-driven /> <sws:interceptors> <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/> <bean class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"> <property name="xsdSchema" ref="schema"/> <property name="validateRequest" value="true"/> <property name="validateResponse" value="true"/> </bean> </sws:interceptors> <context:component-scan base-package="com.qualcomm.xmlns.it.isso.qcim.ws"/> <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/> <bean id="messageReceiver" class="org.springframework.ws.soap.server.SoapMessageDispatcher"/> <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema" p:xsd="/WEB-INF/qcim.xsd" /> </beans>
Code:<sws:dynamic-wsdl id="qcim" portTypeName="qcimPortType" locationUri="/QcimService/" targetNamespace="http://xmlns.qualcomm.com/it/isso/qcim/definitions/1.0.0">--> <sws:xsd location="/WEB-INF/qcim.xsd"/> </sws:dynamic-wsdl>


Reply With Quote