You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Ashutosh Arora <As...@crossworlds.com> on 2001/08/22 06:59:30 UTC

RE: httpRequest in my webservice ?

Hi!
Did you found how to get the HTTPRequest object in the Web Service? Do you
mind sharing it with me.
Thanks.
-Ashutosh.


-----Original Message-----
From: Naggi Rao [mailto:naggi@softhome.net]
Sent: Monday, July 23, 2001 10:13 AM
To: soap-dev@xml.apache.org
Subject: httpRequest in my webservice ?


Hi all,
Would it be possible for me to pass the Original HTTPRequest in to my
WebService ?
if so how

Thanxs in advance,
Naggi




Re: httpRequest in my webservice ?

Posted by Scott Nichol <sn...@computer.org>.
As of SOAP 2.2, if there is not match for the method signature, a signature
is tried with a leading parameter of type SOAPContext.  If one exists, it is
called with the current request context as the first parameter.  From that
parameter, you can get the session, servlet, request and response with code
like

      HttpServlet servlet = (HttpServlet) reqContext.getProperty(
Constants.BAG_HTTPSERVLET );
      HttpSession session = (HttpSession) reqContext.getProperty(
Constants.BAG_HTTPSESSION );
      HttpServletRequest request = (HttpServletRequest)
reqContext.getProperty( Constants.BAG_HTTPSERVLETREQUEST );
      HttpServletResponse response = (HttpServletResponse)
reqContext.getProperty( Constants.BAG_HTTPSERVLETRESPONSE );

So, for example, if the "natural" method is

    void Callme(String arg)

then instead implement a method

    void Callme(SOAPContext reqContext, String arg)

and access the reqContext as shown above.

Scott

----- Original Message -----
From: "Ashutosh Arora" <As...@crossworlds.com>
To: <so...@xml.apache.org>
Sent: Wednesday, August 22, 2001 12:59 AM
Subject: RE: httpRequest in my webservice ?


> Hi!
> Did you found how to get the HTTPRequest object in the Web Service? Do you
> mind sharing it with me.
> Thanks.
> -Ashutosh.
>
>
> -----Original Message-----
> From: Naggi Rao [mailto:naggi@softhome.net]
> Sent: Monday, July 23, 2001 10:13 AM
> To: soap-dev@xml.apache.org
> Subject: httpRequest in my webservice ?
>
>
> Hi all,
> Would it be possible for me to pass the Original HTTPRequest in to my
> WebService ?
> if so how
>
> Thanxs in advance,
> Naggi
>
>
>