You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ysahuly <sa...@object-frontier.com> on 2008/11/21 13:34:56 UTC

How to add Soap Header in CXF

Hi,

In CXF, I need to add the SOAP header in the WebserviceContext on server as
per the option 4 provided in the Apache CXF
FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this Plz
lemme know...

Regards,
Sahul.Y

-- 
View this message in context: http://www.nabble.com/How-to-add-Soap-Header-in-CXF-tp20620246p20620246.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: How to add Soap Header in CXF

Posted by ysahuly <sa...@object-frontier.com>.
thanks buddy...



Ulhas Bhole-3 wrote:
> 
> Sorry try this link 
> http://svn.eu.apache.org/repos/asf/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header/
> 
> https link requires apache committer acces I think.
> 
> All you need for getting the context injected is private member with 
> @Resource annotation like below
> 
> @Resource WebServiceContext context;
> 
> Regards,
> 
> Ulhas Bhole
> 
> ysahuly wrote:
>> I couldn't view the below link...could you provide the code snippet from
>> this
>> link
>>
>>
>> Ulhas Bhole-3 wrote:
>>   
>>> you need to add a private member in you impl as follows
>>>
>>>     @Resource
>>>     private WebServiceContext context;
>>>
>>> For more information please refer to system test 
>>> https://svn.eu.apache.org/repos/asf/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header
>>>
>>> -- Ulhas Bhole
>>>
>>> ysahuly wrote:
>>>     
>>>> hi,
>>>>      thanks for ur reply...I understand the below part but where i need
>>>> to
>>>> inject the below code...i.e from where i will need to get the
>>>> context...i
>>>> am
>>>> new to CXF
>>>>
>>>>
>>>> dkulp wrote:
>>>>   
>>>>       
>>>>> On Friday 21 November 2008 7:34:56 am ysahuly wrote:
>>>>>     
>>>>>         
>>>>>> Hi,
>>>>>>
>>>>>> In CXF, I need to add the SOAP header in the WebserviceContext on
>>>>>> server
>>>>>> as
>>>>>> per the option 4 provided in the Apache CXF
>>>>>> FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this
>>>>>> Plz
>>>>>> lemme know...
>>>>>>       
>>>>>>           
>>>>> It's really exactly like the client side....
>>>>>
>>>>> List<Header> list = context.get(Header.HEADER_LIST);
>>>>> if (list == null) {
>>>>>    list = new ArrayList<Header>();
>>>>>    context.put(Header.HEADER_LIST, list);
>>>>> }
>>>>> Header header = new Header(qname, dom);
>>>>> list.add(header);
>>>>>
>>>>>
>>>>> -- 
>>>>> Daniel Kulp
>>>>> dkulp@apache.org
>>>>> http://dankulp.com/blog
>>>>>
>>>>>
>>>>>     
>>>>>         
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-add-Soap-Header-in-CXF-tp20620246p20774494.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to add Soap Header in CXF

Posted by Ulhas Bhole <ul...@progress.com>.
Sorry try this link 
http://svn.eu.apache.org/repos/asf/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header/

https link requires apache committer acces I think.

All you need for getting the context injected is private member with 
@Resource annotation like below

@Resource WebServiceContext context;

Regards,

Ulhas Bhole

ysahuly wrote:
> I couldn't view the below link...could you provide the code snippet from this
> link
>
>
> Ulhas Bhole-3 wrote:
>   
>> you need to add a private member in you impl as follows
>>
>>     @Resource
>>     private WebServiceContext context;
>>
>> For more information please refer to system test 
>> https://svn.eu.apache.org/repos/asf/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header
>>
>> -- Ulhas Bhole
>>
>> ysahuly wrote:
>>     
>>> hi,
>>>      thanks for ur reply...I understand the below part but where i need
>>> to
>>> inject the below code...i.e from where i will need to get the context...i
>>> am
>>> new to CXF
>>>
>>>
>>> dkulp wrote:
>>>   
>>>       
>>>> On Friday 21 November 2008 7:34:56 am ysahuly wrote:
>>>>     
>>>>         
>>>>> Hi,
>>>>>
>>>>> In CXF, I need to add the SOAP header in the WebserviceContext on
>>>>> server
>>>>> as
>>>>> per the option 4 provided in the Apache CXF
>>>>> FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this Plz
>>>>> lemme know...
>>>>>       
>>>>>           
>>>> It's really exactly like the client side....
>>>>
>>>> List<Header> list = context.get(Header.HEADER_LIST);
>>>> if (list == null) {
>>>>    list = new ArrayList<Header>();
>>>>    context.put(Header.HEADER_LIST, list);
>>>> }
>>>> Header header = new Header(qname, dom);
>>>> list.add(header);
>>>>
>>>>
>>>> -- 
>>>> Daniel Kulp
>>>> dkulp@apache.org
>>>> http://dankulp.com/blog
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Re: How to add Soap Header in CXF

Posted by ysahuly <sa...@object-frontier.com>.
I couldn't view the below link...could you provide the code snippet from this
link


Ulhas Bhole-3 wrote:
> 
> you need to add a private member in you impl as follows
> 
>     @Resource
>     private WebServiceContext context;
> 
> For more information please refer to system test 
> https://svn.eu.apache.org/repos/asf/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header
> 
> -- Ulhas Bhole
> 
> ysahuly wrote:
>> hi,
>>      thanks for ur reply...I understand the below part but where i need
>> to
>> inject the below code...i.e from where i will need to get the context...i
>> am
>> new to CXF
>>
>>
>> dkulp wrote:
>>   
>>> On Friday 21 November 2008 7:34:56 am ysahuly wrote:
>>>     
>>>> Hi,
>>>>
>>>> In CXF, I need to add the SOAP header in the WebserviceContext on
>>>> server
>>>> as
>>>> per the option 4 provided in the Apache CXF
>>>> FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this Plz
>>>> lemme know...
>>>>       
>>> It's really exactly like the client side....
>>>
>>> List<Header> list = context.get(Header.HEADER_LIST);
>>> if (list == null) {
>>>    list = new ArrayList<Header>();
>>>    context.put(Header.HEADER_LIST, list);
>>> }
>>> Header header = new Header(qname, dom);
>>> list.add(header);
>>>
>>>
>>> -- 
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://dankulp.com/blog
>>>
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-add-Soap-Header-in-CXF-tp20620246p20662069.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to add Soap Header in CXF

Posted by Ulhas Bhole <ul...@progress.com>.
you need to add a private member in you impl as follows

    @Resource
    private WebServiceContext context;

For more information please refer to system test 
https://svn.eu.apache.org/repos/asf/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header

-- Ulhas Bhole

ysahuly wrote:
> hi,
>      thanks for ur reply...I understand the below part but where i need to
> inject the below code...i.e from where i will need to get the context...i am
> new to CXF
>
>
> dkulp wrote:
>   
>> On Friday 21 November 2008 7:34:56 am ysahuly wrote:
>>     
>>> Hi,
>>>
>>> In CXF, I need to add the SOAP header in the WebserviceContext on server
>>> as
>>> per the option 4 provided in the Apache CXF
>>> FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this Plz
>>> lemme know...
>>>       
>> It's really exactly like the client side....
>>
>> List<Header> list = context.get(Header.HEADER_LIST);
>> if (list == null) {
>>    list = new ArrayList<Header>();
>>    context.put(Header.HEADER_LIST, list);
>> }
>> Header header = new Header(qname, dom);
>> list.add(header);
>>
>>
>> -- 
>> Daniel Kulp
>> dkulp@apache.org
>> http://dankulp.com/blog
>>
>>
>>     
>
>   


Re: How to add Soap Header in CXF

Posted by ysahuly <sa...@object-frontier.com>.
hi,
     thanks for ur reply...I understand the below part but where i need to
inject the below code...i.e from where i will need to get the context...i am
new to CXF


dkulp wrote:
> 
> On Friday 21 November 2008 7:34:56 am ysahuly wrote:
>> Hi,
>>
>> In CXF, I need to add the SOAP header in the WebserviceContext on server
>> as
>> per the option 4 provided in the Apache CXF
>> FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this Plz
>> lemme know...
> 
> It's really exactly like the client side....
> 
> List<Header> list = context.get(Header.HEADER_LIST);
> if (list == null) {
>    list = new ArrayList<Header>();
>    context.put(Header.HEADER_LIST, list);
> }
> Header header = new Header(qname, dom);
> list.add(header);
> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-add-Soap-Header-in-CXF-tp20620246p20654621.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to add Soap Header in CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Friday 21 November 2008 7:34:56 am ysahuly wrote:
> Hi,
>
> In CXF, I need to add the SOAP header in the WebserviceContext on server as
> per the option 4 provided in the Apache CXF
> FAQ(http://cxf.apache.org/faq.html).If anybody have idea about this Plz
> lemme know...

It's really exactly like the client side....

List<Header> list = context.get(Header.HEADER_LIST);
if (list == null) {
   list = new ArrayList<Header>();
   context.put(Header.HEADER_LIST, list);
}
Header header = new Header(qname, dom);
list.add(header);


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog