Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion in WSDL?

 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any pointer will be helpful!!!

Thanks in advance.
 
Palak Mathur
Ranch Hand
Posts: 342
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic