You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by feng xie <xi...@yahoo.com> on 2005/09/29 20:35:02 UTC

How to make Soap server send back response with Http status code = 400, bad request

A few days ago, I sent out an email asking for the
possible http status code used by Axis server when
sending back Soap response. I got back answers with a
list of http status code:

200 OK
202 Accepted
307 Temporary Redirect
400 Bad Request
405 Method Not Allowed
415 Unsupported Media Type
500 Internal Server Error

For my case, whenever my server side code raises a
user defined expection which extends
org.apache.axis.AxisFault, even for a client side
error (such as bad request with wrong parameter), the
Axis server sends back Soap fault with http status
code of 500. Seems to me, status code of 500 (
internal server error ) doesn't fit very well some
cases where the client sends wrong requests.

So, my new question is: how to let the Axis server
send back Soap fault/response with Http status code of
4XX ( for instances, 400 for Bad Request).  The WS-I
Basic Profile V1.0 says " R1126   An INSTANCE MUST use
a "500 Internal Server Error" HTTP status code if the
response message is a SOAP Fault.".

Should the server side code throw
java.rmi.RemoteException for the case of Bad Request ?

Thanks in advance,
Feng



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/