You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by BRUNO MELLONI <Br...@chickasaw.net> on 2011/04/28 00:12:23 UTC

Logging the SOAP request and response

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?



Re: Logging the SOAP request and response

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, April 28, 2011 3:08:29 PM Daniel Kulp wrote:
> 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



> 
> Dan
> 
> On Wednesday, April 27, 2011 6:12:23 PM BRUNO MELLONI wrote:
> > 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.DynamicsX0020GP
> > S oap" > <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
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Logging the SOAP request and response

Posted by Daniel Kulp <dk...@apache.org>.
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


On Wednesday, April 27, 2011 6:12:23 PM BRUNO MELLONI wrote:
> 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.DynamicsX0020GPS
> oap" > <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
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com