You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Manolescu, Radu (IT)" <Ra...@MorganStanley.com> on 2008/06/13 02:23:09 UTC

View SOAP Messages

We do not seem to be able to configure SOAP message logging for a CXF
client. What are we missing?
 
 
We have used http://cwiki.apache.org/CXF20DOC/debugging.html as a guide.
 
We have tried to put this in the client code, but nothing got printed:
            PrintWriter pw = new PrintWriter(System.out);
            Client client = ClientProxy.getClient(port);
            client.getInInterceptors().add(new
LoggingInInterceptor(pw)); // Also tried "new LoggingInInterceptor()"
            client.getOutInterceptors().add(new
LoggingOutInterceptor(pw));

We have tried to put this in the cxf.xml file, but nothing got printed:
    <bean id="logInbound"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
    <bean id="logOutbound"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
 
    <cxf:bus>
        <cxf:features><cxf:logging/></cxf:features>    
        <cxf:inInterceptors><ref
bean="logInbound"/></cxf:inInterceptors>
        <cxf:inFaultInterceptors><ref
bean="logInbound"/></cxf:inFaultInterceptors>
        <cxf:outInterceptors><ref
bean="logOutbound"/></cxf:outInterceptors>
        <cxf:outFaultInterceptors><ref
bean="logOutbound"/></cxf:outFaultInterceptors>
    </cxf:bus>

We do not control the service, and our messages probably do not even get
sent.
We are getting an error that says that our messages are malformed, but
since they are automatically generated, we do not know what they look
like.
We would like to see the SOAP messages as they are generated, in order
to troubleshoot the problem.
 
For the record, the error message we get is the following:
 
Caused by: javax.xml.stream.XMLStreamException: ParseError at
[row,col]:[1,50]
Message: White spaces are required between publicId and systemId.
 at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
 at com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
 at
msjava.msxml.stream.TextMSXMLStreamReader.nextTag(TextMSXMLStreamReader.
java:713)
 at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
sage(ReadHeadersInterceptor.java:85)
 
 
Thanks,
 
Radu Manolescu
Morgan Stanley | Technology
2000 Westchester Ave, 1st Floor | Purchase, NY  10577
Phone: +1 914 225-5871
Mobile: +1 203 648-6964
Radu.Manolescu@MorganStanley.com
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

Re: View SOAP Messages

Posted by Brad <br...@javawork.co.uk>.
If you don't want to download Axis:

http://ws.apache.org/commons/tcpmon/

or

https://tcpmon.dev.java.net/


On Fri, Jun 13, 2008 at 10:15 AM, Ian Roberts <i....@dcs.shef.ac.uk> wrote:
> Eoghan Glynn wrote:
>>
>> Another useful option for viewing SOAP messages on the wire is the Axis
>> tcpmon utility. Just fire up:
>>
>>  java -cp axis.jar org.apache.axis.utils.tcpmon
>>
>> Say your server is listening on port 9000 ... add a listener in tcpmon
>> with:
>> - target port 9000
>> - listen port 8999
>> - under the "port 8999" tab click the XML format check box
>> - reconfigure your client to invoke on port 8999
>
> Alternatively, tcpmon can operate as an HTTP proxy.  Start up
>
>  java -c axis.jar org.apache.axis.utils.tcpmon 8999
>
> and then configure your client to talk through a proxy on port 8999 (e.g.
> with system properties http.proxyHost=localhost and http.proxyPort=8999).
>  That way you don't have to chang the target URL that the client is calling.
>
> Ian
>
> --
> Ian Roberts               | Department of Computer Science
> i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK
>

Re: View SOAP Messages

Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
Eoghan Glynn wrote:
> Another useful option for viewing SOAP messages on the wire is the Axis 
> tcpmon utility. Just fire up:
> 
>   java -cp axis.jar org.apache.axis.utils.tcpmon
> 
> Say your server is listening on port 9000 ... add a listener in tcpmon 
> with:
> - target port 9000
> - listen port 8999
> - under the "port 8999" tab click the XML format check box
> - reconfigure your client to invoke on port 8999

Alternatively, tcpmon can operate as an HTTP proxy.  Start up

   java -c axis.jar org.apache.axis.utils.tcpmon 8999

and then configure your client to talk through a proxy on port 8999 
(e.g. with system properties http.proxyHost=localhost and 
http.proxyPort=8999).  That way you don't have to chang the target URL 
that the client is calling.

Ian

-- 
Ian Roberts               | Department of Computer Science
i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK

Re: View SOAP Messages

Posted by Eoghan Glynn <eg...@iona.com>.


Glen Mazza wrote:
> Two options I can think of:
> 
> 1.) Wireshark--scroll down to the bottom of that debugging page.  But
> you're doubting that that SOAP message is even getting on the wire, so
> this may not help you much.


Another useful option for viewing SOAP messages on the wire is the Axis 
tcpmon utility. Just fire up:

   java -cp axis.jar org.apache.axis.utils.tcpmon

Say your server is listening on port 9000 ... add a listener in tcpmon with:
- target port 9000
- listen port 8999
- under the "port 8999" tab click the XML format check box
- reconfigure your client to invoke on port 8999

But of course as Glen says, not much use if the SOAP payload isn't even 
getting on the wire.

/Eoghan

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: View SOAP Messages

Posted by Glen Mazza <gl...@verizon.net>.
Two options I can think of:

1.) Wireshark--scroll down to the bottom of that debugging page.  But
you're doubting that that SOAP message is even getting on the wire, so
this may not help you much.

2.) Eclipse debugging--that will allow you to trace through and figure
out what that SOAP message error is.  It is not that difficult, once you
determine in which interceptors the break points need to be placed:
http://www.jroller.com/gmazza/date/20071212

 at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:85)
>  

Actually, the above line is probably where you want to place your
breakpoint to determine what is wrong with your message.

HTH,
Glen


2008-06-12 Manolescu, Radu (IT) wrote:
> We do not seem to be able to configure SOAP message logging for a CXF
> client. What are we missing?
>  
> 
> We have used http://cwiki.apache.org/CXF20DOC/debugging.html as a guide.
>  
> We have tried to put this in the client code, but nothing got printed:
>             PrintWriter pw = new PrintWriter(System.out);
>             Client client = ClientProxy.getClient(port);
>             client.getInInterceptors().add(new
> LoggingInInterceptor(pw)); // Also tried "new LoggingInInterceptor()"
>             client.getOutInterceptors().add(new
> LoggingOutInterceptor(pw));
> 
> We have tried to put this in the cxf.xml file, but nothing got printed:
>     <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>     <bean id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>  
>     <cxf:bus>
>         <cxf:features><cxf:logging/></cxf:features>    
>         <cxf:inInterceptors><ref
> bean="logInbound"/></cxf:inInterceptors>
>         <cxf:inFaultInterceptors><ref
> bean="logInbound"/></cxf:inFaultInterceptors>
>         <cxf:outInterceptors><ref
> bean="logOutbound"/></cxf:outInterceptors>
>         <cxf:outFaultInterceptors><ref
> bean="logOutbound"/></cxf:outFaultInterceptors>
>     </cxf:bus>
> 
> We do not control the service, and our messages probably do not even get
> sent.
> We are getting an error that says that our messages are malformed, but
> since they are automatically generated, we do not know what they look
> like.
> We would like to see the SOAP messages as they are generated, in order
> to troubleshoot the problem.
>  
> For the record, the error message we get is the following:
>  
> Caused by: javax.xml.stream.XMLStreamException: ParseError at
> [row,col]:[1,50]
> Message: White spaces are required between publicId and systemId.
>  at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
>  at com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
>  at
> msjava.msxml.stream.TextMSXMLStreamReader.nextTag(TextMSXMLStreamReader.
> java:713)
>  at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:85)
>  
> 
> Thanks,
>  
> Radu Manolescu
> Morgan Stanley | Technology
> 2000 Westchester Ave, 1st Floor | Purchase, NY  10577
> Phone: +1 914 225-5871
> Mobile: +1 203 648-6964
> Radu.Manolescu@MorganStanley.com
> --------------------------------------------------------
> 
> NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.