You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Sinha, Madhukar [IT]" <ma...@citigroup.com> on 2002/08/29 18:57:00 UTC

Accessing HTTP Request object(/headers) within Webservice imple mention class.


Hi

 This may be a very trivial question, but i will appriciate if someone could
give pointers or answers.

what is the best way to access HTTP request object from webservice
implementation class. I need to access the HTTP header info , like Cookie
and REMOTE_USER?

Please let me know.

thanks

-

Re: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Scott Nichol <sn...@scottnichol.com>.
I am not aware of one.  I don't know whether Axis uses the same "magic" with
the SOAPContext.

Scott Nichol

----- Original Message -----
From: "Mattias Jiderhamn" <ma...@expertsystem.se>
To: <so...@xml.apache.org>
Sent: Monday, September 02, 2002 5:47 AM
Subject: RE: Accessing HTTP Request object(/headers) within Webservice
implemention class.


Is there an easy way to create a WSDL file without the context parameter?
(Without having to edit it manually)

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Thursday, August 29, 2002 9:29 PM
> To: soap-dev@xml.apache.org; soap-user@xml.apache.org
> Subject: Re: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
> This method that has existed for a release or two of the code.  You change
> your service methods so that any method that needs access to this
> information has an initial parameter of type SOAPContext.  For example, if
> your method was
>
>     public String echo(String s)
>
> it is now
>
>     public String echo(SOAPContext ctx, String s)
>
> The SOAP client still behaves as if the method had the original signature,
> i.e. it passes a single parameter of type String.  The Apache SOAP server
> software will not find a method with such a signature, so it will look for
> one with the second signature above.
>
> So, now you have a SOAPContext.  You get things of interest from its
> property bag as follows
>
>           req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
>           res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);
>
> You can see in Constants.java that the following information is available
>
>   public static String BAG_HTTPSERVLET = "HttpServlet" ;
>   public static String BAG_HTTPSESSION = "HttpSession" ;
>   public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
>   public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
>   public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;
>
> where I believe the names tell it all.
>
> Scott Nichol
> ----- Original Message -----
> From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
> To: <so...@xml.apache.org>; <so...@xml.apache.org>
> Sent: Thursday, August 29, 2002 12:57 PM
> Subject: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
>
>
> Hi
>
>  This may be a very trivial question, but i will appriciate if
> someone could
> give pointers or answers.
>
> what is the best way to access HTTP request object from webservice
> implementation class. I need to access the HTTP header info , like Cookie
> and REMOTE_USER?
>
> Please let me know.
>
> thanks
>
> -
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Scott Nichol <sn...@scottnichol.com>.
I am not aware of one.  I don't know whether Axis uses the same "magic" with
the SOAPContext.

Scott Nichol

----- Original Message -----
From: "Mattias Jiderhamn" <ma...@expertsystem.se>
To: <so...@xml.apache.org>
Sent: Monday, September 02, 2002 5:47 AM
Subject: RE: Accessing HTTP Request object(/headers) within Webservice
implemention class.


Is there an easy way to create a WSDL file without the context parameter?
(Without having to edit it manually)

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Thursday, August 29, 2002 9:29 PM
> To: soap-dev@xml.apache.org; soap-user@xml.apache.org
> Subject: Re: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
> This method that has existed for a release or two of the code.  You change
> your service methods so that any method that needs access to this
> information has an initial parameter of type SOAPContext.  For example, if
> your method was
>
>     public String echo(String s)
>
> it is now
>
>     public String echo(SOAPContext ctx, String s)
>
> The SOAP client still behaves as if the method had the original signature,
> i.e. it passes a single parameter of type String.  The Apache SOAP server
> software will not find a method with such a signature, so it will look for
> one with the second signature above.
>
> So, now you have a SOAPContext.  You get things of interest from its
> property bag as follows
>
>           req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
>           res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);
>
> You can see in Constants.java that the following information is available
>
>   public static String BAG_HTTPSERVLET = "HttpServlet" ;
>   public static String BAG_HTTPSESSION = "HttpSession" ;
>   public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
>   public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
>   public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;
>
> where I believe the names tell it all.
>
> Scott Nichol
> ----- Original Message -----
> From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
> To: <so...@xml.apache.org>; <so...@xml.apache.org>
> Sent: Thursday, August 29, 2002 12:57 PM
> Subject: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
>
>
> Hi
>
>  This may be a very trivial question, but i will appriciate if
> someone could
> give pointers or answers.
>
> what is the best way to access HTTP request object from webservice
> implementation class. I need to access the HTTP header info , like Cookie
> and REMOTE_USER?
>
> Please let me know.
>
> thanks
>
> -
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




RE: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Mattias Jiderhamn <ma...@expertsystem.se>.
Is there an easy way to create a WSDL file without the context parameter?
(Without having to edit it manually)

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Thursday, August 29, 2002 9:29 PM
> To: soap-dev@xml.apache.org; soap-user@xml.apache.org
> Subject: Re: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
> This method that has existed for a release or two of the code.  You change
> your service methods so that any method that needs access to this
> information has an initial parameter of type SOAPContext.  For example, if
> your method was
>
>     public String echo(String s)
>
> it is now
>
>     public String echo(SOAPContext ctx, String s)
>
> The SOAP client still behaves as if the method had the original signature,
> i.e. it passes a single parameter of type String.  The Apache SOAP server
> software will not find a method with such a signature, so it will look for
> one with the second signature above.
>
> So, now you have a SOAPContext.  You get things of interest from its
> property bag as follows
>
>           req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
>           res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);
>
> You can see in Constants.java that the following information is available
>
>   public static String BAG_HTTPSERVLET = "HttpServlet" ;
>   public static String BAG_HTTPSESSION = "HttpSession" ;
>   public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
>   public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
>   public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;
>
> where I believe the names tell it all.
>
> Scott Nichol
> ----- Original Message -----
> From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
> To: <so...@xml.apache.org>; <so...@xml.apache.org>
> Sent: Thursday, August 29, 2002 12:57 PM
> Subject: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
>
>
> Hi
>
>  This may be a very trivial question, but i will appriciate if
> someone could
> give pointers or answers.
>
> what is the best way to access HTTP request object from webservice
> implementation class. I need to access the HTTP header info , like Cookie
> and REMOTE_USER?
>
> Please let me know.
>
> thanks
>
> -
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


RE: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Mattias Jiderhamn <ma...@expertsystem.se>.
Is there an easy way to create a WSDL file without the context parameter?
(Without having to edit it manually)

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Thursday, August 29, 2002 9:29 PM
> To: soap-dev@xml.apache.org; soap-user@xml.apache.org
> Subject: Re: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
> This method that has existed for a release or two of the code.  You change
> your service methods so that any method that needs access to this
> information has an initial parameter of type SOAPContext.  For example, if
> your method was
>
>     public String echo(String s)
>
> it is now
>
>     public String echo(SOAPContext ctx, String s)
>
> The SOAP client still behaves as if the method had the original signature,
> i.e. it passes a single parameter of type String.  The Apache SOAP server
> software will not find a method with such a signature, so it will look for
> one with the second signature above.
>
> So, now you have a SOAPContext.  You get things of interest from its
> property bag as follows
>
>           req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
>           res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);
>
> You can see in Constants.java that the following information is available
>
>   public static String BAG_HTTPSERVLET = "HttpServlet" ;
>   public static String BAG_HTTPSESSION = "HttpSession" ;
>   public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
>   public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
>   public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;
>
> where I believe the names tell it all.
>
> Scott Nichol
> ----- Original Message -----
> From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
> To: <so...@xml.apache.org>; <so...@xml.apache.org>
> Sent: Thursday, August 29, 2002 12:57 PM
> Subject: Accessing HTTP Request object(/headers) within Webservice
> implemention class.
>
>
>
>
> Hi
>
>  This may be a very trivial question, but i will appriciate if
> someone could
> give pointers or answers.
>
> what is the best way to access HTTP request object from webservice
> implementation class. I need to access the HTTP header info , like Cookie
> and REMOTE_USER?
>
> Please let me know.
>
> thanks
>
> -
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Scott Nichol <sn...@scottnichol.com>.
This method that has existed for a release or two of the code.  You change
your service methods so that any method that needs access to this
information has an initial parameter of type SOAPContext.  For example, if
your method was

    public String echo(String s)

it is now

    public String echo(SOAPContext ctx, String s)

The SOAP client still behaves as if the method had the original signature,
i.e. it passes a single parameter of type String.  The Apache SOAP server
software will not find a method with such a signature, so it will look for
one with the second signature above.

So, now you have a SOAPContext.  You get things of interest from its
property bag as follows

          req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
          res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);

You can see in Constants.java that the following information is available

  public static String BAG_HTTPSERVLET = "HttpServlet" ;
  public static String BAG_HTTPSESSION = "HttpSession" ;
  public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
  public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
  public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;

where I believe the names tell it all.

Scott Nichol
----- Original Message -----
From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
To: <so...@xml.apache.org>; <so...@xml.apache.org>
Sent: Thursday, August 29, 2002 12:57 PM
Subject: Accessing HTTP Request object(/headers) within Webservice
implemention class.




Hi

 This may be a very trivial question, but i will appriciate if someone could
give pointers or answers.

what is the best way to access HTTP request object from webservice
implementation class. I need to access the HTTP header info , like Cookie
and REMOTE_USER?

Please let me know.

thanks

-

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Scott Nichol <sn...@scottnichol.com>.
This method that has existed for a release or two of the code.  You change
your service methods so that any method that needs access to this
information has an initial parameter of type SOAPContext.  For example, if
your method was

    public String echo(String s)

it is now

    public String echo(SOAPContext ctx, String s)

The SOAP client still behaves as if the method had the original signature,
i.e. it passes a single parameter of type String.  The Apache SOAP server
software will not find a method with such a signature, so it will look for
one with the second signature above.

So, now you have a SOAPContext.  You get things of interest from its
property bag as follows

          req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
          res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);

You can see in Constants.java that the following information is available

  public static String BAG_HTTPSERVLET = "HttpServlet" ;
  public static String BAG_HTTPSESSION = "HttpSession" ;
  public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
  public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
  public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;

where I believe the names tell it all.

Scott Nichol
----- Original Message -----
From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
To: <so...@xml.apache.org>; <so...@xml.apache.org>
Sent: Thursday, August 29, 2002 12:57 PM
Subject: Accessing HTTP Request object(/headers) within Webservice
implemention class.




Hi

 This may be a very trivial question, but i will appriciate if someone could
give pointers or answers.

what is the best way to access HTTP request object from webservice
implementation class. I need to access the HTTP header info , like Cookie
and REMOTE_USER?

Please let me know.

thanks

-

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




Re: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Scott Nichol <sn...@scottnichol.com>.
This method that has existed for a release or two of the code.  You change
your service methods so that any method that needs access to this
information has an initial parameter of type SOAPContext.  For example, if
your method was

    public String echo(String s)

it is now

    public String echo(SOAPContext ctx, String s)

The SOAP client still behaves as if the method had the original signature,
i.e. it passes a single parameter of type String.  The Apache SOAP server
software will not find a method with such a signature, so it will look for
one with the second signature above.

So, now you have a SOAPContext.  You get things of interest from its
property bag as follows

          req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
          res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);

You can see in Constants.java that the following information is available

  public static String BAG_HTTPSERVLET = "HttpServlet" ;
  public static String BAG_HTTPSESSION = "HttpSession" ;
  public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
  public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
  public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;

where I believe the names tell it all.

Scott Nichol
----- Original Message -----
From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
To: <so...@xml.apache.org>; <so...@xml.apache.org>
Sent: Thursday, August 29, 2002 12:57 PM
Subject: Accessing HTTP Request object(/headers) within Webservice
implemention class.




Hi

 This may be a very trivial question, but i will appriciate if someone could
give pointers or answers.

what is the best way to access HTTP request object from webservice
implementation class. I need to access the HTTP header info , like Cookie
and REMOTE_USER?

Please let me know.

thanks

-

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




Re: Accessing HTTP Request object(/headers) within Webservice implemention class.

Posted by Scott Nichol <sn...@scottnichol.com>.
This method that has existed for a release or two of the code.  You change
your service methods so that any method that needs access to this
information has an initial parameter of type SOAPContext.  For example, if
your method was

    public String echo(String s)

it is now

    public String echo(SOAPContext ctx, String s)

The SOAP client still behaves as if the method had the original signature,
i.e. it passes a single parameter of type String.  The Apache SOAP server
software will not find a method with such a signature, so it will look for
one with the second signature above.

So, now you have a SOAPContext.  You get things of interest from its
property bag as follows

          req = reqCtx.setProperty(Constants.BAG_HTTPSERVLETREQUEST);
          res = reqCtx.setProperty(Constants.BAG_HTTPSERVLETRESPONSE);

You can see in Constants.java that the following information is available

  public static String BAG_HTTPSERVLET = "HttpServlet" ;
  public static String BAG_HTTPSESSION = "HttpSession" ;
  public static String BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
  public static String BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
  public static String BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;

where I believe the names tell it all.

Scott Nichol
----- Original Message -----
From: "Sinha, Madhukar [IT]" <ma...@citigroup.com>
To: <so...@xml.apache.org>; <so...@xml.apache.org>
Sent: Thursday, August 29, 2002 12:57 PM
Subject: Accessing HTTP Request object(/headers) within Webservice
implemention class.




Hi

 This may be a very trivial question, but i will appriciate if someone could
give pointers or answers.

what is the best way to access HTTP request object from webservice
implementation class. I need to access the HTTP header info , like Cookie
and REMOTE_USER?

Please let me know.

thanks

-

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>




--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>