[ http://issues.apache.org/jira/browse/AXIS2-917?page=all ]

William Ferguson updated AXIS2-917:
-----------------------------------

    Attachment: axis2-917-example.jar

Here  is a simple example of  how to use faults starting from a WSDL.

It  contains
1) ReadMe.html explaining the example
2) service project containing the WSDL and an Ant build file with which to 
generate the service
3) client project containing the (same) WSDL, BankClient class and an Ant build 
file with which to create and execute the client.

Some notes
1) I think we also need to provide an example of using faults where the service 
is defined from a Service implementation class and services xml (and from which 
a WSDL is generated) as I suspect this will become a more common path for 
development going forward.

2) I think it is wrong that WSDL2Java is generating Exceptions that extend from 
RemoteException instead of Exception for the application faults. I thought 
RemoteException denoted a failure in the transport layer.

3) The constructor of the generated stub throws Exception when AFAIK it can 
only throws AxisFault (for constructing the ServiceClient). It is NEVER a good 
idea to throw the base Exception class as it means that a client is forced into 
catching RuntimeException when they may not want to.

4) IMHO it is wrong for the AxisEngine class to be logging at INFO when it 
receives an application-layer (not transport-layer) fault.

5) I used an Ant target in the example to execute the client as the run.bat 
scripts in the shipped samples do not configure a useable classpath on my 
machine (Windows 2000 SP3). I only get the final 3 AXIS2 libraries.

> User guide should give explanation and examples of fault handling
> -----------------------------------------------------------------
>
>                 Key: AXIS2-917
>                 URL: http://issues.apache.org/jira/browse/AXIS2-917
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Wish
>          Components: samples, build,site  & docs
>    Affects Versions: 1.0
>            Reporter: Derek Foster
>         Assigned To: Eran Chinthaka
>            Priority: Blocker
>         Attachments: axis2-917-example.jar, sampleService-wsdl.rar
>
>
> The Axis2 user guide provides no examples of:
>   1) The WSDL to declare that a fault may be thrown from an operation 
> (suitable for passing into WSDL2Java)
>   2) The server-side code for a fault exception, as generated by WSDL2Java 
> and modified as a user might be expected to modify it.
>   3) The server-side code to throw the fault exception, including a tested 
> example of passing on a custom error message to be transmitted as part of a 
> SOAP fault (in the faultDetail) and received by the client.
>   4) The client-side code for receiving and handling a fault.
> Furthermore, what discussion of faults that there is seems fairly 
> contradictory. For instance, there are various suggestions that throwing an 
> AxisFault exception from a service is the way to issue a fault. However, 
> WSDL2Java does not generate service methods that are declared to throw 
> AxisFault, and there seems to be no way to declare such a fault in WSDL. (at 
> least, none that I can find). Fault generation from a service that was not 
> generated by WSDL2Java should be treated as a separate section, since it is 
> handled in a totally different manner by server code. I think that both kinds 
> of fault handling need to be documented clearly in the user guide.
> I have been trying for weeks to figure out how this is supposed to work, and 
> still haven't gotten it to work quite right (my custom error message included 
> in the thrown fault exception is getting lost somewhere before the SOAP fault 
> is transmitted). This is a basic feature that should be documented clearly.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to