| 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: 1126
|
|
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
Bartender
Joined: Oct 04, 2006
Posts: 2194
|
|
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.
|
 |
 |
|
|
subject: HeaderElements must be namespace qualified when create soap client
|
|
|