Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in soap:header

 
vasu venki
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic