• Post Reply Bookmark Topic Watch Topic
  • New Topic

Significance of default Namespace

 
Sriram Anbarasu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anybody tell me the difference between defaultNamespace and targetNamespace used in WSDL document?
It would be great if i could get a brief description about defaultNamespace and targetNamespace used in WSDL document.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default namespace is the namespace the elements without a prefix belong to - provided you assign a namespace.

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
All elements from the {http://schemas.xmlsoap.org/wsdl/} namespace must be prefixed with "wsdl:".

xmlns="http://schemas.xmlsoap.org/wsdl/"
All elements from the {http://schemas.xmlsoap.org/wsdl/} namespace do not have a prefix. Even though these elements do not have a prefix they are still namespace qualified.

There is no default namespace if there is no xmlns="..." declaration. In that case elements without a prefix do not belong to any namespace.

The targetNamespace is the namespace to which the WSDL definitions are assigned to.


In this example the default and targetNamespace are not the same:


In this example the default and targetNamespace are the same:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!