You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by xinxinwang <wa...@bah.com> on 2009/06/02 06:05:51 UTC

Empty SOAP Header List

I deployed a web service to Tomcat 5.5 server. I sent the following message
to the service: 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:soa.army.mil:adsl:sis:09-1:1-1:pattern:retrieve:type:bma:log:ums-ds"
xmlns:urn1="urn:soa.army.mil:adsl:sis:09-1:1-1:pattern:retrieve:bma:log:ums-ds"> 
   <soapenv:Header> 
        <urn1:Credentials> 
            <urn1:UserID>XinxinWang</urn1:UserID> 
            <urn1:Password>Secret Agent</urn1:Password> 
        </urn1:Credentials> 
   </soapenv:Header> 
   <soapenv:Body> 
      <urn:RetrieveRequest/> 
   </soapenv:Body> 
</soapenv:Envelope> 

My service implementation class cannot get the SOAP headers. The headerList
in the following lines of code is empty: 

@Resource 
private WebServiceContext ctx; 

..... 

Map<String,Object>  headers = ctx.getMessageContext(); 
List<Header> headerList = (List<Header>)headers.get(Header.HEADER_LIST); 

How can I get the header? 
-- 
View this message in context: http://www.nabble.com/Empty-SOAP-Header-List-tp23826014p23826014.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Empty SOAP Header List

Posted by xinxinwang <wa...@bah.com>.
Thanks for the reply.

I found the root cause of the problem. I used two approaches (adding header
parameter to the operation and using Web service context)  at the same time
to see which one works. Some how the header parameter was set to empty,
which also affect the web service context. After I removed the header
parameter, the header values show up in the context.

Xinxin


Arulazi Dhesiaseelan-3 wrote:
> 
> This should work:
> 
> <http://cxf.apache.org/faq.html#FAQ-HowcanIaddsoapheaderstotherequest%252Fresponse%253F>List<Header>
> headers = (List<Header>) ctx.getMessageContext().get(Header.HEADER_LIST);
> 
> You can enable logging on the server side to verify if you see the headers
> on the server side too.
> 
> Do you see any exceptions on the server side?
> 
> -Arul
> 
> On Mon, Jun 1, 2009 at 10:10 PM, xinxinwang <wa...@bah.com> wrote:
> 
>>
>> I deployed a web service to Tomcat 5.5 server. I sent the following
>> message
>> to the service using soapUI:
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>> "
>> xmlns:urn="urn:soa.army.mil:
>> adsl:sis:09-1:1-1:pattern:retrieve:type:bma:log:ums-ds"
>> xmlns:urn1="urn:soa.army.mil:
>> adsl:sis:09-1:1-1:pattern:retrieve:bma:log:ums-ds">
>>   <soapenv:Header>
>>        <urn1:Credentials>
>>            <urn1:UserID>XinxinWang</urn1:UserID>
>>            <urn1:Password>Secret Agent</urn1:Password>
>>        </urn1:Credentials>
>>   </soapenv:Header>
>>   <soapenv:Body>
>>      <urn:RetrieveRequest/>
>>   </soapenv:Body>
>> </soapenv:Envelope>
>>
>> My service implementation class cannot get the SOAP headers. The
>> headerList
>> in the following lines of code is empty:
>>
>> @Resource
>> private WebServiceContext ctx;
>>
>> .....
>>
>> Map<String,Object>  headers = ctx.getMessageContext();
>> List<Header> headerList = (List<Header>)headers.get(Header.HEADER_LIST);
>>
>> How can I get the header?
>> --
>> View this message in context:
>> http://www.nabble.com/Empty-SOAP-Header-List-tp23826014p23826014.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://aruld.info
> 
> 

-- 
View this message in context: http://www.nabble.com/Empty-SOAP-Header-List-tp23826014p23870256.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Empty SOAP Header List

Posted by Arulazi Dhesiaseelan <ar...@gmail.com>.
This should work:

<http://cxf.apache.org/faq.html#FAQ-HowcanIaddsoapheaderstotherequest%252Fresponse%253F>List<Header>
headers = (List<Header>) ctx.getMessageContext().get(Header.HEADER_LIST);

You can enable logging on the server side to verify if you see the headers
on the server side too.

Do you see any exceptions on the server side?

-Arul

On Mon, Jun 1, 2009 at 10:10 PM, xinxinwang <wa...@bah.com> wrote:

>
> I deployed a web service to Tomcat 5.5 server. I sent the following message
> to the service using soapUI:
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "
> xmlns:urn="urn:soa.army.mil:
> adsl:sis:09-1:1-1:pattern:retrieve:type:bma:log:ums-ds"
> xmlns:urn1="urn:soa.army.mil:
> adsl:sis:09-1:1-1:pattern:retrieve:bma:log:ums-ds">
>   <soapenv:Header>
>        <urn1:Credentials>
>            <urn1:UserID>XinxinWang</urn1:UserID>
>            <urn1:Password>Secret Agent</urn1:Password>
>        </urn1:Credentials>
>   </soapenv:Header>
>   <soapenv:Body>
>      <urn:RetrieveRequest/>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> My service implementation class cannot get the SOAP headers. The headerList
> in the following lines of code is empty:
>
> @Resource
> private WebServiceContext ctx;
>
> .....
>
> Map<String,Object>  headers = ctx.getMessageContext();
> List<Header> headerList = (List<Header>)headers.get(Header.HEADER_LIST);
>
> How can I get the header?
> --
> View this message in context:
> http://www.nabble.com/Empty-SOAP-Header-List-tp23826014p23826014.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>


-- 
http://aruld.info