You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Anthony Dahanne <an...@valtech.fr> on 2009/08/10 14:01:09 UTC

How to get the xml generated request & response from CXF API ?

Hi,
I'm using wsdl2java functionality from CXF 2.2.1, to generate a Java client.
I've been able to successfully generate the Java classes including the service of my WSDL and associated XSLs.
The thing is, I would like to be able to read the XML request before it leaves the client, and I would also like to see the XML response when it gets back to the client.
Today, the only successful ways I've been able to see the XML output of the request and its associated incoming XML response were :
*through an HTTP proxy like TCPMon or TCPTrace
*via the log4j facility, creating my own appender and configuring it to catch all logs coming from the httpclient.wire.content package

Either ways do not satisfy me :
*I don't want to depend on a proxy for all my calls
*the logs from my appender are not accurate, some words are missing...

Is there an API available for CXF generated clients to get the exact XML streams sent and received through the network ?
Thank you for your answers
Anthony


RE : How to get the xml generated request & response from CXF API ?

Posted by Anthony Dahanne <an...@valtech.fr>.
Hello Mayank !

Thank you for your advice, I created 2 interceptors, one for capturing the request, the other for capturing the response, and I added a cxf.xml bean defining file, referring my 2 interceptors, and it worked !

This page helped me do that :
http://cwiki.apache.org/CXF20DOC/configuration.html

Good bye !
Anthony

-------- Message d'origine--------
De: Mayank Mishra [mailto:mayankm01@gmail.com]
Date: lun. 10/08/2009 15:50
À: users@cxf.apache.org
Objet : Re: How to get the xml generated request & response from CXF API ?
 
Hi,

You can plugin LogInInterceptor and LogOutInterceptor to the endpoints on
both client/server sides.

Refer this page [1], [2] to add interceptors programmatically or by
configuration.

With Regards,
Mayank

[1]. http://cwiki.apache.org/CXF20DOC/interceptors.html
[2]. http://cwiki.apache.org/CXF20DOC/debugging.html




On Mon, Aug 10, 2009 at 7:01 AM, Anthony Dahanne <anthony.dahanne@valtech.fr
> wrote:

> Hi,
> I'm using wsdl2java functionality from CXF 2.2.1, to generate a Java
> client.
> I've been able to successfully generate the Java classes including the
> service of my WSDL and associated XSLs.
> The thing is, I would like to be able to read the XML request before it
> leaves the client, and I would also like to see the XML response when it
> gets back to the client.
> Today, the only successful ways I've been able to see the XML output of the
> request and its associated incoming XML response were :
> *through an HTTP proxy like TCPMon or TCPTrace
> *via the log4j facility, creating my own appender and configuring it to
> catch all logs coming from the httpclient.wire.content package
>
> Either ways do not satisfy me :
> *I don't want to depend on a proxy for all my calls
> *the logs from my appender are not accurate, some words are missing...
>
> Is there an API available for CXF generated clients to get the exact XML
> streams sent and received through the network ?
> Thank you for your answers
> Anthony
>
>


Re: How to get the xml generated request & response from CXF API ?

Posted by Mayank Mishra <ma...@gmail.com>.
Hi,

You can plugin LogInInterceptor and LogOutInterceptor to the endpoints on
both client/server sides.

Refer this page [1], [2] to add interceptors programmatically or by
configuration.

With Regards,
Mayank

[1]. http://cwiki.apache.org/CXF20DOC/interceptors.html
[2]. http://cwiki.apache.org/CXF20DOC/debugging.html




On Mon, Aug 10, 2009 at 7:01 AM, Anthony Dahanne <anthony.dahanne@valtech.fr
> wrote:

> Hi,
> I'm using wsdl2java functionality from CXF 2.2.1, to generate a Java
> client.
> I've been able to successfully generate the Java classes including the
> service of my WSDL and associated XSLs.
> The thing is, I would like to be able to read the XML request before it
> leaves the client, and I would also like to see the XML response when it
> gets back to the client.
> Today, the only successful ways I've been able to see the XML output of the
> request and its associated incoming XML response were :
> *through an HTTP proxy like TCPMon or TCPTrace
> *via the log4j facility, creating my own appender and configuring it to
> catch all logs coming from the httpclient.wire.content package
>
> Either ways do not satisfy me :
> *I don't want to depend on a proxy for all my calls
> *the logs from my appender are not accurate, some words are missing...
>
> Is there an API available for CXF generated clients to get the exact XML
> streams sent and received through the network ?
> Thank you for your answers
> Anthony
>
>