views:

427

answers:

3

I would like to log all requests/responses made by an axis2 client. I tried to create a file called client-config.wsdd as describer in http://code.google.com/support/bin/answer.py?hl=en&answer=15137 but without success (I don't get a log file).

Requests are made over https and I am not sure if it matters. I tried

<transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>

and

<transport name="https" pivot="java:org.apache.axis.transport.http.HTTPSender"/>

without success.

A: 

I normally just log the body of the SOAP message, passed to my service class.

public OMElement myOperation(OMElement request) throws AxisFault {

    log.debug("Request: {}", request);

    ..

    log.debug("Response: {}", response);

    return response
}

Low tech but works for me :-)

Mark O'Connor
Thanks you I'm looking for client logging.
Manuel Darveau
As mentioned by Manuel, this is applicable for the server side only
maayank
+1  A: 

hi Manuel, did you get answer for clien loggging with axis2? if so kindly let me know. i have similar problem and i did lot of search for finding out solution for this. but it seems it is not as easy as it is with axis.

gs_ravishankar
No, the only thing I found was to modify the client and do some system out. I found that some objects have implemented toString and will print nicelly. I don't have them on hand right now however.
Manuel Darveau
+1  A: 

For Axis2-client side logging for SOAP messages, just use the following JVM arguments while running your standalone client or include this VM args in your Appln. Server start script,

JAVA_OPTS=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=debug

C:\java %JAVA_OPTS% YourClientAppln.java

Cheers, Sankar

Sankar K S