Posted By:
Tim_Rohaly
Posted On:
Thursday, April 19, 2001 05:17 PM
This is apparently a bug in Sun's implementation of
HttpURLConnection. The HTTP specification clearly
states that a server should return an entity describing
the reason for the error (in your case, the "SOAP Fault" message
would be expected in the body of the returned document).
The only way to read this entity is through the input stream. Sun's HttpURLConnection
seems to throw an exception instead of allowing you to
read the stream.
To work around this, you can use a Socket to connect
to the HTTP server instead of using HttpURLConnection,
or better yet use a third-party HTTP implementation
like HTTPClient (search the networking FAQ for HTTPClient
and you'll find some more information and a link to
download it).