I'm using JAX-RPC
and wanted to know if there is a way to make JAX-RPC
print the raw SOAP Request/Response for debug purposes.
I saw that JAX-RPC
uses log4j
but did not see which logger I should turn on with DEBUG
to view the message before it is sent.
If you are using Apache Axis, here is the log4J configuration you can use:
<appender name="wsAppender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${catalina.base}/logs/MY_APP-ws.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="20MB" />
<param name="MaxBackupIndex" value="10" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %m%n" />
</layout>
<filter class="org.apache.log4j.varia.StringMatchFilter">
<param name="StringToMatch" value="MY_SPECIFIC_WSProcessRequest" />
<param name="AcceptOnMatch" value="true" />
</filter>
<filter class="org.apache.log4j.varia.DenyAllFilter"/>
</appender>
<logger name="org.apache.axis.transport.http.HTTPSender" additivity="false">
<level value="DEBUG" />
<appender-ref ref="wsAppender"/>
</logger>
Change MY_SPECIFIC_WSProcessRequest
for the specific value matching the XML request you want to log.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.