No. Axis is not doing the right thing.

If the error is caused by the wrong parameters sent by the client, then Marco is correct: Axis should set the fault code to Client, not Server.

This is clearly spelled out in the SOAP spec [1].

A fault code of Client indicates that there was something wrong in the request sent by the client, and the client needs to change the request before resubmitting it.

A fault code of Server indicates that the client request was okay, but something happened during processing. The client should be able to resubmit the request without modification.

So an error code of Server.userException makes no sense at all.

I also suggest that we really want to do away with fault subcodes.
The WS-I Basic Profile [2] discourages the use of subcodes:

<WS-I BP quote>
A number of specifications have already defined custom fault codes using the "." (dot) notation. Despite this, their use in future specifications is discouraged.


R1004 When a MESSAGE contains a faultcode element the content of that element SHOULD be one of the fault codes defined in SOAP 1.1 or a namespace qualified fault code.

R1031 When a MESSAGE contains a faultcode element the content of that element SHOULD NOT use of the SOAP 1.1 "dot" notation to refine the meaning of the Fault.

It is recommended that applications that require custom fault codes either use the SOAP1.1 defined fault codes and supply additional information in the detail element, or that they define these codes in a namespace that is controlled by the specifying authority.
</WS-I BP quote>



[1] http://www.w3.org/TR/SOAP/#_Toc478383510
[2] http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.htm#refinement28027464



At 08:34 AM 8/29/2003 -0500, you wrote:
You need to read the SOAP spec on fault codes.  Axis is doing the right
thing.

-----Original Message-----
From: Marco Spinetti [mailto:[EMAIL PROTECTED]
Sent: Friday, August 29, 2003 7:43 AM
To: [EMAIL PROTECTED]
Subject: Fault Code


I've a question about axis fault management.


If my exception extends Remote Exception ( and not AxisFault), in my web
service method I'm able to throw my exception, which is received from
the client (both java and perl).

I have noticed that my exception is inserted as fault details in the
SOAP message.

The problem is that Axis sets the faultcode to
soapenv:Server.userException but this is a error.

I create this error when client sends wrong parameters too, so the
faultcode should be Client and not Server.

How can I tell Axis to set Client and Server in faultcode?

Thanks


--Marco







Reply via email to