You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Rich Catlett <ri...@more.net> on 2001/08/18 00:07:25 UTC

sending a header over soap messaging service

I am using the soap messaging service and I would like to send a header 
with the envelope.  The documentation to do it does not exist, so this 
is how I'm doing it, could sombody please correct me if I am wrong

QName qname = new QName("http://schemas.xmlsoap.org/soap/header", 
webservice);
Header header = new Header();
header.setAttribute(qname, value I want header to be);
msgenv.setHeader(header);

and then I send the message.  On the server side I tried a

Header header = env.getHeader();

The value of header is always null.  Obviously something is wrong can 
someone please tell me what it is.  
Thanks.
Rich Catlett


Re: sending a header over soap messaging service

Posted by Rich Catlett <ri...@more.net>.
Okay it's late on a Friday ignore the last post, but I still have a 
question.  I would like to add a header to the soap message, and this is 
where I know as much about XML as I thought I did, not a whole lot.  I did a

Header.unmarshall(); and created a header I would like to add an 
attribute the the header, and to do that I need a QName, when I create 
the QName does it matter what I give it as the namespaceuri, so long as 
I have the same QName on the server side that has the same namespaceuri. 
 If it does matter what the namespaceuri is what should I use for a name 
space uri this is what the envelope I'm sending looks like.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
</s:Header>
<s:Body>
<webService xmlns="urn:/user/Login">
<attachments>1</attachments>
<attach type="String" location="1">XMLData</attach>
</webService>
</s:Body>
</s:Envelope>

Thanks in advance for any help.
Rich Catlett


Rich Catlett wrote:

> I am using the soap messaging service and I would like to send a 
> header with the envelope.  The documentation to do it does not exist, 
> so this is how I'm doing it, could sombody please correct me if I am 
> wrong
>
> QName qname = new QName("http://schemas.xmlsoap.org/soap/header", 
> webservice);
> Header header = new Header();
> header.setAttribute(qname, value I want header to be);
> msgenv.setHeader(header);
>
> and then I send the message.  On the server side I tried a
>
> Header header = env.getHeader();
>
> The value of header is always null.  Obviously something is wrong can 
> someone please tell me what it is.  Thanks.
> Rich Catlett
>




Re: sending a header over soap messaging service

Posted by Rich Catlett <ri...@more.net>.
Okay it's late on a Friday ignore the last post, but I still have a 
question.  I would like to add a header to the soap message, and this is 
where I know as much about XML as I thought I did, not a whole lot.  I did a

Header.unmarshall(); and created a header I would like to add an 
attribute the the header, and to do that I need a QName, when I create 
the QName does it matter what I give it as the namespaceuri, so long as 
I have the same QName on the server side that has the same namespaceuri. 
 If it does matter what the namespaceuri is what should I use for a name 
space uri this is what the envelope I'm sending looks like.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
</s:Header>
<s:Body>
<webService xmlns="urn:/user/Login">
<attachments>1</attachments>
<attach type="String" location="1">XMLData</attach>
</webService>
</s:Body>
</s:Envelope>

Thanks in advance for any help.
Rich Catlett


Rich Catlett wrote:

> I am using the soap messaging service and I would like to send a 
> header with the envelope.  The documentation to do it does not exist, 
> so this is how I'm doing it, could sombody please correct me if I am 
> wrong
>
> QName qname = new QName("http://schemas.xmlsoap.org/soap/header", 
> webservice);
> Header header = new Header();
> header.setAttribute(qname, value I want header to be);
> msgenv.setHeader(header);
>
> and then I send the message.  On the server side I tried a
>
> Header header = env.getHeader();
>
> The value of header is always null.  Obviously something is wrong can 
> someone please tell me what it is.  Thanks.
> Rich Catlett
>