You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by gweb79 <gw...@gmail.com> on 2008/04/29 02:24:44 UTC

How to get Request from OUT interceptor?

hi, I am trying to access the Request on an OUT interceptor, but the Message
object does not contain the Request, only the Response. Is there any way to
gain access to the Request at this point?

Thanks,
Graham
-- 
View this message in context: http://www.nabble.com/How-to-get-Request-from-OUT-interceptor--tp16950529p16950529.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to get Request from OUT interceptor?

Posted by gweb79 <gw...@gmail.com>.

dkulp wrote:
> 
> 
> If you get the Exchange from the Message, you can probably get the 
> Request message from there ad grab properties from that if needed.  
> 
> That said, if you need to share some properties between in and out 
> interceptors, setting those properties right on the exchange itself is 
> probably the best bet.
> 
> 

Perfect, the Exchange object was exactly what I was looking for. Thanks.

-- 
View this message in context: http://www.nabble.com/How-to-get-Request-from-OUT-interceptor--tp16950529p16951540.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to get Request from OUT interceptor?

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 28 April 2008, gweb79 wrote:
> hi, I am trying to access the Request on an OUT interceptor, but the
> Message object does not contain the Request, only the Response. Is
> there any way to gain access to the Request at this point?
>
> Thanks,
> Graham

If you get the Exchange from the Message, you can probably get the 
Request message from there ad grab properties from that if needed.  

That said, if you need to share some properties between in and out 
interceptors, setting those properties right on the exchange itself is 
probably the best bet.

-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: How to get Request from OUT interceptor?

Posted by Glen Mazza <gl...@verizon.net>.
Hmmm, thanks for the clarification.  If the session is important for
downstream processing on the OUT interceptor chain, I would think you
would want to put it in the SOAP header of the response.  But it appears
I may be wrong here--I always viewed the OUT interceptor chain being
activated *after* you have constructed your SOAP response, but
apparently the OUT chain is used in building the SOAP response, and
hence, would need to have access to the SOAP request.

Glen

2008-04-29 Willem Jiang wrote:
> Hi Glen,
> 
> The business processing logic may not care about the the request object.
> But from the transport level , you may need to use the Request object 
> for seeking the session or some other thing for setting up the Response 
> object.
> 
> Willem
> 
> Glen Mazza wrote:
> > Because the way a web service works.  You receive a request, perform
> > business logic based on that request, and then send the response back to
> > the client.  While sending the response back to the client (i.e., while
> > on the out interceptor chain), you shouldn't need to care about the
> > request--if so, it probably means your business processing logic was
> > incomplete.
> >
> > Glen
> >
> > 2008-04-28 gweb79 wrote:
> >   
> >> Why do you hope not? That is an odd thing to hope for. 
> >> But anyway, is there a way to access the session then at this point? 
> >>
> >>
> >> Glen Mazza-2 wrote:
> >>     
> >>> I hope not.  Perhaps you should ask for another way of doing what you
> >>> are trying to accomplish.
> >>>
> >>>
> >>>       
> >
> >
> >   
> 


Re: How to get Request from OUT interceptor?

Posted by Willem Jiang <wi...@gmail.com>.
Hi Glen,

The business processing logic may not care about the the request object.
But from the transport level , you may need to use the Request object 
for seeking the session or some other thing for setting up the Response 
object.

Willem

Glen Mazza wrote:
> Because the way a web service works.  You receive a request, perform
> business logic based on that request, and then send the response back to
> the client.  While sending the response back to the client (i.e., while
> on the out interceptor chain), you shouldn't need to care about the
> request--if so, it probably means your business processing logic was
> incomplete.
>
> Glen
>
> 2008-04-28 gweb79 wrote:
>   
>> Why do you hope not? That is an odd thing to hope for. 
>> But anyway, is there a way to access the session then at this point? 
>>
>>
>> Glen Mazza-2 wrote:
>>     
>>> I hope not.  Perhaps you should ask for another way of doing what you
>>> are trying to accomplish.
>>>
>>>
>>>       
>
>
>   


Re: How to get Request from OUT interceptor?

Posted by Glen Mazza <gl...@verizon.net>.
Because the way a web service works.  You receive a request, perform
business logic based on that request, and then send the response back to
the client.  While sending the response back to the client (i.e., while
on the out interceptor chain), you shouldn't need to care about the
request--if so, it probably means your business processing logic was
incomplete.

Glen

2008-04-28 gweb79 wrote:
> Why do you hope not? That is an odd thing to hope for. 
> But anyway, is there a way to access the session then at this point? 
> 
> 
> Glen Mazza-2 wrote:
> > 
> > I hope not.  Perhaps you should ask for another way of doing what you
> > are trying to accomplish.
> > 
> > 
> 


Re: How to get Request from OUT interceptor?

Posted by gweb79 <gw...@gmail.com>.
Why do you hope not? That is an odd thing to hope for. 
But anyway, is there a way to access the session then at this point? 


Glen Mazza-2 wrote:
> 
> I hope not.  Perhaps you should ask for another way of doing what you
> are trying to accomplish.
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-Request-from-OUT-interceptor--tp16950529p16951388.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to get Request from OUT interceptor?

Posted by Glen Mazza <gl...@verizon.net>.
I hope not.  Perhaps you should ask for another way of doing what you
are trying to accomplish.


2008-04-28 gweb79 wrote:
> hi, I am trying to access the Request on an OUT interceptor, but the Message
> object does not contain the Request, only the Response. Is there any way to
> gain access to the Request at this point?
> 
> Thanks,
> Graham