• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

SOAPFault doubt

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to BP rule
R1001 When a MESSAGE contains a soap:Fault element its element children MUST be unqualified.
CORRECT
<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns='' >
<faultcode>soap:Client</faultcode>
..........
</soap:Fault>
CORRECT [Please let me know if NOT !]
<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' >
<faultcode>soap:Client</faultcode>
..........
</soap:Fault>

Now, in both the cases the child elements of the <soap:Fault> belong to different namespaces. For the first case it belongs to blank namespace and for the second case it belongs to 'http://schemas.xmlsoap.org/soap/envelope/' namespace. Will not this cause any interoperability problem ? Are these valid SOAPFault examples according to BP 1.0?
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, What is bothering you? It clearly stated in the source you quote :

When a MESSAGE contains a soap:Fault element, that element MUST NOT have element children other than faultcode, faultstring, faultactor and detail.


INCORRECT:

It is incorrect becau, the DIRECT child of the <SOAP:Fault> may be :faultcode, faultstring, faultactor and detail. In this example as a direct child of <SOAP:Fault> element is also :


In the correct example:


the element

is NOT the direct child of <SOAP:Fault> element, but but child of <detail> element, within what it CAN have a declared a new namespace and the elements mapped to that namespace. So , however, it DOES NOT brake a rule, about what element must be a child of <SOAP:Fault> element. <m:Exception> element is a GRANDCHILD of <SOAP:Fault>.
Do you understand now?


 
Asit Baran
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. Actually I'm concerned about the namespace of <soap:Fault>'s child elements.
Case 1
<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns='' >
<faultcode>soap:Client</faultcode>
<faultstring>Invalid message format</faultstring>
</soap:Fault>
Now this is a valid fault message but <faultcode> and <faultstring> belongs to blank namespace because of " xmlns='' "
Case 2
<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<faultcode>soap:Client</faultcode>
<faultstring>Invalid message format</faultstring>
</soap:Fault>
Now this is also a valid fault message but <faultcode> and <faultstring> belongs to 'http://schemas.xmlsoap.org/soap/envelope/' namespace.

Now what a client should expect? Or he just doesn't bother anything about the namespace of those elements (i.e. <faultcode> and <faultstring>)? Any pointer would be appreciated.

Thanks,
Asit
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<SOAP:Fault> element must be bound to : "http://schemas.xmlsoap.org/soap/envelope/", namespace, and each of its direct children must be bound to the same namespace.
Although there were some differences in unbinding prefixed namespaces, both versions of xml allow you to unbind or remove the already declared {default namespace} by overriding it with another {default namespace} declaration, where the namespace in the overriding declaration is empty.
So if you declare an empty namespace, you'll remove the existing one already bound (replacing it with no namespace), which is in this example "http://schemas.xmlsoap.org/soap/envelope/". According to BP you must have a "http://schemas.xmlsoap.org/soap/envelope/" namespace bound to <SOAP:Fault> and its direct children. So if you discard required namespace it will be incorrect.
 
Asit Baran
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. If I get you right,

<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns='' >
<faultcode>soap:Client</faultcode>
<faultstring>Invalid message format</faultstring>
</soap:Fault>

is NOT a valid SOAP fault according to BP. But in BP 1.0 specification (http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16436064) I found the same example(i.e. Under the header "4.1.3 SOAP Faults and Namespaces") given as CORRECT.
Please let me know if I'm missing anything.

Thanks,
Asit
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, you have right. In both BP-1.0 and BP-1.1 stays that elemnts should not be qualified, and declaring an empty namespace 'xmlns=" " ', every qualification previously created, will be discarded. So it is true. this is correct:


Even, that messages I have inspected had NO 'namespace unqulification' of Fault child elements.
 
mooooooo ..... tiny ad ....
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic