permaculture playing cards*
The moose likes Web Services and the fly likes Confusion in WSDL? 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 » Java » Web Services
Bookmark "Confusion in WSDL?" Watch "Confusion in WSDL?" New topic
Author

Confusion in WSDL?

shai ban
Ranch Hand

Joined: Jan 05, 2010
Posts: 177
Hi,
I started web services (with Axis2 documentation) some days back. Though I am aware about namespace thing but still trying to make comfortable myself in WSDL. I have some confusion listed below...
- How to decide which namespaces should be declared? eg. in WSDL 1.1 and WSDL 2.0 have huge list of namespaces!!!
- Can related namespaces be declared on the corresponding element instead of declaring at the top? eg. the namespace "http://www.w3.org/2001/XMLSchema" is declared on TYPES in wsdl 2.0, can we declare it at top? Is vise-versa possible for other namespaces also?
- the namespace "http://www.w3.org/2003/05/soap/bindings/HTTP" is declared in BINDING element, can we declare it at top?
- TYPES element has different 'targetnamespace' irrespective of declaring one at top!!!

Anybody can guide, how to be comfortable for all this?

Thanks.
shai ban
Ranch Hand

Joined: Jan 05, 2010
Posts: 177
Any pointer will be helpful!!!

Thanks in advance.
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313

shai ban wrote:Hi,
I started web services (with Axis2 documentation) some days back. Though I am aware about namespace thing but still trying to make comfortable myself in WSDL. I have some confusion listed below...
- How to decide which namespaces should be declared? eg. in WSDL 1.1 and WSDL 2.0 have huge list of namespaces!!!
- Can related namespaces be declared on the corresponding element instead of declaring at the top? eg. the namespace "http://www.w3.org/2001/XMLSchema" is declared on TYPES in wsdl 2.0, can we declare it at top? Is vise-versa possible for other namespaces also?
- the namespace "http://www.w3.org/2003/05/soap/bindings/HTTP" is declared in BINDING element, can we declare it at top?
- TYPES element has different 'targetnamespace' irrespective of declaring one at top!!!

Anybody can guide, how to be comfortable for all this?

Thanks.


Hi,

I think you are not clear with XML Fundamentals. First make them clear and then dive into WebServices otherwise it is going to be difficult to understand what is happening.

- How to decide which namespaces should be declared? eg. in WSDL 1.1 and WSDL 2.0 have huge list of namespaces!!!

For WSDL you have to define following namespaces:-
1. wsdl - http://schemas.xmlsoap.org/wsdl/
2. soap - http://schemas.xmlsoap.org/wsdl/soap/ (if you are using SOAP Binding)
3. http - http://schemas.xmlsoap.org/wsdl/http/ (if you are using HTTP Binding)
4. soapenv - http://schemas.xmlsoap.org/soap/envelope/ (For SOAP-Envelope)
5. soapenc - http://schemas.xmlsoap.org/soap/encoding/ (for SOAP Encoding)
6. xsd - http://www.w3.org/2000/10/XMLSchema (XML Schema)
7. tns - namespace to refer elements in the "current document" (this namespace)
8. Any other application-specific namespace.
9. mime - http://schemas.xmlsoap.org/wsdl/mime/ (MIME binding)

Out of these 1, 4 and 7 are required. Rest will depend on your usage. 6 you can define in TYPES.


- Can related namespaces be declared on the corresponding element instead of declaring at the top? eg. the namespace "http://www.w3.org/2001/XMLSchema" is declared on TYPES in wsdl 2.0, can we declare it at top? Is vise-versa possible for other namespaces also?

Yes. But make sure nothing else breaks.


- the namespace "http://www.w3.org/2003/05/soap/bindings/HTTP" is declared in BINDING element, can we declare it at top?

No. You are defining the binding and not declaring the namespace over here.


- TYPES element has different 'targetnamespace' irrespective of declaring one at top!!!


First make yourself clear with XML technology.


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confusion in WSDL?
 
Similar Threads
Differences between targetNamespace and default namespace
Doubt in xsd
namespace doubt
Discrepancies between an XML file and the XSD it was generated from (via JAXB)
reading soap-envelop messages