Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

SoapDeSerializer.h

00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  */
00016 
00017 #if !defined(_SOAPDESERIALIZER_H____OF_AXIS_INCLUDED_)
00018 #define _SOAPDESERIALIZER_H____OF_AXIS_INCLUDED_
00019 
00020 #include "IHandlerSoapDeSerializer.h"
00021 #include "SoapEnvVersions.h"
00022 #include "HeaderBlock.h"
00023 #include "WSDDDefines.h"
00024 #include "XMLParser.h"
00025 #include "AnyElement.h"
00026 #include <axis/SOAPTransport.h>
00027 #include <axis/AxisSoapException.h>
00028 #include <axis/AxisGenException.h>
00029 
00030 class SoapFault;
00031 class SoapMethod;
00032 class SoapBody;
00033 class SoapEnvelope;
00034 class SoapHeader;
00035 class IHeaderBlock;
00036 
00037 /*
00038  *  @class SoapDeSerializer
00039  *  @brief interface for the SoapDeSerializer class.
00040  *  @author Susantha Kumara (susantha@opensource.lk, skumara@virtusa.com)
00041  */
00042 class SoapDeSerializer : public IHandlerSoapDeSerializer
00043 {
00044 private:
00045     SoapEnvelope* m_pEnv;
00046     SoapHeader* m_pHeader;
00047     XMLParser* m_pParser;
00048     /* Current Serialization Style */
00049     AXIS_BINDING_STYLE m_nStyle;
00050     /* Last procesed node needed when the attributes are processed */
00051     const AnyElement* m_pCurrNode;
00052     const AnyElement* m_pNode;
00053     SOAP_VERSION m_nSoapVersion;
00054     AxisChar* m_pEndptr; 
00055     /* used as a parameter to strtoXX conversion functionss */
00056     int m_nStatus;
00057     /* Provider type of current service that uses this DeSerializer object */
00058     PROVIDERTYPE m_ProviderType;
00059     char* m_pcFaultDetail;
00060     SOAPTransport* m_pInputStream;
00061 
00062 private:
00063     int AXISCALL getArraySize(const AnyElement* pElement);
00064     int getBody();
00065 public:
00066     int init();
00067     int getVersion();
00068     SoapEnvelope* getEnvelope();
00069     int getHeader();
00070     int flushInputStream();
00071     PROVIDERTYPE getCurrentProviderType() { return m_ProviderType;};
00072     void setCurrentProviderType(PROVIDERTYPE nType) { m_ProviderType = nType;};
00073     /*
00074      * Methods to manipulate entire body when the body is compressed or 
00075      * encrypted 
00076      * These functions are provided for handlers to manipulate entire soap body.
00077      */
00078     xsd__hexBinary AXISCALL getBodyAsHexBinary();
00079     xsd__base64Binary AXISCALL getBodyAsBase64Binary();
00080     int AXISCALL setNewSoapBody(AxisChar* pNewSoapBody);
00081     bool isAnyMustUnderstandHeadersLeft();
00082     int getFault();
00083     int AXISCALL checkMessageBody(const AxisChar* pName, 
00084         const AxisChar* pNamespace);
00085     int AXISCALL checkForFault(const AxisChar* pName, 
00086         const AxisChar* pNamespace);
00087     /* to get any header blocks left in the Deserializer */
00088     HeaderBlock* getHeaderBlock();
00089     /* to add a header block to the Deserializer. Probably a handler */
00090     int AXISCALL addHeaderBlock(IHeaderBlock* pBlk);
00091     /* to get a named header blcok from the Deserializer */
00092     IHeaderBlock* getHeaderBlock(const AxisChar* pName, 
00093         const AxisChar* pNamespace);
00094     int setInputStream(SOAPTransport* pInputStream);
00095     SoapDeSerializer();
00096     virtual ~SoapDeSerializer();
00097     /* Method used by wrappers to get a deserialized Array of complex types */
00098     Axis_Array AXISCALL getCmplxArray(void* pDZFunct, void* pCreFunct, 
00099         void* pDelFunct, void* pSizeFunct, const AxisChar* pName, 
00100         const AxisChar* pNamespace);
00101     /* Method used by wrappers to get a deserialized Array of basic types */
00102     Axis_Array AXISCALL getBasicArray(XSDTYPE nType, const AxisChar* pName, 
00103         const AxisChar* pNamespace);
00104     /* Method used by wrappers to get a deserialized single 
00105      * object of complex type 
00106      */
00107     void* AXISCALL getCmplxObject(void* pDZFunct, void* pCreFunct, 
00108         void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace);
00109     
00110     /* Methods used by wrappers to get a deserialized value of basic types */
00111     int AXISCALL getElementAsInt(const AxisChar* pName, 
00112         const AxisChar* pNamespace);
00113     int AXISCALL getFaultDetail(char** ppcDetail);
00114     xsd__boolean AXISCALL getElementAsBoolean(const AxisChar* pName, 
00115         const AxisChar* pNamespace);
00116     unsigned int AXISCALL getElementAsUnsignedInt(const AxisChar* pName, 
00117         const AxisChar* pNamespace);
00118     short AXISCALL getElementAsShort(const AxisChar* pName, 
00119         const AxisChar* pNamespace);
00120     unsigned short AXISCALL getElementAsUnsignedShort(const AxisChar* pName, 
00121         const AxisChar* pNamespace);
00122     char AXISCALL getElementAsByte(const AxisChar* pName, 
00123         const AxisChar* pNamespace);
00124     unsigned char AXISCALL getElementAsUnsignedByte(const AxisChar* pName, 
00125         const AxisChar* pNamespace);
00126     long AXISCALL getElementAsLong(const AxisChar* pName, 
00127         const AxisChar* pNamespace);
00128     long AXISCALL getElementAsInteger(const AxisChar* pName, 
00129         const AxisChar* pNamespace);
00130     unsigned long AXISCALL getElementAsUnsignedLong(const AxisChar* pName, 
00131         const AxisChar* pNamespace);
00132     float AXISCALL getElementAsFloat(const AxisChar* pName, 
00133         const AxisChar* pNamespace);
00134     double AXISCALL getElementAsDouble(const AxisChar* pName, 
00135         const AxisChar* pNamespace);
00136     double AXISCALL getElementAsDecimal(const AxisChar* pName, 
00137         const AxisChar* pNamespace);
00138     AxisChar* AXISCALL getElementAsString(const AxisChar* pName, 
00139         const AxisChar* pNamespace);
00140     AxisChar* AXISCALL getElementAsAnyURI(const AxisChar* pName, 
00141         const AxisChar* pNamespace);
00142     AxisChar* AXISCALL getElementAsQName(const AxisChar* pName, 
00143         const AxisChar* pNamespace);
00144     xsd__hexBinary AXISCALL getElementAsHexBinary(const AxisChar* pName, 
00145         const AxisChar* pNamespace);
00146     xsd__base64Binary AXISCALL getElementAsBase64Binary(const AxisChar* pName, 
00147         const AxisChar* pNamespace);
00148     struct tm AXISCALL getElementAsDateTime(const AxisChar* pName, 
00149         const AxisChar* pNamespace);
00150     struct tm AXISCALL getElementAsDate(const AxisChar* pName, 
00151         const AxisChar* pNamespace);
00152     struct tm AXISCALL getElementAsTime(const AxisChar* pName, 
00153         const AxisChar* pNamespace);
00154     long AXISCALL getElementAsDuration(const AxisChar* pName, 
00155         const AxisChar* pNamespace);
00156 
00157     int AXISCALL getAttributeAsInt(const AxisChar* pName, 
00158         const AxisChar* pNamespace);
00159     xsd__boolean AXISCALL getAttributeAsBoolean(const AxisChar* pName, 
00160         const AxisChar* pNamespace);
00161     unsigned int AXISCALL getAttributeAsUnsignedInt(const AxisChar* pName, 
00162         const AxisChar* pNamespace);
00163     short AXISCALL getAttributeAsShort(const AxisChar* pName, 
00164         const AxisChar* pNamespace);
00165     unsigned short AXISCALL getAttributeAsUnsignedShort(const AxisChar* pName, 
00166         const AxisChar* pNamespace);
00167     char AXISCALL getAttributeAsByte(const AxisChar* pName, 
00168         const AxisChar* pNamespace);
00169     unsigned char AXISCALL getAttributeAsUnsignedByte(const AxisChar* pName, 
00170         const AxisChar* pNamespace);
00171     long AXISCALL getAttributeAsLong(const AxisChar* pName, 
00172         const AxisChar* pNamespace);
00173     long AXISCALL getAttributeAsInteger(const AxisChar* pName, 
00174         const AxisChar* pNamespace);
00175     unsigned long AXISCALL getAttributeAsUnsignedLong(const AxisChar* pName, 
00176         const AxisChar* pNamespace);
00177     float AXISCALL getAttributeAsFloat(const AxisChar* pName, 
00178         const AxisChar* pNamespace);
00179     double AXISCALL getAttributeAsDouble(const AxisChar* pName, 
00180         const AxisChar* pNamespace);
00181     double AXISCALL getAttributeAsDecimal(const AxisChar* pName, 
00182         const AxisChar* pNamespace);
00183     AxisChar* AXISCALL getAttributeAsString(const AxisChar* pName, 
00184         const AxisChar* pNamespace);
00185     AxisChar* AXISCALL getAttributeAsAnyURI(const AxisChar* pName, 
00186         const AxisChar* pNamespace);
00187     AxisChar* AXISCALL getAttributeAsQName(const AxisChar* pName, 
00188         const AxisChar* pNamespace);
00189     xsd__hexBinary AXISCALL getAttributeAsHexBinary(const AxisChar* pName, 
00190         const AxisChar* pNamespace);
00191     xsd__base64Binary AXISCALL getAttributeAsBase64Binary
00192         (const AxisChar* pName, const AxisChar* pNamespace);
00193     struct tm AXISCALL getAttributeAsDateTime(const AxisChar* pName, 
00194         const AxisChar* pNamespace);
00195     struct tm AXISCALL getAttributeAsDate(const AxisChar* pName, 
00196         const AxisChar* pNamespace);
00197     struct tm AXISCALL getAttributeAsTime(const AxisChar* pName, 
00198         const AxisChar* pNamespace);
00199     long AXISCALL getAttributeAsDuration(const AxisChar* pName, 
00200         const AxisChar* pNamespace);
00201     
00202 /*    void* CreateArray(XSDTYPE nType, int nSize); */
00203 /*    void DeleteArray(Axis_Array* pArray , XSDTYPE nType); */
00204     void setStyle(AXIS_BINDING_STYLE nStyle){ m_nStyle = nStyle;};
00205     AXIS_BINDING_STYLE getStyle(){return m_nStyle;};    
00206     XSDTYPE getXSDType(const AnyElement* pElement);
00207     int AXISCALL getStatus(){return m_nStatus;};
00208         AnyType* AXISCALL getAnyObject();
00209     void serializeTag(AxisString& xmlStr, const AnyElement* node, AxisString& nsDecls);
00210 
00211 private:
00212     int getElementForAttributes(const AxisChar* pName, 
00213         const AxisChar* pNamespace);
00214     xsd__base64Binary decodeFromBase64Binary(const AxisChar* pValue);
00215     xsd__hexBinary decodeFromHexBinary(const AxisChar* pValue);
00216 };
00217 
00218 #endif 
00219 

Generated on Tue Jun 29 09:27:57 2004 for AxisC++ by doxygen1.2.18