axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Blecken" <cblec...@macrovision.com>
Subject RE: Handling faults
Date Tue, 28 Sep 2004 16:48:17 GMT
These two diff should expose the fault object to client code. 

Changes are to 

ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java

and

ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java

I wasn't able to do a runtime test of it (yet), but it generates, compiles and
links fine.

Could somebody apply these please?

Carsten




-----Original Message-----
From: Sanjiva Weerawarana [mailto:sanjiva@opensource.lk]
Sent: Saturday, September 25, 2004 12:54 AM
To: Apache AXIS C Developers List
Subject: Re: Handling faults


Handling faults+1! I think it makes a lot of sense to provide direct access
to
the SOAP fault.

Sanjiva.

----- Original Message ----- 
From: Carsten Blecken
To: axis-c-dev@ws.apache.org
Sent: Saturday, September 25, 2004 6:56 AM
Subject: Handling faults


Hi,
the current fault handling in the client stub code could be improved (in my
opinion).
I wanted to propose to add a member variable of type ISoapFault to the
generated
AxisClientException which constains the fault being thrown. By providing a
fault
accessor in the AxisClientException clients could directly deal with the
fault
information in their catch clauses and access fault string, fault reason,
fault actor
and also the custom fault detail.
This would allow error handling like
        try {
                <invoke web service>
        } catch(AxisClientException& e) {
                // check for soap fault
                if (!(e.getFault() == 0)) {
                        ISoapFault* fault = e.getFault();
                        cout << "Found SOAP fault : " <<
e.getFault()->getFaultstring().c_str() << endl;
                } else {
                        cout << "Exception : " << e.what() << endl;
                }
        } catch(AxisException& e) {
                         cout << "Exception : " << e.what() << endl;
        } catch(exception& e) {
                cout << "Unknown exception has occured" << endl;
        } catch(...) {
                         cout << "Unknown exception has occured"  << endl;
        }
If people a happy with that approach I can provide a patch to the WSDL2Ws
compiler.
Thanks,
Carsten


Mime
View raw message