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 Fri, 07 May 2004 05:50:01 GMT
> Damitha,
>     What is X in this case?

#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
#define AXISC_TRY
#define AXISC_CATCH(X)
#define AXISC_ENDCATCH
#define AXISC_THROW(X) return X

#endif

X in the first AXISC_THROW(X) (exception enabled case) is an int error
code which already defined or any exception object(for example bad_cast)

in the seconde AXISC_THROW(X) (exception disabled) is an int error code
>
>>>From non exception case:
>> #define AXISC_THROW(X) return X
> suggests that X must be int.
>
> If the exception model cannot use objects (i.e. throw and catch objects)
> that is not that useful.
As you can see above you can throw and catch objects

>
> Also, if you are to use
>> #define AXISC_THROW(X) return X
> then the methods invocation would look like:
>> iStatus = ws.add(i1, i2, iResult);
>
> But the prefferes way is
>
>  result = ws.add(i1, i2);

Yes there are two ways.(both are if you don't use exceptions)
either
iStatus = ws.add(i1,i2, iResult)
or
iResult = ws.add(i1,i2, iStatus)

I prefer the first

if you use exceptions

we can have
try
    ws.add(i1,i2, iResult)
catch(exception& ){}

Still you can get the result through iResult

damitha


>
> --- damitha@opensource.lk wrote:
>> 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
>>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs
> http://hotjobs.sweepstakes.yahoo.com/careermakeover
>
>


Mime
View raw message