Thanks Jeff.
That's an interesting idea, about the socketFactory.
I've started on the transport element in the client-config.wsdd. We'll
see how that goes.
Cheers!
-jeff

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Jeff Greif
Sent: Wednesday, June 20, 2007 12:40 AM
To: axis-user@ws.apache.org
Subject: Re: Axis 1.3: Need to retrieve HTTP Headers in incoming
request, in source code

1.  The transport handler can probably be replaced in the client
deployment descriptor. You'd be changing a line in a .wsdd file that
looked like this:
<transport name="SimpleHTTP" pivot="HTTPSender">

2.  It looks like you might be able to swap in your own SocketFactory
by setting the Axis property axis.socketFactory to refer to your
class.  That factory could produce sockets which provided a special
logging or dumping stream when you called getOutputStream() on them.
Perhaps that property could be set in the client deployment descriptor
also or in some axis.properties file inside axis.jar.

Jeff



On 6/19/07, Walker, Jeff <[EMAIL PROTECTED]> wrote:
> So,
> In case anybody needs this in the future, here's what little more I
have
> found out.
> Axis 1.x pretty much seems to run as a bunch of handlers. The service
> specific handlers run first, followed by the global request handlers,
> then the JAX-RPC handlers, then finally the transport handler. (In a
> nutshell, the transport handler sends the data out the socket.
Whatever
> handler you write will fire after the global request handlers, and you
> can write more than one. Then, at the end, the transport handler
fires.
> I am talking about the clientside, it is reversed when you are on the
> serverside.
>
> The transport handler for http seems to be HttpSender. Deep in that
> class, you can see the HTTP headers being assembled into a
StringBuffer.
> It is spread over many lines in the writeToSocket(..) method. Right at
> the end of that method, there is a line that will enable you to drop
the
> headers to a log file, if debugging for the HttpSender class is turned
> on. If you are using log4j, you can turn on debugging for that class
in
> your log4j properties file using:
> log4j.logger.org.apache.axis.transport.http.HTTPSender=debug
> Now, that dumps both the outgoing HTTP headers used in your request,
and
> when the response comes back, it also dumps out the HTTP headers found
> in the response.
>
> I have managed so far to only programmatically dump out the
mimeheaders
> 'Content-Id' and 'Content-Type'. The others elude me. I did this by
> creating a clientside handler, see below:
>
> public class ClientSideHandler extends GenericHandler {
> ...
>   public boolean handleRequest(MessageContext context)
>   {
>       SOAPMessageContext smContext = (SOAPMessageContext)context;
>       SOAPMessage sMessage = smContext.getMessage();
>       SOAPPart sPart = sMessage.getSOAPPart();
>       java.util.Iterator it = sPart.getAllMimeHeaders();
>       while (it.hasNext()) {
>         javax.xml.soap.MimeHeader header =
> (javax.xml.soap.MimeHeader)it.next();
>         System.out.println("Header name = " + header.getName() + ",
and
> value = " + header.getValue());
>       }
>     return true;
>   }
> ..
> }
>
> The only way I can think of to programmatically get at all of the HTTP
> headers in a request sent from a client, is to sub-class the transport
> handler HttpSender, and override the writeToSocket() method and dump
out
> the header stringbuffer. I'd have to find a way to register my new
> transport handler instead of HttpSender, too. That might prove too
> difficult without rebuilding Axis.
>
> Any other suggestions on how to approach this would be greatly
> appreciated.
> 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]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to