• 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

HeaderElements must be namespace qualified when create soap client

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

i am new to webservices.

i am facing problem when creating soap request.
error message : HeaderElements must be namespace qualified


can some body help me.


thanks,
Ramesh
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ramesh,

Can you please show us the SOAP request?

SOAP Header Element says -

Note: All immediate child elements of the Header element must be namespace-qualified.



It's interesting to look at the SOAP schema -




W3C XML Schema Design Patterns: Dealing With Change says -

In fact "##other" really means "any well-formed XML that is not from the target namespace of the type being defined" excluding elements with no namespace..



Regards,
Dan

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
The SOAP 1.1 specification says:


A header entry is identified by its fully qualified element name, which consists of the namespace URI and the local name. All immediate child elements of the SOAP Header element MUST be namespace-qualified.


Reference: http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383497

If you look at this example:

You see that the <Transaction> element is prefixed by a t (and : too, but that is not part of the prefix). The t is the namespace prefix which says that the <Transaction> element belongs to the namespace with the prefix t.
The error message you get is, as far as I understand, because a header in your SOAP request lacks this namespace prefix.
Best wishes!
 
Ramesh Desai
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dan,

below is my SOAP request header part,

<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-11707096" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>USERID</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>

i have completed body part, but unable to write code for header.
 
reply
    Bookmark Topic Watch Topic
  • New Topic