|
|
applicationContext-ws cannot reference .xsd file
Our Spring WS 2.0 app can be quot;Run On Serverquot; 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:
Code:
Caused by: org..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
I followed the Spring WS 2.0 airline example for my configuration but I noticed that they don't use @ContextConfiguration(quot;applicationContext.xmlquot;) in any of their tests.
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
Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;beans xmlns=quot;schema/beansquot; xmlns:xsi=quot;2001/XMLSchema-instancequot; xmlns:context=quot;schema/contextquot; xmlns:sws=quot;schema/web-servicesquot; xmlns:p=quot;schema/pquot; xsi:schemaLocation=quot;schema/beans schema/beans/spring-beans-3.0.xsd schema/context schema/context/spring-context-3.0.xsd schema/web-services schema/web-services/web-services-2.0.xsdquot;gt;
lt;sws:annotation-driven /gt;
lt;sws:interceptorsgt; lt;bean class=quot;org..ws.server.endpoint.interceptor.PayloadLoggingInterceptorquot;/gt; lt;bean class=quot;org..ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptorquot;gt;lt;property name=quot;xsdSchemaquot; ref=quot;schemaquot;/gt;lt;property name=quot;validateRequestquot; value=quot;truequot;/gt;lt;property name=quot;validateResponsequot; value=quot;truequot;/gt; lt;/beangt; lt;/sws:interceptorsgt;
lt;context:component-scan base-package=quot;com.qualcomm.xmlns.it.isso.qcim.wsquot;/gt;
lt;bean id=quot;messageFactoryquot; class=quot;org..ws.soap.saaj.SaajSoapMessageFactoryquot;/gt;
lt;bean id=quot;messageReceiverquot; class=quot;org..ws.soap.server.SoapMessageDispatcherquot;/gt; lt;bean id=quot;schemaquot; class=quot;org..xml.xsd.SimpleXsdSchemaquot; p:xsd=quot;/WEB-INF/qcim.xsdquot; /gt;
lt;/beansgt;
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: lt;sws:dynamic-wsdl id=quot;qcimquot; portTypeName=quot;qcimPortTypequot; locationUri=quot;/QcimService/quot; targetNamespace=quot;it/isso/qcim/definitions/1.0.0quot;gt;--gt; lt;sws:xsd location=quot;/WEB-INF/qcim.xsdquot;/gt; lt;/sws:dynamic-wsdlgt; |
|