Discussion:
Logging the SOAP request and response
BRUNO MELLONI
2011-04-27 22:12:23 UTC
Permalink
I am using CXF on a command-line java application client to call a commercial .NET web service (Great Plains Web Service). Under some circumstances (probably triggered by a technical issue or by data I feed it) the service throws an exception, but all I receive in the client side is "org.apache.cxf.binding.soap.SoapFault: The application encountered an unhandled system exception. Contact your system administrator for details."

Clearly that doesn't tell me anything useful, so I wanted to see the SOAP request/response to see if there is more detail about the problem.

Following the documentation I could find I did the following:

1.- Added "-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger" to the Eclipse run configuration program arguments for the app, so that logging will go to the Log4jLogger that the application uses.

2.- Added the LoggingFeature to my <jaxws:client> tag as follows:

<jaxws:client id="gpClient" address="http://myGPServer/DynamicsGPWebServices/DynamicsGPService.asmx"
serviceClass="com.microsoft.schemas.dynamics.gp._2006._01.DynamicsX0020GPSoap" >
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:client>

3.- Added the block to enable logging to the context file:
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>

And frustratingly... the SOAP message request/response does not go to the console nor log4j.

Where did I go wrong?
Daniel Kulp
2011-04-28 19:08:29 UTC
Permalink
Do you have a log4j.properties or similar thing for configuring log4j? The
Logging stuff in CXF will log the message at INFO level so you will need to
make sure you have it configured to log INFO messages.

Dan
Post by BRUNO MELLONI
I am using CXF on a command-line java application client to call a
commercial .NET web service (Great Plains Web Service). Under some
circumstances (probably triggered by a technical issue or by data I feed
it) the service throws an exception, but all I receive in the client side
is "org.apache.cxf.binding.soap.SoapFault: The application encountered an
unhandled system exception. Contact your system administrator for
details."
Clearly that doesn't tell me anything useful, so I wanted to see the SOAP
request/response to see if there is more detail about the problem.
1.- Added
"-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger" to the
Eclipse run configuration program arguments for the app, so that logging
will go to the Log4jLogger that the application uses.
<jaxws:client id="gpClient"
address="http://myGPServer/DynamicsGPWebServices/DynamicsGPService.asmx"
serviceClass="com.microsoft.schemas.dynamics.gp._2006._01.DynamicsX0020GPS
oap" > <jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:client>
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
And frustratingly... the SOAP message request/response does not go to the
console nor log4j.
Where did I go wrong?
--
Daniel Kulp
dkulp-1oDqGaOF3Lkdnm+***@public.gmane.org
http://dankulp.com/blog
Talend - http://www.talend.com
Daniel Kulp
2011-04-28 19:11:06 UTC
Permalink
Post by Daniel Kulp
Do you have a log4j.properties or similar thing for configuring log4j?
The Logging stuff in CXF will log the message at INFO level so you will
need to make sure you have it configured to log INFO messages.
One more thing you can try <bean class="org.apache.cxf.feature.LoggingFeature"> <constructor-arg value="&lt;stdout&gt;"/> <constructor-arg value="&lt;stdout&gt;"/>
</bean>

If using a recent version of CXF, that should direct the messages to stdout
instead of the logging system.

Dan
Post by Daniel Kulp
Dan
Post by BRUNO MELLONI
I am using CXF on a command-line java application client to call a
commercial .NET web service (Great Plains Web Service). Under some
circumstances (probably triggered by a technical issue or by data I feed
it) the service throws an exception, but all I receive in the client side
is "org.apache.cxf.binding.soap.SoapFault: The application encountered an
unhandled system exception. Contact your system administrator for
details."
Clearly that doesn't tell me anything useful, so I wanted to see the SOAP
request/response to see if there is more detail about the problem.
1.- Added
"-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger" to
the Eclipse run configuration program arguments for the app, so that
logging will go to the Log4jLogger that the application uses.
<jaxws:client id="gpClient"
address="http://myGPServer/DynamicsGPWebServices/DynamicsGPService.asmx"
serviceClass="com.microsoft.schemas.dynamics.gp._2006._01.DynamicsX0020GP
S oap" > <jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:client>
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
And frustratingly... the SOAP message request/response does not go to the
console nor log4j.
Where did I go wrong?
--
Daniel Kulp
dkulp-1oDqGaOF3Lkdnm+***@public.gmane.org
http://dankulp.com/blog
Talend - http://www.talend.com
Continue reading on narkive:
Search results for 'Logging the SOAP request and response' (Questions and Answers)
29
replies
www.YouTube.com?
started 2007-04-24 00:05:40 UTC
science & mathematics
Loading...