You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2017/05/26 10:09:04 UTC

[jira] [Comment Edited] (CXF-7385) HttpServletRequest is coming as null in CXF

    [ https://issues.apache.org/jira/browse/CXF-7385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16026096#comment-16026096 ] 

Sergey Beryozkin edited comment on CXF-7385 at 5/26/17 10:09 AM:
-----------------------------------------------------------------

Hi, please ask the questions at the CXF users list. In this case I can see you are expecting HttpServletRequest be available on the client chain which will always be null...


was (Author: sergey_beryozkin):
Hi, please ask the questions at the CXF users list. In this case I can you you are expecting HttpServletRequest be available on the client chain which will always be null...

> HttpServletRequest is coming as null in CXF
> -------------------------------------------
>
>                 Key: CXF-7385
>                 URL: https://issues.apache.org/jira/browse/CXF-7385
>             Project: CXF
>          Issue Type: Task
>            Reporter: Rj
>
> I am trying to get session id of each request and response while making client call to maintain certain parameter internally for each request and its corresponding response.  
> I am trying to get HttpServletRequest  from CXF message from out interceptor as below.
> I am using Phase.PRE_STREAM in my constructor.
> public void handleMessage(Message msg) {
>     HttpServletRequest req = (HttpServletRequest)msg.get("HTTP.REQUEST");
> }
> I always get HttpServletRequest  as null.
> Do i need to set session id while creating client.I create my client as below
> JAXRSClientFactoryBean sf = new JAXRSClientFactoryBean();
> sf.setResourceClass(CustomerService.class);
> sf.setAddress("http://localhost:9000/");
> BindingFactoryManager manager = sf.getBus().getExtension(BindingFactoryManager.class);
> JAXRSBindingFactory factory = new JAXRSBindingFactory();
> factory.setBus(sf.getBus());
> manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, factory);
> CustomerService service = sf.create(CustomerService.class);
> WebClient wc = sf.createWebClient();



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)