• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When the default namespace is an empty string?

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Just wondering what it means exactly when the default namespace is empty?

For example, consider this SOAP fault?



What exactly is the significance of xmlns=""?

Is it needed?
In what situations would you use it?

Thanks.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XML namespace says under the Namespace undeclaration section -

When an element carries the attribute xmlns="", the default namespace for that element and its descendants reverts to "no namespace": that is, unprefixed names are considered not to be in any namespace.



It's interesting because it means that the faultcode and the faultstring elements are considered not to be in any namespace.

If we look at the Schema defined in the SOAP Version 1.2 Part 1 specification, these elements do belong to the http://www.w3.org/2003/05/soap-envelope namespace.

Regards,
Dan
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would it be fair to say, then, that whatever software produced that element was in error?
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dan Drillich wrote:XML namespace says under the Namespace undeclaration section -

When an element carries the attribute xmlns="", the default namespace for that element and its descendants reverts to "no namespace": that is, unprefixed names are considered not to be in any namespace.



It's interesting because it means that the faultcode and the faultstring elements are considered not to be in any namespace.

If we look at the Schema defined in the SOAP Version 1.2 Part 1 specification, these elements do belong to the http://www.w3.org/2003/05/soap-envelope namespace.

Regards,
Dan



Note totally with you Dan. If we look at Schema defined in the SOAP Version 1.2 Part 1 specification.

We see:



and



If faultcode is not part of the namespace, body isn't either?

What is part of the same namespace then?

can you enlighten?

Thanks.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Luke Murphy wrote:
If faultcode is not part of the namespace, body isn't either?



As Paul noted, there seems to be a subtle error in the segment you provided; meaning, faultcode should be part of the namespace.

Regards,
Dan

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dan Drillich wrote:

Luke Murphy wrote:
If faultcode is not part of the namespace, body isn't either?



As Paul noted, there seems to be a subtle error in the segment you provided; meaning, faultcode should be part of the namespace.

Regards,
Dan



I got the example from the basic profile examples here

Go to:

3.3.3 SOAP Fault Namespace Qualification

The children of the soap:Fault element are local to that element, therefore namespace qualification is unnecessary.

R1001 When an ENVELOPE is a Fault, the element children of the soap:Fault element MUST be unqualified. [/code]

and you'll see


CORRECT:

<soap:Fault xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns='' >
<faultcode>soap:Client</faultcode>
<faultstring>Invalid message format</faultstring>
<faultactor>http://example.org/someactor</faultactor>;
<detail>
<m:msg xmlns:m='http://example.org/faults/exceptions'>
There were lots of elements in the message that
I did not understand
</m:msg>
</detail>
</soap:Fault>

 
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic