wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes SOAP 1.2 Fault children qualified Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "SOAP 1.2 Fault children qualified" Watch "SOAP 1.2 Fault children qualified" New topic

SOAP 1.2 Fault children qualified

Sim Kim
Ranch Hand

Joined: Aug 06, 2004
Posts: 268
Hi All,

I created a WebService using SOAP 1.2 bindings and the SOAP Fault which I got looked like this :

The chilren of Fault are qualified .

In SOAP 1.1 , I get the following message :

Is this a change in SOAP 1.2 ?
Peer Reynders

Joined: Aug 19, 2005
Posts: 2922
SOAP 1.1
4.4 SOAP Fault

The http://schemas.xmlsoap.org/soap/envelope/ schema does not specify an 'elementFormDefault' attribute. That means that it defaults to "unqualified". This means that (local) subelements are not namespace qualified. Therefore faultcode, etc MUST be unqualified which is emphasized by the WS-I Basic Profile 1.0
4.1.3 SOAP Faults and Namespaces

SOAP 1.2
The http://www.w3.org/2003/05/soap-envelope/ schema specifies 'elementFormDefault="qualified"' which means that local subelements are namespace qualified. That means that the subelements of {http://www.w3.org/2003/05/soap-envelope/}Fault have to have a namespace prefix as their namespace isn't the default namespace.

The 'elementFormDefault' issue is discussed at length here. It is at this point that I really started to hate XML Schema ...
Chintan Rajyaguru
Ranch Hand

Joined: Aug 19, 2001
Posts: 341
Also, it is important to note that the new exam uses Basic Profile 1.1, which still refers to SOAP 1.1 and states that the children of fault must be unqualified but the details tag under fault can have qualified elements. So, your first sample is SOAP 1.2 valid but not Basic Profile 1.1 compliant.

SOADevelopment.com - Coming soon!
Sim Kim
Ranch Hand

Joined: Aug 06, 2004
Posts: 268
But the exam also refers to SOAP 1.2 .
So how do we deal any such question in exam ?
[ November 13, 2008: Message edited by: Sim Kim ]
Chintan Rajyaguru
Ranch Hand

Joined: Aug 19, 2001
Posts: 341
No right answer here but here is what I would do:
If it's an interoperability question, use SOAP 1.1
If it's a SOAP question use SOAP 1.2
If in doubt use SOAP 1.1 because that's what is referenced most of the time.
Faraz Ali
Ranch Hand

Joined: May 15, 2008
Posts: 108
Hi Sim Kim,

Thanks for pointing out this issue. I fear that i studied SOAP 1.1. Now started reading SOAP 1.2. Here is a point about SOAP fault.

In SOAP 1.2, faultcode, faultstring, actor are changed to Code, Reason and Role. And it defines a new element Node.

Can you mention any good articles which describe the differences between SOAP 1.1 and 1.2? And what do you think how big is the change from 1.1 to 1.2?

Sim Kim
Ranch Hand

Joined: Aug 06, 2004
Posts: 268
Here is one article which give the difference :

subject: SOAP 1.2 Fault children qualified
Similar Threads
Did not understand "MustUnderstand" header(s)
Why Getting Fault Code in SOAP Response Message
Defining a detail element for a fault in a WSDL
Problem in Throwing Exception
Throwing Fault