wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes wsdl error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "wsdl error" Watch "wsdl error" New topic
Author

wsdl error

Vasim Patel
Ranch Hand

Joined: Apr 29, 2004
Posts: 87
Hi,

I am trying some examples of wsdl import, but getting error when trying to import multiple wsdls.

listing5wsdl
------------
<wsdl efinitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:listing5="urn:listing5"
targetNamespace="urn:listing5">

<wsdl:types>
<xsd:schema targetNamespace="urn:listing5">
<xsd:complexType name="Phone">
<xsd:sequence>
<xsd:element name="areaCode" type="xsd:int"/>
<xsd:element name="exchange" type="xsd:int"/>
<xsd:element name="number" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>

</wsdl efinitions>


listing4wsdl
------------
<wsdl efinitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:listing5="urn:listing5"
xmlns:listing4="urn:listing4"
targetNamespace="urn:listing4">

<wsdl:import namespace="urn:listing5" location="listing5wsdl"/>

<wsdl:types>
<xsd:schema targetNamespace="urn:listing4">
<xsd:complexType name="Address">
<xsd:sequence>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="phone" type="listing5 hone"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
</wsdl efinitions>

now when i try to import both the wsdls i get an error
"The WSDL is not semantically valid: Impossible to compile the schemas referenced by the WSDL"

<wsdl efinitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:listing4="urn:listing4"
xmlns:listing5="urn:listing5"
xmlns:listing6="urn:listing6"
targetNamespace="urn:listing6">

<wsdl:import namespace="urn:listing4" location="listing4wsdl"/>
<wsdl:import namespace="urn:listing5" location="listing5wsdl"/>

<wsdl:message name="GetAddressRequest">
<wsdl art name="name" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="GetAddressResponse">
<wsdl art name="address" type="listing4:Address"/>
</wsdl:message>

<wsdl:message name="GetPhoneRequest">
<wsdl art name="name" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="GetPhoneResponse">
<wsdl art name="phone" type="listing5 hone"/>
</wsdl:message>

</wsdl efinitions>


However, if I import just either one of the wsdls(either listing4wsdl or listing5wsdl) and just use their types, it works fine.

Is it alright to import multiple wsdls?

regards
Vasim
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
Originally posted by Vasim Patel:
listing4wsdl
------------
...
<wsdl:import namespace="urn:listing5" location="listing5wsdl"/>
...
"The WSDL is not semantically valid: Impossible to compile the schemas referenced by the WSDL"

...
<wsdl:import namespace="urn:listing4" location="listing4wsdl"/>
<wsdl:import namespace="urn:listing5" location="listing5wsdl"/>
...
However, if I import just either one of the wsdls(either listing4wsdl or listing5wsdl) and just use their types, it works fine.

Is it alright to import multiple wsdls?

Yes, you can import multiple WSDLs - however my guess is that importing "listing5" causes the problem because "listing4" already imports "listing5". Try getting it to work by just importing "listing4".
[ February 08, 2006: Message edited by: Peer Reynders ]
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
I used XMLSpy and no error when I did "validate file".
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
Originally posted by wise owen:
I used XMLSpy and no error when I did "validate file".


Would "validating" the file actually perform the import to detect the "duplicate" import in the imported definition?

Anyway I didn't say it was illegal - it may be or it may not be - I don't know. Many tools have allowed illegal syntax before and croaked on perfectly legal syntax - we still have to work with them.
Vasim Patel
Ranch Hand

Joined: Apr 29, 2004
Posts: 87
Thanks Peer, Wise,

As Peer suggested, i tried importing only urn:listing4, which in turn imports urn:listing5. It works fine now.

I am using BEA AquaLogic Service Bus console.

Thanks again
regards
Vasim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: wsdl error
 
Similar Threads
jax-ws clients and jboss
WSDL issues
Calling a web service in Axis2
Error in my WSDL file
Axis WSDL2Java's Error: reference but not defined