*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Do grandchildren of Soap:body element need to be fully qualified? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Do grandchildren of Soap:body element need to be fully qualified?" Watch "Do grandchildren of Soap:body element need to be fully qualified?" New topic
Author

Do grandchildren of Soap:body element need to be fully qualified?

Anuj Singhal
Greenhorn

Joined: Oct 17, 2003
Posts: 23
Hi,
In Basic Profile 1.0, it is specified that Children of Soap:body MUST be fully qualified.
-------------------------------------------------------------------------
R1014 The children of the soap:Body element in a MESSAGE MUST be namespace qualified.
------------------------------------------------------------------------
Should GrandChildren of Soap:body also need to be namespace qualified ?

For example, it this SOAP message valid:-
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' >
<soap:Body>
<p rocess xmlns ='http://example.org/Operations' >
<Data xmlns:m='http://example.org/information' >
Here is some data with the message
</Data>
</p rocess>
</soap:Body>
</soap:Envelope>

Here, <Data> element is not namespace qualified.
In my understanding, it is valid.

Thanks,
Anuj
Watsh Rajneesh
Ranch Hand

Joined: Apr 17, 2006
Posts: 109
All of the local elements of a SOAP message must be namespace-qualified (prefixed with the SOAP 1.1 namespace), because the XML schema for SOAP 1.1 specifies the elementFormDefault attribute as "qualified". In addition, the Basic Profile 1.0 requires that all the application-specific elements contained by the Body element must be qualified.BP Unqualified elements in a SOAP Body element create too much ambiguity as to the meaning and proper structure of elements.
Example below shows that even accountName (grandchild of soap:Body element) has been namespace qualified.



SCJP 5.0 (90%), SCDJWS 1.4 (88%), SCWCD 1.4 (82%), SCBCD 1.3 (85%)
Anuj Singhal
Greenhorn

Joined: Oct 17, 2003
Posts: 23
Hi,

Original message:-
------------------------------------------------------------------------
All of the local elements of a SOAP message must be namespace-qualified (prefixed with the SOAP 1.1 namespace), because the XML schema for SOAP 1.1 specifies the elementFormDefault attribute as "qualified".
------------------------------------------------------------------------
Do you mean Schema for the SOAP/1.1 envelope having targetnamespace http://schemas.xmlsoap.org/soap/envelope/
It is true that this schema mandates local elements defined in this schema to be namespace qualified in an XML document, which means Header, Body and Fault need to be fully quanlified.
However this schema can no way restrict body element to contain XML fragment with fully qualified names, only SOAP specification or BP can do that.


Original message:-
---------------------------------------------------------------------------
In addition, the Basic Profile 1.0 requires that all the application-specific elements contained by the Body element must be qualified.BP Unqualified elements in a SOAP Body element create too much ambiguity as to the meaning and proper structure of elements.
---------------------------------------------------------------------------

True. That's what is mentioned in clause R1014 of BP , as i said in my initial post. It tells only about direct child of Body element, but nothing about Grand children.
In RMH, i have seen RPC style SOAP XML documents, in which GrandChildren are not fully-qualified. i assume that they are BP complaint SOAP message.



Thanks,
Anuj
Watsh Rajneesh
Ranch Hand

Joined: Apr 17, 2006
Posts: 109
Hmm.. i see your point. Thank you i have already started forgetting things . You are right .. the immediate child of soap:Body element only MUST be namespace-qualified as mandated by the BP 1.0 but the grand children (or children of the body entries) MAY be namespace-qualified. Here's a concise article on this.

Thanks,
Watsh
B.Sathish
Ranch Hand

Joined: Aug 18, 2005
Posts: 372
Whether the soap:Body element's grand children need to be prefixed or not depends on the schema where the soap:Body element's immediate child is declared. If the soap:Body's immediate child (for example, purchaseOrder) is defined in a schema whose's elementFormDefault is qualified, then the children of purchaseOrder, ie grand children of soap:Body must be namespace-qualified with the targetNamespace of that schema, but if the schema where the soap:Body's immediate child is defined declares elementFormDefault as unqualifed, then the grand children of soap:Body ie the children of the purchaseOrder element need not be qualifed and implicitly assume the namespace of its parent

And if you use default namespaces, you can leave both the soap:Body's immediate child and its grand children unqualified.

Let me know if my understanding is right
Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 207

B.Sathish wrote: if the schema where the soap:Body's immediate child is defined declares elementFormDefault as unqualifed, then the grand children of soap:Body ie the children of the purchaseOrder element need not be qualifed and implicitly assume the namespace of its parent


Let me know if my understanding is right


Are you sure that unqualified local elements assume the namespace of their parents?I thought they were in null namespace,and only global elements go in the targetnamespace.

Please correct me if I am wrong.

Thanks...
 
jQuery in Action, 2nd edition
 
subject: Do grandchildren of Soap:body element need to be fully qualified?
 
Similar Threads
Mock exam question: SOAP doubt
Doubt in soap:header
BP-compliant SOAP Envelope's namespace
SOAP doubt: The Envelope element
When the default namespace is an empty string?