aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Doubt in soap:header" Watch "Doubt in soap:header" New topic
Author

Doubt in soap:header

vasu venki
Greenhorn

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
http://schemas.xmlsoap.org/soap/envelope/
the Header type is defined as follows

<xs:complexType name="Header">

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

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 "http://schemas.xmlsoap.org/soap/envelope/" 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 http://www.architag.com/xray/ )



[ 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: 211
Hi,
So the Header-Elements(I.e immediate child element SOAP HEADER TAG
<soap:Header>
can be in any Namespace URI and cannot be given without namespace qualified or NULL URI
Am i rite


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
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: http://aspose.com/file-tools
 
subject: Doubt in soap:header