For C++, a class definition is generated for each WSDL Operation onput/output/fault type defined in binding. This class is derived from the OSXSDComplexTyperun-time class. The class may contain a constructor for initialization of member variables and a destructor to free dynamic memory held by the class. Method declarations will also be generated instead of C function prototypes for encoding, decoding, printing, and generation of test data.
A sample section from sample CalcWSDL C++ header file is as follows:
/**************************************************************/ /* */ /* OSXMLSoapFault */ /* */ /**************************************************************/ class EXTERN OSXMLSoapFault : public OSXSDComplexType { public: struct { unsigned faultactorPresent : 1; } m; OSXMLStringClass faultcode; OSXMLStringClass faultstring; OSXMLStringClass faultactor; OSXMLSoapFault (); OSXMLSoapFault (const OSXMLSoapFault&); virtual ~OSXMLSoapFault () {} virtual int encodeXML (OSRTMessageBufferIF& msgbuf, const OSUTF8CHAR* elemName, OSXMLNamespace* pNS); virtual int decodeXML (OSCTXT* pctxt); ... } ; /** * WSDL operation definitions */ /**************************************************************/ /* */ /* Add */ /* */ /**************************************************************/ class EXTERN Add_Fault : public OSXSDComplexType { public: struct { unsigned detailPresent : 1; } m; ::OSXMLSoapFault fault; OSXSDAnyTypeClass detail; Add_Fault (); Add_Fault (const Add_Fault&); virtual ~Add_Fault () {} virtual int encodeXML (OSRTMessageBufferIF& msgbuf, const OSUTF8CHAR* elemName, OSXMLNamespace* pNS); virtual int decodeXML (OSCTXT* pctxt); virtual void print (const char* name); ... } ; class EXTERN Add_Input : public OSXSDComplexType { public: ::Operands_ELEM Operands; Add_Input (); Add_Input (const Add_Input&); virtual ~Add_Input () {} virtual int encodeXML (OSRTMessageBufferIF& msgbuf, const OSUTF8CHAR* elemName, OSXMLNamespace* pNS); virtual int decodeXML (OSCTXT* pctxt); static int validateXML (OSCTXT* pctxt); virtual void print (const char* name); OSRTBaseType* clone () const { return new Add_Input (*this); } Add_Input& operator= (const Add_Input&); private: void defaultInit (); void doCommonCopy (const Add_Input& orig); void doCommonRelease (); } ; class EXTERN Add_Output : public OSXSDComplexType { public: OSREAL Result; Add_Output (); Add_Output (const Add_Output&); virtual ~Add_Output () {} virtual int encodeXML (OSRTMessageBufferIF& msgbuf, const OSUTF8CHAR* elemName, OSXMLNamespace* pNS); virtual int decodeXML (OSCTXT* pctxt); static int validateXML (OSCTXT* pctxt); virtual void print (const char* name); ... } ;