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 Danny Thornton <dt...@brightstreet.com> on 2001/03/09 02:05:35 UTC

A Solution to 400 Bad Request - Content type must be: 'text/xml'

I was getting this error because of an incorrect version of
xerces.jar/soap.jar.  The first thing to check is what's been posted to this
news group over and over and over again which is to make sure xerces.jar is
first on your classpath, whether it's your server classpath or the classpath
you use from the command line.  The version of xerces.jar that fixed this
problem for me was xerces ver 1.2.3. I'm not sure what version of soap.jar
I'm using because the version is not contained in the soap.jar file.
 
Apparently, some xml processor's will insert the line <?xml version='1.0'
encoding='UTF-8'?> into the post to the SOAP server thus causing the error

Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Protocol;
msg=Unsupported response content type "text/html", must be: "text/xml".
Response was:<head><title>JRun Servlet Error</title></head><h1>400 Bad
Request</h1><body>Content type must be: 'text/xml'.</body>]

at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:173)

at org.apache.soap.rpc.Call.invoke(Call.java:210)

at
org.apache.soap.server.ServiceManagerClient.invokeMethod(ServiceManagerClien
t.java:127)

at
org.apache.soap.server.ServiceManagerClient.deploy(ServiceManagerClient.java
:140)

at
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient.java:2
28)

 

Danny