ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17623

How to Intercept Axis/Apache SOAP request, can I use Log4J?

So Im able to successfully send a SOAP call to this web service. For better debugging, I would like to be able to intercept the actual XML body request being sent to the web service.

How would I go about doing this? Any documentation ,sample demo, or article leading me to the direction will certainly help.

Thanks

Upvotes: 0

Views: 355

Answers (1)

Tanu Garg
Tanu Garg

Reputation: 3067

with logback.xml configuration files, you can do :

<logger name="com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe" level="trace" additivity="false">
    <appender-ref ref="STDOUT"/>
</logger>

That will log the request and the response like this (depending on your configuration for the log output) :

[qtp1068445309-21] DEBUG c.s.x.i.w.t.h.c.HttpTransportPipe - ---[HTTP response - http://xyz:8081/xyz.svc - 200]---
    null: HTTP/1.1 200 OK
    Content-Length: 792
    Content-Type: application/soap+xml; charset=utf-8
    Date: Tue, 12 Feb 2019 14:50:23 GMT
    Server: Microsoft-IIS/10.0
    X-Powered-By: ASP.NET
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">[CONTENT REMOVED]</s:Envelope>--------------------

Upvotes: 1

Related Questions