how to access original XML document after IllegalStateException in a SOAP client

V

vashek

Hello all,

I need to create a SOAP client for a certain web service. Not having
much experience with XML in Java, I used JAX-WS from jax-
ws.dev.java.net and STAX from dist.codehaus.org. Most things I was
able to get working, but I have a problem in that when the web service
fails for some reason, I get the following exception:

javax.xml.ws.WebServiceException: java.lang.IllegalStateException:
Current state (CHARACTERS) not START_ELEMENT, START_ELEMENT or
END_ELEMENT:
com.bea.xml.stream.MXParser.throwIllegalState(MXParser.java:3849);
@
com.bea.xml.stream.MXParser.getNamespaceURI(MXParser.java:945);
@
com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeFault(SOAPXMLDecoder.java:
342);SOAPDecoder:342;SOAPDecoder:327;SOAPXMLDecoder:197;SOAPXMLDecoder:
142;SOAPXMLDecoder:270;SOAPMessageDispatcher:534;SOAPMessageDispatcher:
258;SOAPMessageDispatcher:137;DelegateBase:
84;EndpointIFInvocationHandler:172;EndpointIFInvocationHandler:106

My problem is that, not being in control of the HTTP request, I have
no access to the XML document that seems to be malformed, and so I
don't know how to dump its contents for debugging purposes, or at
least to report some useful error.
Using a network sniffer, I have been able to get a specific error from
the HTTP response, but as you can imagine, it's not the most
convenient way to debug a problem with a web service...

I'm sure there must be a very simple solution; surely I'm not the
first one to debug an ailing web service (or its client)? :)

Thank you for any advice,

Vaclav Dvorak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top