You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by da...@opensource.lk on 2004/05/06 07:35:26 UTC

Suggestion on receiving soap fault

Hi,

Curretnly Axis C++ does not handle a soap body that contains a soap fault.
When we receive a soap fault, I have suggestions how to handle it.
Suppose that we request to add two numbers in the calculator sample.
in the current code
iResult = ws.add(i1, i2); But then we cannot get the status of the
response, success or fail. Instead if we have
iStatus = ws.add(i1, i2, iResult) where i1, i2 are the numbers to add,
iResult is to accept the result of the addition and iStatus is the status
of the response, success or failure.

So if server returns soap fault we should have iStatus = fail.

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?

regds
damitha




Re: Suggestion on receiving soap fault

Posted by Kenneth Chiu <ch...@cs.indiana.edu>.
On Fri, 7 May 2004, Mark Sizer wrote:
> Addressing a point that got lost: C compatibility.
>
> You really have to make a choice: C++ or C. Make it and stick with it -
> do NOT try to combine them (e.g. by having macros that throw integers).

It seems that they can achieve a degree of interoperability
by just creating C wrappers that catch all C++ exceptions,
and then use C-based techniques for reporting exceptions.

Re: Suggestion on receiving soap fault

Posted by Mark Sizer <gc...@15grant.com>.
damitha@opensource.lk wrote:
>>Damitha,
>>    What is X in this case?
[snip]
> 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

There are a couple of problems with this.

#1. All exceptions should be derived from std::exception - that allows 
easy integration into existing code that has catch ( std::exception& ) 
blocks. Don't throw ints - it defeats the purpose (i.e. all the 
additional information is lost and some sort of "getLastError()" thing 
has to implemented on top of the exception handling. Pick a method and 
stick with it.

#2. Exceptions should ALWAYS be caught by reference, not value, to avoid 
exception slicing.

#3. Personal opinion: Macros should be avoided at all costs. I wish C++ 
mode had a way to turn them off. They make for very difficult to manage 
code (one has to test all the macro paths [compile time] in addition to 
testing all the run-time paths). That's just my opinion, not widely 
held. #1 and #2 are "industry standard" stuff.

>>>>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

You can, but it's VERY dangerous - catching, and rethrowing, can result 
in very unexpected behavior when done by value - the slicing problem (if 
you're not aware of it, I'd suggest a Google search - I don't have a 
good reference handy and I'm sure others have written about it better 
than I would here).

[snip]
(Others have further addressed the function vs procedure issue)

Addressing a point that got lost: C compatibility.

You really have to make a choice: C++ or C. Make it and stick with it - 
do NOT try to combine them (e.g. by having macros that throw integers).

If C compatibility is a primary design consideration, go with the return 
code. Consistency is vital. However, if you're going that route, I'd 
suggest using the new-ish error handling stuff that the gcc libraries 
use - they've dealt with many of the threading issues. (e.g. one does 
not reference _errno [or whatever it is, I haven't done C in years] 
directly any longer).

Good luck - it's easy to throw advice from the sidelines :)

- Mark


Re: Suggestion on receiving soap fault

Posted by Kenneth Chiu <ch...@cs.indiana.edu>.
On Fri, 7 May 2004 damitha@opensource.lk wrote:
> > Damitha,
> >     What is X in this case?
>
> #ifdef __ENABLE_AXIS_EXCEPTION__

Just a reminder that macros that begin with a leading
underscore are reserved.  From the C++ Standard:

      17.4.3.1.2 Global names

    1 Certain sets of names and function signatures are always
      reserved to the implementation:

      - Each name that contains a double underscore (__) or
	begins with an underscore followed by an uppercase
	letter (2.11) is reserved to the implementation for any
	use.

In this case __ENABLE_AXIS_EXCEPTION__ is unlikely to
collide with a compiler implementation name, but as a
general rule, it's best to avoid any leading underscores.

Re: Suggestion on receiving soap fault

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Hi Damitha,
   Both 
> iStatus = ws.add(i1,i2, iResult)
and
> iResult = ws.add(i1,i2, iStatus)
take too many parameters. This does not look neat.

We can have 
   result = ws.add(i1,i2);
which is a natural method call.
To track the error use a seperate method call, in non exception case.

Also 
> try {
>     ws.add(i1,i2, iResult)
> }catch(exception& ){}
looks like a procedure call and not function call as Mark earlier pointed out.

A better mechanism is
 try {
     result = ws.add(i1,i2);
 } catch(exception& ){}

Also if you think of semantics, add should take two parameters and return a result.
The error code is something external to the method invocation, and thus has to be handled external
to the method call. Passing a third parameter to add violates programming principles.

Thanks,
Samisa...





--- damitha@opensource.lk wrote:
> > 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
> >
> >
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

Re: Suggestion on receiving soap fault

Posted by da...@opensource.lk.
> 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
>
>


Re: Suggestion on receiving soap fault

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Damitha,
    What is X in this case? 

>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.

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);

Please clarify.

Thanks,
Samisa...



--- 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 

Re: Suggestion on receiving soap fault

Posted by John Hawkins <HA...@uk.ibm.com>.



But this'll only work if they compile the base code again right? This is
restrictive. Wouldn't it be better to try and remove all these compile time
dependencies so we can just let people use the code without recompilation
all the time?




John Hawkins,



                                                                           
             damitha@opensourc                                             
             e.lk                                                          
                                                                        To 
             06/05/2004 09:18          "Apache AXIS C User List"           
                                       <ax...@ws.apache.org>         
                                                                        cc 
             Please respond to                                             
              "Apache AXIS C                                       Subject 
                User List"             Re: Suggestion on receiving soap    
                                       fault                               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




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




Re: Suggestion on receiving soap fault

Posted by da...@opensource.lk.
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


Re: Suggestion on receiving soap fault

Posted by John Hawkins <HA...@uk.ibm.com>.



+1 :-)


John Hawkins,



                                                                           
             Mark Sizer                                                    
             <gc...@15grant.com>                                             
                                                                        To 
             06/05/2004 08:42          Apache AXIS C User List             
                                       <ax...@ws.apache.org>         
                                                                        cc 
             Please respond to                                             
              "Apache AXIS C                                       Subject 
                User List"             Re: Suggestion on receiving soap    
                                       fault                               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




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.

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

- Mark




Re: Suggestion on receiving soap fault

Posted by Mark Sizer <gc...@15grant.com>.
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.

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

- Mark


Re: Suggestion on receiving soap fault

Posted by John Hawkins <HA...@uk.ibm.com>.



Hi,

Do we have a Message class and thus a FaultMessage class?

I would much prefer if we returned FaultMessages from the getFaultDetail
method e.g.

    FaultMessage[] fault = ws.getFaultDetail();




John Hawkins,



                                                                           
             damitha@opensourc                                             
             e.lk                                                          
                                                                        To 
             06/05/2004 06:35          axis-c-dev@ws.apache.org,           
                                       axis-c-user@ws.apache.org           
                                                                        cc 
             Please respond to                                             
              "Apache AXIS C                                       Subject 
             Developers List"          Suggestion on receiving soap fault  
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi,

Curretnly Axis C++ does not handle a soap body that contains a soap fault.
When we receive a soap fault, I have suggestions how to handle it.
Suppose that we request to add two numbers in the calculator sample.
in the current code
iResult = ws.add(i1, i2); But then we cannot get the status of the
response, success or fail. Instead if we have
iStatus = ws.add(i1, i2, iResult) where i1, i2 are the numbers to add,
iResult is to accept the result of the addition and iStatus is the status
of the response, success or failure.

So if server returns soap fault we should have iStatus = fail.

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?

regds
damitha






RE: Suggestion on receiving soap fault

Posted by Susantha Kumara <su...@opensource.lk>.
Lets look at the user's perspective in this regard. How does a user need
a stub to look like ?.

Theoretically an application which uses a stub should feel as if it's a
local method. Isn't it so ?.

---
Susantha

-----Original Message-----
From: damitha@opensource.lk [mailto:damitha@opensource.lk] 
Sent: Thursday, May 06, 2004 11:35 AM
To: axis-c-dev@ws.apache.org; axis-c-user@ws.apache.org
Subject: Suggestion on receiving soap fault

Hi,

Curretnly Axis C++ does not handle a soap body that contains a soap
fault.
When we receive a soap fault, I have suggestions how to handle it.
Suppose that we request to add two numbers in the calculator sample.
in the current code
iResult = ws.add(i1, i2); But then we cannot get the status of the
response, success or fail. Instead if we have
iStatus = ws.add(i1, i2, iResult) where i1, i2 are the numbers to add,
iResult is to accept the result of the addition and iStatus is the
status
of the response, success or failure.

So if server returns soap fault we should have iStatus = fail.

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?

regds
damitha







Re: Suggestion on receiving soap fault

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
I too think that function call should look like:
    result = ws.add(i1, i2);
and not
> iStatus = ws.add(i1, i2, iResult);

Exception model is preffered for fault mapping.
Howver an unconditional API call like:
    ws.getFaultDetail(&pcDetail);
could also be used after each method invocation to track errors.

Thnaks,
Samisa...


--- damitha@opensource.lk wrote:
> Hi,
> 
> Curretnly Axis C++ does not handle a soap body that contains a soap fault.
> When we receive a soap fault, I have suggestions how to handle it.
> Suppose that we request to add two numbers in the calculator sample.
> in the current code
> iResult = ws.add(i1, i2); But then we cannot get the status of the
> response, success or fail. Instead if we have
> iStatus = ws.add(i1, i2, iResult) where i1, i2 are the numbers to add,
> iResult is to accept the result of the addition and iStatus is the status
> of the response, success or failure.
> 
> So if server returns soap fault we should have iStatus = fail.
> 
> 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?
> 
> regds
> damitha
> 
> 
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

RE: Suggestion on receiving soap fault

Posted by Susantha Kumara <su...@opensource.lk>.
Lets look at the user's perspective in this regard. How does a user need
a stub to look like ?.

Theoretically an application which uses a stub should feel as if it's a
local method. Isn't it so ?.

---
Susantha

-----Original Message-----
From: damitha@opensource.lk [mailto:damitha@opensource.lk] 
Sent: Thursday, May 06, 2004 11:35 AM
To: axis-c-dev@ws.apache.org; axis-c-user@ws.apache.org
Subject: Suggestion on receiving soap fault

Hi,

Curretnly Axis C++ does not handle a soap body that contains a soap
fault.
When we receive a soap fault, I have suggestions how to handle it.
Suppose that we request to add two numbers in the calculator sample.
in the current code
iResult = ws.add(i1, i2); But then we cannot get the status of the
response, success or fail. Instead if we have
iStatus = ws.add(i1, i2, iResult) where i1, i2 are the numbers to add,
iResult is to accept the result of the addition and iStatus is the
status
of the response, success or failure.

So if server returns soap fault we should have iStatus = fail.

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?

regds
damitha