aspose file tools*
The moose likes Web Services and the fly likes HeaderElements must be namespace qualified when create soap client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "HeaderElements must be namespace qualified when create soap client" Watch "HeaderElements must be namespace qualified when create soap client" New topic
Author

HeaderElements must be namespace qualified when create soap client

Ramesh Desai
Greenhorn

Joined: May 13, 2009
Posts: 3
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
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
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


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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

Joined: May 13, 2009
Posts: 3
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HeaderElements must be namespace qualified when create soap client