Yes,
I thought that too.
But this is in a message handler on the clientside, not the servcie
side. It definitely works on the serverside, in a handler class, but
handlers on the clientside return null to this:
...
HttpServletRequest req =
(HttpServletRequest)context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQ
UEST);
if (req!= null) {
java.util.Enumeration enum = req.getHeaderNames();
while (enum.hasMoreElements()) {
String name = (String)enum.nextElement();
System.out.println("Found a header called: " + name + ", with
value = " + req.getHeader(name));
}
}
else
System.out.println("The req is null");
...
The above code is in the handleRequest(MessageContext context); method
in a GenericHandler sub-class on the clientside. The call to
getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST) returns me null every
time.
Unless I am doing soemthing wrong, of course.
Thanks,
-jeff
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Jeff Greif
Sent: Monday, June 18, 2007 5:47 PM
To: [email protected]
Subject: Re: Axis 1.3: Need to retrieve HTTP Headers in incoming
request, in source code
I believe that from the MessageContext you can get the
HttpServletRequest, and from that, the request headers.
Jeff
On 6/18/07, Walker, Jeff <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
> I'm using Axis 1.3.
> I have a need to see all of the HTTP Headers in the incoming request
from
> the client to the service. I tried retrieving all of the property
names from
> the MessageContext in my handleRequest(MessageContext context), but
none of
> them seemed to be the HTTP Headers I am looking for. I need to see
this kind
> of information in front of the SOAP envelope:
>
> ...
> POST /ExampleWebService/services/ExampleAxisService
> HTTP/1.0
> Content-Type: text/xml; charset=utf-8
> Accept: application/soap+xml, application/dime, multipart/related,
text/*
> User-Agent: Axis/1.3
> Host: 127.0.0.1:4321
> Cache-Control: no-cache
> Pragma: no-cache
> SOAPAction: ""
> Content-Length: 445
> ...
>
> I caught the above using TCPMon, but I'd like to do the same in the
source
> code, preferrably in a Message Handler class, or something.
> Thanks,
> -jeff
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]