Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wsdl error

 
Vasim Patel
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used XMLSpy and no error when I did "validate file".
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic