The author of the WSDL you showed has probably chosen to separate the definitions of data structures related to orders and faults due to one or more of the following reasons:
He/she wants to be able to reuse the datastructures somewhere else without retaining multiple copies of the definitions.
He/she wants to keep the WSDL more "clean", perhaps also shorter.
Importing an XML schema and including an XML schema differs according to the following:
Import a XML schema that has a different namespace from the XML schema into which it is imported.
Include a XML schema that has the same namespace that the XML schema into which it is included.
The target namespace of a WSDL is not necessarily the same as the target namespace in which an XML schema is imported, and so the <import> element needs to be used. Also the WS-I Basic Profile 1.1, entry R2002, specifies that the XML schema <import> element must be used.
Hey thanks .... but i hope he does'nt get pissed off because i said that the book is wrong .... it was more of a polite inquiry !
posted 10 years ago
Yes, <import> is used for two reasons.
1. As you note, the target namespace of the WSDL document is different from that of the <imported> schemas. Thus <import> must be used.
2. To conform with the Basic Profile in order to improve interoperability, <import> must be used.
I wouldn't say that the namespace declaration you mention is wrong, since it seems to be the target namespace of the WSDL, but it seems like there is a namespace declaration missing for the URI http://www.example.com/getord.
Hi, I have a few more questions based on the reply
1) With out including http://www.example.com/getord in the namespace declaration would it be possible to use any of the types defined in orders.xsd ? My bet is No because when imported orders.xsd is imported under the namespace http://www.example.com/oms/getorders
2) Later in the wsdl we can see
This is incorrect according to me as the targetnamespace in the wsdl:types is http://www.example.com/getord (Please refer to the first post where i have posted a snippet of the wsdl)
Please confirm ?
3) If we change the to and
(Assuming the getord is used throughout the wsdl to refer to elements from orders.xsd).
It will make a more correct wsdl.
Please confirm ?
If you're gonna buy things, buy this thing and I get a fat kickback:
Devious Experiments for a Truly Passive Greenhouse!