axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From G Sabarinath <r1sab...@in.ibm.com>
Subject Axis C++ WebService Messages calls with Complex Types and Arrays throws Exception: m_iExceptionCode=72 m_sMessage=0x00a50580 "Cannot deserialize the requested element"
Date Thu, 16 Nov 2006 14:38:26 GMT
Hi,
I am able to develop , run, and use WebServices in Axis C++ having simple
Types (int, string etc)  as message arguments .
Howerver when I use complex Types with Arrays  as message arguments it  I
am getting the following Exception.
<m_iExceptionCode=72 m_sMessage=0x00a50580 "Cannot deserialize the
requested element ">

Details of the  WSDL and code are given below:

CompleType schema in my WSDL:( start)
------------------------------------------------------------
<xsd:schema targetNamespace= "http://localhost:9999/axis/BinOptNewService"
xmlns="http://www.w3.org/2001/XMLSchema">
      <element name="BinElement" type="tns:BinInfoType"> </element>
      <complexType name="BinInfoType">
            <sequence>
            <element name="BinName" type="string" > </element>
            <element name="BinID" type="string" > </element>
            <element name="Param" type ="tns:ParamType" minOccurs="0"
maxOccurs="unbounded"> </element>
            </sequence>
      </complexType>
      <complexType name ="ParamType">
            <sequence>
                  <element name="ParamName"
                        type="string" minOccurs="1" maxOccurs="1">
                  </element>
                  <element name="ParamValue"
                        type="double" minOccurs="1" maxOccurs="1">
                  </element>
            </sequence>
      </complexType>
    </xsd:schema>
CompleType schema in my WSDL: (end.)

WASDL Extracts associated with message "addBinTemplate":
-----------------------------------------------------------------------------------------
----------
-----------
<wsdl:message name="addBinTemplateRequest">
    <wsdl:part name= "binTmpl" type="tns:BinInfoType"/>
   <wsdl:part name= "solutionName" type="xsd:string"/>
------
--------
--------
 <wsdl:binding name="BinOptNewServiceSoapBinding" type="
intf:BinOptNewService">
    <wsdlsoap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="addBinTemplate">
      <wsdlsoap:operation soapAction="BinOptNewService#addBinTemplate"/>
      <wsdl:input name="addBinTemplateRequest">
        <wsdlsoap:body
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        namespace="http://localhost:9999/axis/BinOptNewService"
        use="encoded"/>
      </wsdl:input>
      <wsdl:output name="addBinTemplateResponse">
        <wsdlsoap:body encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"
        namespace="http://localhost:9999/axis/BinOptNewService"
        use="encoded"/>
      </wsdl:output>
    </wsdl:operation>
  ------------
----------------
WSDL2Ws generated classes:
----------------------------------------------

class BinInfoType
{
public:
      xsd__string BinName;
      xsd__string BinID;
      ParamType_Array * Param;

      xsd__string getBinName();
      void setBinName(xsd__string InValue);

      xsd__string getBinID();
      void setBinID(xsd__string InValue);

      ParamType_Array * getParam();
      void setParam(ParamType_Array * pInValue);

      BinInfoType();
      void reset();
      virtual ~BinInfoType();
};

class ParamType
{
public:
      xsd__string ParamName;
      xsd__double ParamValue;

      xsd__string getParamName();
      void setParamName(xsd__string InValue);

      xsd__double getParamValue();
      void setParamValue(xsd__double InValue);

      ParamType();
      void reset();
      virtual ~ParamType();
};

class STORAGE_CLASS_INFO ParamType_Array : public Axis_Array
{
      public:
            ParamType_Array();
            ParamType_Array(const ParamType_Array & original);
            virtual ~ParamType_Array();
            void set( class ParamType** array, const int size);
            class ParamType** get(int & size) const;
            void clone(const ParamType_Array & original);
            virtual Axis_Array * clone() const;
            void clear();
};


Client code:
-----------------

      BinOptNewService bop;
      BinInfoType *bot = new BinInfoType();
      ParamType **pm = new ParamType*[2];
      ParamType_Array *pmA =  new ParamType_Array();

      pm[0] = new ParamType();
      pm[1] = new ParamType();
      pm[0]->setParamName("P1");
      pm[0]->setParamValue(100.0);
      pm[1]->setParamName("P2");
      pm[1]->setParamValue(200.0);

      pmA->set(pm, 2);
      bot->setParam(pmA);
      bot->setBinID("111");
      bot->setBinName("MyBin");
      int Result1 = bop.addBinTemplate("Bin", bot);   // This call thows
m_iExceptionCode=72 m_sMessage=0x00a50580 "Cannot deserialize the requested
element "

Other messages in the Same WebService having simple type arguments work
fine!!

Thnaks & Regards
G Sabarinath
   IBM Global Services India Ltd.
   Bangalore.
   Contact  : 91-98450-74838 (Cell)


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Mime
View raw message