Reputation: 345
I am trying to create a bean of type DefaultWsdl11Definition, but when the project is deploying to a weblogic environment the schema file location is not being resolved.
Bean:
<bean id="pServiceWsdl" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schemaCollection">
<bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<property name="inline" value="true"/>
<property name="xsds">
<list>
<value>classpath:/p.xsd</value>
</list>
</property>
</bean>
</property>
<property name="targetNamespace" value="http://example.com/p/"/>
<property name="portTypeName" value="pPortType"/>
<property name="serviceName" value="pService"/>
<property name="locationUri" value="/services"/>
</bean>
The schema file contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:include schemaLocation="p1.xsd"/>
<xsd:include schemaLocation="p2.xsd"/>
<xsd:element name="pRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="p" type="C:p"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="pResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="pEnvelope" type="C:pEnvelope"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Error I am receiving is as below:
Caused By: java.io.FileNotFoundException: d:\p1.xsd (The system cannot find the file specified)
Upvotes: 2
Views: 1632
Reputation: 4506
You have to specify the complete path in that case.
<xsd:include schemaLocation="classpath:com/example/p/oh/incoming/wsdl/com/example/p/xsd/PCBatchEnvelope-1p6.xsd"/>
You will also need to use commons xmlschema to inline all xsd into single. So to enable that you need to add below dependency in your maven.
<dependency>
<groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>
<version>1.4.7</version>
</dependency>
Upvotes: 1