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

Doubt in soap:header

vasu venki

Joined: Oct 05, 2005
Posts: 19
In rmh it says - soap header blocks are not required to be namespace qualified.But in mikalai notes it says it is mandatory to qualify all the children of soap:header element.

Can any one help me on this issue.

SCJP:70%<br />SCWCD:86%<br />SCBCD:90%<br />scdjws:98%<br />OCA<br />Nothing is impossible.Try and try until you achieve it.<br /> <br />Interstesigning and developing web Components
michael warren
Ranch Hand

Joined: Oct 20, 2006
Posts: 50
I think it is mandatory.
From the schema for a SOAP Envelope
the Header type is defined as follows

<xs:complexType name="Header">

<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>

which I believe means that the contents of the Header need a non null namespace, and it has to be other than the name space of the Header.
michael warren
Ranch Hand

Joined: Oct 20, 2006
Posts: 50
Havin given it some more thought (its more interesting than actually revising for the cert., which is what I should be doing)

I think you may be confusing the actual Header element with its children - the Header element needs to be in the "" namespace.

The children of the Header element need to be in some other namespace - at first I thought they couldn't be in the default namespace, but having tried the following it seems they can, I guess the default namespace isn't 'null', whatever null means in the context of namespaces.

(I'm using architag xml editor to experiment with schemas with )

[ March 21, 2007: Message edited by: michael warren ]
[ March 21, 2007: Message edited by: michael warren ]
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 217
So the Header-Elements(I.e immediate child element SOAP HEADER TAG
can be in any Namespace URI and cannot be given without namespace qualified or NULL URI
Am i rite

michael warren
Ranch Hand

Joined: Oct 20, 2006
Posts: 50
I think they can go without namespace being qualified (i.e. default namespace), assuming the soap namespace is qualified (as in my example above)- if soap is the default namespace, then the child elements need to be qualified to something different.
Not sure how you would have a null URI - do you have an example XML ?
I agree. Here's the link:
subject: Doubt in soap:header
It's not a secret anymore!