Skip to main content

StreamingSender raises missing document root

2 replies [Last post]
jsweeney
Offline
Joined: 2005-05-06
Points: 0

I have a jax-rpc web service that I generated using jwsdp 1.2 tools. It all works fine except when I try to throw a user defined Exception on the server side, I get the following exception on the client:

ava.rmi.RemoteException: Runtime exception; nested exception is:
XML parsing error: com.sun.xml.rpc.sp.ParseException:1: Document root element is missing
at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingS ender.java:258)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:240)
at com.wstest.webrpc.ObjectPropertiesIF_Stub.createObject(ObjectPropertiesIF_Stub. java:69)
at com.wstest.webrpc.clients.MyClientProxy.createObject(MyClientProxy.java:128)
. . .

When I inspect the SOAP response I see the following:

HTTP/1.1 500 Internal Server Error
Date: Wed, 04 May 2005 17:12:52 GMT
Server: Apache/2.0.52 (Win32) mod_jk2/2.0.4
SOAPAction: ""
Content-Type: text/xml; charset="utf-8"
Connection: close
Transfer-Encoding: chunked

371
<?xml version="1.0" encoding="UTF-8"?>
env:Servercom.wstest.webrpc.MyServerException&l t;ans1:MyServerException xmlns:ans1="http://com.test/wsdl/MyObjectProperties" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns0:MyServerException">2This is a dummy error
0

which appears to my untrained eyes to be a reasonably legitimate fault response. Can anyone tell me why my client is choking on this instead of raising the appropriate exception?

Thanks!

Jim

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohlert
Offline
Joined: 2003-06-16
Points: 0

Jim,
Would you mind sending the capture of a normal response?

Thanks

sintaur
Offline
Joined: 2005-05-18
Points: 0

I helped jsweeney debug this using Ethereal. When the Tomcat servlet returns a response via IIS, the XML is sent as a "plain" HTTP response body. When the same servlet returns a response via Apache (2.0.52/mod_jk2.so), the HTTP response has a "Transfer-Encoding: chunked" header, and the XML is chunked. So apparently the soap client cannot parse chunked HTTP responses. (Chunked responses are used in HTTP/1.1 when you don't know the Content-Length in advance.) A workaround is to disable chunking by setting something like this in your httpd.conf: SetEnvIf Request_URI "^/YourSoapRequestSignature/.*" downgrade-1.0

Message was edited by: sintaur