Click to See Complete Forum and Search --> : XSD & WSDL Namespace issue


Natelew
May 9th, 2011, 06:14 PM
I am trying to define a wsdl that is importing an xsd file that is not changeable (customer provided), it in turn is including another file that is unchangeable. The issue I am having is that these xsd files contain no namespace/targetNamespace. I have searched the web for most of the day trying to find a similar situation. I've put together two sample xsds and a wsdl to show the issue.

When I try to validate the wsdl with soapui it is telling me: Could not solve name 'library' from namespace {library.status} to a defined schema element.

It seems I do not know how to pull in schema from without a namespace into the target namespace. I hope someone can give me some advice.

Here is the wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<definitions
targetNamespace="library.status"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="library.status" >

<xs:schema>
<xs:import schemaLocation="SomeSchema.xsd"/>
</xs:schema>

<message name="RequestLibraryStatus">
<part name="requestLibraryStatus" element="tns:library"/>
</message>

<message name="LibraryStatusReport">
<part name="libStatus" element="xs:string"/>
</message>

<portType name="LibraryStatusPort">
<operation name="ProvideLibraryStatus">
<input message="tns:RequestLibraryStatus"/>
<output message="tns.LibraryStatusReport"/>
</operation>
</portType>

<binding name="LibraryRequestStatusBinding" type="tns:LibraryStatusPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="ProvideLibraryStatus">
<soap:operation style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>

<service name="LibraryStatusService">
<port name="LibraryStatusService" binding="tns:LibraryRequestStatusBinding">
<soap:address location="http://someplace.com"/>
</port>
</service>
</definitions>


Here are the two schema files:
SomeSchema.xsd:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified">

<xs:include schemaLocation="very-simple-2-ns-ppl-nons.xsd"/>
<xs:element name="library">
<xs:complexType>
<xs:sequence>
<xs:element name="book" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="bookType">
<xs:sequence> <xs:element name="title" type="xs:string"/>
<xs:element name="authors">
<xs:complexType>
<xs:sequence>
<xs:element ref="person"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:schema>

and very-simple-2-ns-ppl-nons.xsd:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="person" type="personType"/>
<xs:complexType name="personType">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:schema>

Any help would be greatly appreciated.