All-

I have a somewhat basic question regarding custom / user defined faults in
Axis.  First, some background:

I define my services via WSDL, and translate them into Java classes.  In my
WSDL I define a fault, and what is generated is a class that extends AxisFault.


In my server side implementation, I subclass the BindingSkeleton, and implement
the operations I defined in my WSDL.  Because I included fault information, 
Axis correctly defined the operations with "throws" clauses for my exceptions.


In one of my unit tests, I tickle the server side operation in such a way that
should generate a user defined fault.  In my client side code, I'm working 
through the details of how I detect the user defined fault.  That's where my
questions are thrown from.

I'm not sure of the proper terminology for my invocation style, but I'm using
Axis via the Call interface, and invoking invoke(Object[]).  I'm catching an
AxisFault when I tickle the interface intending to generate the exception.
My code is entering the catch block for AxisFault correctly.

My first question is:
  In this invocation style, are the string and reason supposed to be blank?

If I print out my AxisFault (e.printStackTrace(System.out)), what I see is:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode:
 faultString:
 faultActor:
 faultNode:
 faultDetail:
        {}fault: null
        {http://xml.apache.org/axis/}exceptionName: 
gov.nasa.echo.adapter.order.types.faults.DisconnectedEndpointFault
                                                                                
                                                                                
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)       
 at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        ..... and so on



Shouldn't the faultCode returned be a Server.userException?
Is this a problem with the type of my fault (DisconnectedEndpointFault) not 
being properly registered with Axis?  I have registered my mapping in the
TypeMapping instance I use:
String prefix = "http://order.adapter.echo.nasa.gov";;
qn = new QName(prefix + "/types/faults", "DisconnectedEndpointFault");
map.register(DisconnectedEndpointFault.class, qn,
             new BeanSerializerFactory(DisconnectedEndpointFault.class, qn),
             new BeanDeserializerFactory(DisconnectedEndpointFault.class, qn));



I can work around the problem by looking in the 2nd element of the fault 
details Element[], but would like clarification as to if I'm doing something
stupid.  

If the case is that I'm not registering my types properly, and if I registered
them correctly then faultString would be the fully qualified name of my
fault class, it would save me a lot of time.


Any help is greatly appreciated,
-c

-- 
 20:15:00  up 70 days,  9:59, 15 users,  load average: 0.17, 0.29, 0.23

Reply via email to