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 James Jose <ja...@in.ibm.com> on 2005/03/16 11:13:37 UTC

Re:(AXISCPP-551) getAnyObject() API in call class does not return SOAP Fault correctly

John,

   As per the discussions with Mark, I  tried to get SOAP Fault using 
getAnyObject and found some problem. Mark expects this as some issue and 
suggested to report this issue . DynamicGetAnyObjectSOAPFaultTest is there 
in cvs to address this issue..


Regards
James
--------------------------------------------------
James Jose
Messaging Clients Team, WMQDDC
IBM Software Labs, India
Direct: 91-80- 25094331  Ext :2331
E-mail: jamejose@in.ibm.com





Mark Whitlock <ma...@uk.ibm.com> 
15/03/2005 19:01
Please respond to
"Apache AXIS C Developers List"


To
axis-c-dev@ws.apache.org
cc

Subject
Fw: Regarding addAnyObject and getAnyObject










Hi James,
  I'm pleased you're getting something out that looks nearly correct. Yes
it shouldn't have the </soapenv:Body>. Also the detail end tag is missing.
This overlaps with the Call::getFaultAsXMLString method that I added in
recently. I should probably remove Call::getFaultAsXMLString and make the
generated Stub call Call::getAnyObject instead (once we are happy that
Call::getAnyObject is working in this situation).

Please could you add in a testcase into CVS for this problem, raise a JIRA
and assign it to me. That would make it easier for me to debug your
testcase and fix it under your JIRA.
Thanks,
Mark
Mark Whitlock
IBM

----- Forwarded by Mark Whitlock/UK/IBM on 15/03/2005 13:22 -----
 
             James Jose 
             <jamejose@in.ibm. 
             com>                                                       To 

                                       "Apache AXIS C Developers List" 
             15/03/2005 13:09          <ax...@ws.apache.org> 
                                                                        cc 

 
             Please respond to                                     Subject 

              "Apache AXIS C           Re: Fw: Regarding addAnyObject and 
             Developers List"          getAnyObject 
 
 
 
 
 
 





Mark,

   I tried the way you said and getting the SOAP Fault.

try {
     Call::invoke
     Call::checkMessage      // steps over the message name
} catch (AxisException e) {
    //Call::checkFault  // steps over the fault code, actor, etc
     Call::getAnyObject


<soapenv:Fault><faultcode
xmlns="">Server.generalException</faultcode><faultstring
xmlns="">java.lang.ArithmeticException: / by zero</faultstring><detail
xmlns=""></soapenv:Fault>
</soapenv:Body>

This is the fault message that I got for division by zero. But here
getting the end tag for SOAP Body but no start tag..


Thanks & Regards
James
--------------------------------------------------
James Jose
Messaging Clients Team, WMQDDC
IBM Software Labs, India
Direct: 91-80- 25094331  Ext :2331
E-mail: jamejose@in.ibm.com



 
 Mark Whitlock 
 <ma...@uk.ibm.com> 
                                                                        To 

                                              axis-c-dev@ws.apache.org 
 14/03/2005 21:06                                                       cc 

 
                                                                   Subject 

          Please respond to                   Fw: Regarding addAnyObject 
   "Apache AXIS C Developers List"            and getAnyObject 
 
 
 
 
 
 
 









Hi James,
My guess is you need to issue the methods in the same order as the
generated stubs (in pseudocode)....

try {
     Call::invoke
     Call::checkMessage      // steps over the message name
} catch (AxisException e) {
     Call::checkFault  // steps over the fault code, actor, etc
     Call::getAnyObject

If this still fails, please post your testcase and the relevant part of
your trace file,
Thanks,
Mark
Mark Whitlock,
IBM

----- Forwarded by Mark Whitlock/UK/IBM on 14/03/2005 15:27 -----

            James Jose
            <jamejose@in.ibm.
            com>                                                       To
                                      "Apache AXIS C Developers List"
            14/03/2005 09:40          <ax...@ws.apache.org>
                                                                       cc

            Please respond to                                     Subject
             "Apache AXIS C           Re: Fw: Regarding addAnyObject and
            Developers List"          getAnyObject











Hi Mark,

  > Have you tried getting a user soap fault using getAnyObject?

      When I tried to get a SOAP FAULT, it throwing AxisException and
getting following message-
"Cannot deserialize the requested element ".


Thanks & Regards
James
--------------------------------------------------
James Jose
Messaging Clients Team, WMQDDC
IBM Software Labs, India
Direct: 91-80- 25094331  Ext :2331
E-mail: jamejose@in.ibm.com




Mark Whitlock
<ma...@uk.ibm.com>
                                                                       To
                                             axis-c-dev@ws.apache.org
11/03/2005 19:56                                                       cc

                                                                  Subject
         Please respond to                   Fw: Regarding addAnyObject
  "Apache AXIS C Developers List"            and getAnyObject
















Hi James,
Answering your questions..

1) passing NULL to addAnyObject() is an application error. Even if the
parameter that is being passed in is nil, it still needs to be encoded in
an XML string. I think it is reasonable to sigsegv here. I thought we were
not intending to police all parameters on all calls.
1) getAnyObject called before Call::invoke is also an application error.
There are no output parameters since the web service hasn't been called
yet. Axis could return NULL, or we could leave it throwing a sigsegv.
2) getAnyObject called more than twice. All these get methods (that return
output data from the service) are calling the XML parser to parse forwards
through the SOAP message. So calling getAnyObject twice will not return 
the
same data. Here I think we should return NULL to say that there is no more
data to return, instead of throwing a sigsegv.
3) Call::checkMessage moves the XML parser forward, checking the name of
the response message. So getAnyObject expects that checkMessage has 
already
been called. So calling getAnyObject before checkMessage is probably also 
a
user error. But this is more subtle and not obvious. It would be better to
return NULL or throw an AxisException in this situation so returning a
better error message.

Have you tried getting a user soap fault using getAnyObject?

Please raise a JIRA to cover these issues,
Thanks,
Markl
Mark Whitlock
IBM

----- Forwarded by Mark Whitlock/UK/IBM on 11/03/2005 13:46 -----

           James Jose
           <jamejose@in.ibm.
           com>                                                       To
                                     axis-c-dev@ws.apache.org
           11/03/2005 10:21                                           cc

                                                                 Subject
           Please respond to         Regarding addAnyObject and
            "Apache AXIS C           getAnyObject
           Developers List"











Hai,

 I am working on getAnyObject() and addAnyObject() APIs in Call class and
getting some
exceptions in following cases.

addAnyObject(AnyType *param)
----------------------------

1.if NULL is passed as argument.

getAnyObject()
--------------

1. If getAnyObject() is called before m_pCall->invoke() method.
2. If getAnyObject() is called more than  twice.
3. For the following code getting AxisException...

  if (AXIS_SUCCESS == m_pCall->invoke())
      {

              any= (AnyType*)m_pCall->getAnyObject();

              if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "
http://localhost/axis/Calculator"))
              {

                      ------
              }

      }

Pls help me to sort out this issues..

Regards
James
--------------------------------------------------
James Jose
Messaging Clients Team, WMQDDC
IBM Software Labs, India
Direct: 91-80- 25094331  Ext :2331
E-mail: jamejose@in.ibm.com