Hi everybody,

I'm trying to use my own SOAP fault codes instead of the default
"Server.userException". My idea was to let my Web Service class throw a
AxisFault. I can set the faultcode etc. within the AxisFault
constructor. I've set up such a web service that does nothing but throw
a new AxisFault:

---
public class TestWS {
  public void test() throws AxisFault {
     throw new AxisFault(new QName("http://my.ns.com";, "myCode"),
               "myString", "", new Element[0]);
  }
}
---

When I access the test() method with a SOAP client (e.g. .NET web
service studio) I get back a perfect SOAP response message containing a
SOAP Fault block according to the spec.

BUT: The WSDL that is auto-generated by Axis contains a definition of
AxisFault in the targetNamespace "http://axis.apache.org";. Tomcat's
system-out sais "The class java.rmi.RemoteException is defined in a java
or javax package and cannot be converted into an xml schema type. An xml
Schema anyType will be used to define this class in the wsdl file."

AND: When I try to create a client using WSDL2Java I get a
"java.io.IOException: Type {http://axis.apache.org}AxisFault is
referenced but not defined."

------> Axis is not able to create a proxy out of a WSDL definition
created by itself. This surely is a bug, ain't it?

Is there a better way to set my own SOAP fault code?

Thanks for your hints,

Arne

Reply via email to