DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Schema and Wsdl namespace issue

  1. #1
    Join Date
    May 2011
    Posts
    1

    Schema and Wsdl namespace issue

    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:
    Code:
    <?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:
    Code:
    <?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:
    Code:
    <?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.

  2. #2
    Join Date
    May 2009
    Posts
    60

Similar Threads

  1. a question on XML Schema design
    By emanresu in forum XML
    Replies: 0
    Last Post: 08-05-2009, 03:02 PM
  2. Spot the error in the WSDL document
    By markyhb in forum Java
    Replies: 0
    Last Post: 05-26-2006, 12:07 PM
  3. Can I create a C# class from an XML Schema?
    By max caber in forum .NET
    Replies: 1
    Last Post: 12-29-2001, 09:49 AM
  4. WSDL .NET question.
    By max caber in forum .NET
    Replies: 0
    Last Post: 08-31-2001, 11:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center