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 Sharanka Perera <sh...@opensource.lk> on 2004/08/13 13:29:25 UTC

Can a handler determine if a SOAP request should be abandoned?

Hi,

Is it possible to instruct Axis to abort processing on a SOAP request from within a handler? For instance, if a handler is used to authenticate a request, there should be some way to abort the whole thing and return to status quo if the authentication attempt fails. A handler comes with a "onFault" method, but I don't know if this will simply report an error to the Axis engine or make it stop the SOAP message processing altogether.


Thanks!

Sharanka

RE: Can a handler determine if a SOAP request should be abandoned?

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



Hi Susantha,

Just been in this code to look at the fini stuff in the other thread and
seen this ->
/*
     *  The case clauses in this switch statement have no breaks.
     *  Hence, if Everything up to web service invocation was successful
     *  then all response handlers are invoked. If there was a failure
     *  at some point the response handlers from that point onwards
     *  are invoked.
     */
    switch (level)
    {
        case AE_SERV: // everything success
            Status = AXIS_SUCCESS;
            // no break;
        case AE_TRH: /* after invoking the transport handlers
                      * (at actual service invokation) it has failed
                  */
            if (m_pTResFChain)
            {
                m_pTResFChain->invoke (pMsg);
            }
            // no break;
        case AE_GLH: // transport handlers have failed
            // invoke global response handlers
            if (m_pGResFChain)
            {
                m_pGResFChain->invoke (pMsg);
            }
            //no break;
        case AE_SERH: // global handlers have failed
            // invoke web service specific response handlers
            if (m_pSResFChain)
            {
                m_pSResFChain->invoke (pMsg);
            }
            // no break;
        case AE_START:; // service specific handlers have failed
    };


Why do we continue? If there is an error then I would expect to stop the
request, call the onfault methods of the handlers that have already been
invoked  and send back an exception to the user so they know what went
wrong in their stub?

thoughts?


John Hawkins




                                                                           
             John                                                          
             Hawkins/UK/IBM@IB                                             
             MGB                                                        To 
                                       "Apache AXIS C Developers List"     
             17/08/2004 09:08          <ax...@ws.apache.org>          
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
              "Apache AXIS C           RE: Can a handler determine if a    
             Developers List"          SOAP request should be abandoned?   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           








Hello,

What does the caller of the service see - an exception?

John Hawkins




             "Susantha Kumara"
             <susantha@opensou
             rce.lk>                                                    To
                                       "'Apache AXIS C Developers List'"
             17/08/2004 06:32          <ax...@ws.apache.org>
                                                                        cc

             Please respond to                                     Subject
              "Apache AXIS C           RE: Can a handler determine if a
             Developers List"          SOAP request should be abandoned?










Yes if the invoke method returns AXIS_FAIL Axis abandons the SOAP request.
But the onFault method of same handler’s and previously invoked handler’s
are called in reverse order.





Susantha Kumara


Virtusa (pvt) Ltd.


Office : +94112714385


Mobile : +94777420453


-----Original Message-----
From: Sharanka Perera [mailto:sharanka@opensource.lk]
Sent: Friday, August 13, 2004 5:29 PM
To: Apache AXIS C Developers List
Subject: Can a handler determine if a SOAP request should be abandoned?





Hi,





Is it possible to instruct Axis to abort processing on a SOAP request from
within a handler? For instance, if a handler is used to authenticate a
request, there should be some way to abort the whole thing and return to
status quo if the authentication attempt fails. A handler comes with a
"onFault" method, but I don't know if this will simply report an error to
the Axis engine or make it stop the SOAP message processing altogether.








Thanks!





Sharanka


RE: Can a handler determine if a SOAP request should be abandoned?

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



Hello,

What does the caller of the service see - an exception?

John Hawkins



                                                                           
             "Susantha Kumara"                                             
             <susantha@opensou                                             
             rce.lk>                                                    To 
                                       "'Apache AXIS C Developers List'"   
             17/08/2004 06:32          <ax...@ws.apache.org>          
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
              "Apache AXIS C           RE: Can a handler determine if a    
             Developers List"          SOAP request should be abandoned?   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Yes if the invoke method returns AXIS_FAIL Axis abandons the SOAP request.
But the onFault method of same handler’s and previously invoked handler’s
are called in reverse order.





Susantha Kumara


Virtusa (pvt) Ltd.


Office : +94112714385


Mobile : +94777420453


-----Original Message-----
From: Sharanka Perera [mailto:sharanka@opensource.lk]
Sent: Friday, August 13, 2004 5:29 PM
To: Apache AXIS C Developers List
Subject: Can a handler determine if a SOAP request should be abandoned?





Hi,





Is it possible to instruct Axis to abort processing on a SOAP request from
within a handler? For instance, if a handler is used to authenticate a
request, there should be some way to abort the whole thing and return to
status quo if the authentication attempt fails. A handler comes with a
"onFault" method, but I don't know if this will simply report an error to
the Axis engine or make it stop the SOAP message processing altogether.








Thanks!





Sharanka


RE: Can a handler determine if a SOAP request should be abandoned?

Posted by Susantha Kumara <su...@opensource.lk>.
Yes if the invoke method returns AXIS_FAIL Axis abandons the SOAP
request. But the onFault method of same handler's and previously invoked
handler's are called in reverse order. 
 
Susantha Kumara
Virtusa (pvt) Ltd.
Office : +94112714385
Mobile : +94777420453
-----Original Message-----
From: Sharanka Perera [mailto:sharanka@opensource.lk] 
Sent: Friday, August 13, 2004 5:29 PM
To: Apache AXIS C Developers List
Subject: Can a handler determine if a SOAP request should be abandoned?
 
Hi,
 
Is it possible to instruct Axis to abort processing on a SOAP request
from within a handler? For instance, if a handler is used to
authenticate a request, there should be some way to abort the whole
thing and return to status quo if the authentication attempt fails. A
handler comes with a "onFault" method, but I don't know if this will
simply report an error to the Axis engine or make it stop the SOAP
message processing altogether.
 
 
Thanks!
 
Sharanka