axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@opensource.lk
Subject Re: Suggestion on receiving soap fault
Date Thu, 06 May 2004 08:18:37 GMT
Hi Mark,
Yes, that comes to the other part of the solution. What I plan is to use
macros like this in the axis c++ libraries

#ifdef __ENABLE_AXIS_EXCEPTION__
#define AXISC_TRY try {
#define AXISC_CATCH(X) } catch (X) {
#define AXISC_ENDCATCH }
#define AXISC_THROW(X) throw AxisException(X)

#else //you don't want exception handling enabled
#define AXISC_TRY
#define AXISC_CATCH(X)
#define AXISC_ENDCATCH
#define AXISC_THROW(X) return X

#endif

So that the user of the library can disable exception handling if he
wants. This is important when your service or client is written in C.

> damitha@opensource.lk wrote:
>> Curretnly Axis C++ does not handle a soap body that contains a soap
>> fault.
> [snip]
>> In addition SoapDeseriazer concatenate Faultcode, Faultstring,
>> Faultactor
>> and FaultDetail into a string. So when we receive iStatus = fail we can
>> request
>> the fault string that the SoapDeserializer stored as follows
>>
>> iStatus = ws.add(i1, i2, iResult);
>> if(AXIS_SUCCESS == iStatus)
>>     printf("Result : %d\n\n", iResult);
>> else
>> {
>>     printf("Failed\n");
>>     ws.getFaultDetail(&pcDetail);
>>     printf("pcDetail:%s\n", pcDetail);
>> }
>>
>> Any suggestions?
>
> Throw an exception with the error stuff inside it.
>
> If you insist on sticking with return codes, for goodness's sake don't
> use the "getLastError" stuff - it's horribly vulnerable to threading
> errors.
agree

>
> As an academic argument against your solution: You've removed all
> functions from the system. Everything is a procedure with output
> variables.
>
> - Mark

damitha


Mime
View raw message