Skip to main content

How to see the raw XML response in JAX-WS 2.1

5 replies [Last post]
gregul
Offline
Joined: 2007-02-22
Points: 0

I just implemented a WS client from a WSDL file which gives me a 'null' response on a procedure call. Is there a way to show the raw XML response that my client received for debugging purposes? How?

Greg, Switzerland

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gkacy
Offline
Joined: 2005-12-14
Points: 0

You need to attach a trace handler ont the client side

This article should shed some light:

http://www.java-tips.org/java-ee-tips/java-api-for-xml-web-services/writ...

Greg, Canada

vivekp
Offline
Joined: 2003-06-10
Points: 0

You can do it simply by setting this system property:

com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true

See for details, https://jax-ws.dev.java.net/nonav/2.1/docs/ri-features.html#Message_logging

-vivek.

patrickblais
Offline
Joined: 2004-06-30
Points: 0

Hi,
It's working but I can see several copies of the same content (except the Instance id which is different ) and it seems that it has logged the same info 3 times... is this normal?

INFO: Request message processed in Tube [ com.sun.xml.ws.api.pipe.helper.PipeAdapter ] Instance [ 813 ] Engine [ com.sun.xml.ws.server.WSEndpointImpl@37100007 ] Thread [ http-thread-pool-1234(1) ]:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns16:loginRequest xmlns:dm="http://dm.app" xmlns:doc="http://doc.app" xmlns:rights="http://rights.app" xmlns:alert="http://alert.app" xmlns:program="http://program.app" xmlns:med="http://med.app" xmlns:mon="http://mon.app" xmlns:device="http://device.app" xmlns:mail="http://mail.app" xmlns:report="http://report.app" xmlns:event="http://event.app" xmlns:wscommon="http://wscommon.app" xmlns:cc="http://cc.app" xmlns:form="http://form.app" xmlns:db="http://db.app" xmlns:ns16="http://patient.app">
      <ns16:user>ye006</ns16:user>
      <ns16:password>ye006</ns16:password>
      <ns16:language>en</ns16:language>
      <ns16:mode>standard</ns16:mode>
    </ns16:loginRequest>
  </S:Body>
</S:Envelope>
INFO: Request message received in Tube [ com.sun.xml.ws.api.pipe.helper.PipeAdapter ] Instance [ 812 ] Engine [ com.sun.xml.ws.server.WSEndpointImpl@37100007 ] Thread [ http-thread-pool-1234(1) ]:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns16:loginRequest xmlns:dm="http://dm.app" xmlns:doc="http://doc.app" xmlns:rights="http://rights.app" xmlns:alert="http://alert.app" xmlns:program="http://program.app" xmlns:med="http://med.app" xmlns:mon="http://mon.app" xmlns:device="http://device.app" xmlns:mail="http://mail.app" xmlns:report="http://report.app" xmlns:event="http://event.app" xmlns:wscommon="http://wscommon.app" xmlns:cc="http://cc.app" xmlns:form="http://form.app" xmlns:db="http://db.app" xmlns:ns16="http://patient.app">
      <ns16:user>ye006</ns16:user>
      <ns16:password>ye006</ns16:password>
      <ns16:language>en</ns16:language>
      <ns16:mode>standard</ns16:mode>
    </ns16:loginRequest>
  </S:Body>
</S:Envelope>
INFO: Request message processed in Tube [ com.sun.xml.ws.api.pipe.helper.PipeAdapter ] Instance [ 811 ] Engine [ com.sun.xml.ws.server.WSEndpointImpl@37100007 ] Thread [ http-thread-pool-1234(1) ]:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns16:loginRequest xmlns:dm="http://dm.app" xmlns:doc="http://doc.app" xmlns:rights="http://rights.app" xmlns:alert="http://alert.app" xmlns:program="http://program.app" xmlns:med="http://med.app" xmlns:mon="http://mon.app" xmlns:device="http://device.app" xmlns:mail="http://mail.app" xmlns:report="http://report.app" xmlns:event="http://event.app" xmlns:wscommon="http://wscommon.app" xmlns:cc="http://cc.app" xmlns:form="http://form.app" xmlns:db="http://db.app" xmlns:ns16="http://patient.app">
      <ns16:user>ye006</ns16:user>
      <ns16:password>ye006</ns16:password>
      <ns16:language>en</ns16:language>
      <ns16:mode>standard</ns16:mode>
    </ns16:loginRequest>
  </S:Body>
</S:Envelope>
INFO: Request message received in Tube [ com.sun.xml.ws.protocol.soap.ServerMUTube ] Instance [ 810 ] Engine [ com.sun.xml.ws.server.WSEndpointImpl@37100007 ] Thread [ http-thread-pool-1234(1) ]:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns16:loginRequest xmlns:dm="http://dm.app" xmlns:doc="http://doc.app" xmlns:rights="http://rights.app" xmlns:alert="http://alert.app" xmlns:program="http://program.app" xmlns:med="http://med.app" xmlns:mon="http://mon.app" xmlns:device="http://device.app" xmlns:mail="http://mail.app" xmlns:report="http://report.app" xmlns:event="http://event.app" xmlns:wscommon="http://wscommon.app" xmlns:cc="http://cc.app" xmlns:form="http://form.app" xmlns:db="http://db.app" xmlns:ns16="http://patient.app">
      <ns16:user>ye006</ns16:user>
      <ns16:password>ye006</ns16:password>
      <ns16:language>en</ns16:language>
      <ns16:mode>standard</ns16:mode>
    </ns16:loginRequest>
  </S:Body>
</S:Envelope>
INFO: Request message processed in Tube [ com.sun.xml.ws.protocol.soap.ServerMUTube ] Instance [ 809 ] Engine [ com.sun.xml.ws.server.WSEndpointImpl@37100007 ] Thread [ http-thread-pool-1234(1) ]:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns16:loginRequest xmlns:dm="http://dm.app" xmlns:doc="http://doc.app" xmlns:rights="http://rights.app" xmlns:alert="http://alert.app" xmlns:program="http://program.app" xmlns:med="http://med.app" xmlns:mon="http://mon.app" xmlns:device="http://device.app" xmlns:mail="http://mail.app" xmlns:report="http://report.app" xmlns:event="http://event.app" xmlns:wscommon="http://wscommon.app" xmlns:cc="http://cc.app" xmlns:form="http://form.app" xmlns:db="http://db.app" xmlns:ns16="http://patient.app">
      <ns16:user>ye006</ns16:user>
      <ns16:password>ye006</ns16:password>
      <ns16:language>en</ns16:language>
      <ns16:mode>standard</ns16:mode>
    </ns16:loginRequest>
  </S:Body>
</S:Envelope>
INFO: Request message received in Tube [ com.sun.xml.ws.server.sei.SEIInvokerTube ] Instance [ 808 ] Engine [ com.sun.xml.ws.server.WSEndpointImpl@37100007 ] Thread [ http-thread-pool-1234(1) ]:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns16:loginRequest xmlns:dm="http://dm.app" xmlns:doc="http://doc.app" xmlns:rights="http://rights.app" xmlns:alert="http://alert.app" xmlns:program="http://program.app" xmlns:med="http://med.app" xmlns:mon="http://mon.app" xmlns:device="http://device.app" xmlns:mail="http://mail.app" xmlns:report="http://report.app" xmlns:event="http://event.app" xmlns:wscommon="http://wscommon.app" xmlns:cc="http://cc.app" xmlns:form="http://form.app" xmlns:db="http://db.app" xmlns:ns16="http://patient.app">
      <ns16:user>ye006</ns16:user>
      <ns16:password>ye006</ns16:password>
      <ns16:language>en</ns16:language>
      <ns16:mode>standard</ns16:mode>
    </ns16:loginRequest>
  </S:Body>
</S:Envelope>
t_srinivasan
Offline
Joined: 2005-06-05
Points: 0

I am looking same. need to eliminate illegal XML characters. I think this is very common issue and for this I am try get hold of RAW XML and eliminate illegal XML chars and set XML back into Response before parsing it.

Any help would be appreciated.

snajper
Offline
Joined: 2004-10-01
Points: 0

So, does the option above work for you?