I am using Apache Axis for web service automation.
I am preparing SOAP requests via Axis and hitting the web service further. What I am looking for is how to print the SOAP request content which is getting compiled and hitting the webservice.
I found that log4j can help but I am struggling how to use it.
You probably don't need this answer anymore, but stays here for anyone else that ends right up here with the same problem.
The easiest way to retrieve both the request and the response is to get them from the call you are making. In the axis generated stub, after invoking a call do this:
String requestXML = _call.getMessageContext().getRequestMessage().getSOAPPartAsString();
String responseXML = _call.getMessageContext().getResponseMessage().getSOAPPartAsString();
Hope it helps. It helped me when I needed to print the request too.