You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Emilio Belmonte <Em...@ENTRUST.COM> on 2002/08/07 16:42:17 UTC

SOAPException and Basic Authentication

I have setup SOAP 2.3 and Tomcat 4.0.3 (JDK 1.3.1, Win2K) to work using
basic authentication.  Things go well when the client (also Apache Soap)
sends the correct username and password. 

When the username and/or password is incorrect, I get the following
exception:

[SOAPException: faultCode=SOAP-ENV:Client; msg=Connection aborted by peer:
JVM_recv in socket input stream read;
targetException=java.net.SocketException: Connection aborted by peer:
JVM_recv in socket input stream read]

I checked the tomcat access log and it is returning the correct status code
(401).

When I put the TcpTunnelGui between the client and the server, I can also
see that the request and response are correct.  But the behavior changes
slightly.  It now throws a more logical exception:

[SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response
content type...

Which is correct because tomcat is sending back, according to the
TcpTunnelGui, a HTML page.

I could get around the second exception because I could access the HTTP
headers from the SOAPHTTPConnection and check the WWW-Authenticate header.
The headers are not present with the first exception.

Does anyone know if this is the expected behavior?

Thanks a lot,

--Emilio