File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Target namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Target namespace" Watch "Target namespace" New topic

Target namespace

Sam Ruben

Joined: Feb 07, 2012
Posts: 9
whats the purpose using target namespace in a wsdl?
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

A target namespace qualifies the children attributes so that you can refer to multiple children that have the same name but different contexts. For example, a child named 'ZipCode' in the 'com.yourcompany.inquiry' namespace might only need a single numeric five digit integer whereas a child named 'ZipCode' in 'gov.usps.www' namespace might need a character string of ten characters in length (zip+four).
Sam Ruben

Joined: Feb 07, 2012
Posts: 9
Hi Thank you. I just have a doubt. namespace is generally used to avoid conflicts in naming XML tags.


<xs:schema xmlns:xs=""

why does the targetNamespace is used here? what the value is referred to?

xmlns:xs=" -- I have understood this point.
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 128

targetNamespace is similar as giving package name in java & namespaces in C++. By targetNamespace we specify that the xml is inside the mentioned namespace.
Did that answer or you needed something else?
I agree. Here's the link:
subject: Target namespace
It's not a secret anymore!