Main Page   Class Hierarchy   Compound List   File List   Compound 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 
00029 class SoapFault;
00030 class SoapMethod;
00031 class SoapBody;
00032 class SoapEnvelope;
00033 class SoapHeader;
00034 class IHeaderBlock;
00035 
00036 /*
00037  *  @class SoapDeSerializer
00038  *  @brief interface for the SoapDeSerializer class.
00039  *  @author Susantha Kumara (susantha@opensource.lk, skumara@virtusa.com)
00040  */
00041 class SoapDeSerializer : public IHandlerSoapDeSerializer
00042 {
00043 private:
00044     SoapEnvelope* m_pEnv;
00045     SoapHeader* m_pHeader;
00046     XMLParser* m_pParser;
00047     /* Current Serialization Style */
00048     AXIS_BINDING_STYLE m_nStyle;
00049     /* Last procesed node needed when the attributes are processed */
00050     const AnyElement* m_pCurrNode;
00051     const AnyElement* m_pNode;
00052     SOAP_VERSION m_nSoapVersion;
00053     AxisChar* m_pEndptr; 
00054     /* used as a parameter to strtoXX conversion functionss */
00055     int m_nStatus;
00056     /* Provider type of current service that uses this DeSerializer object */
00057     PROVIDERTYPE m_ProviderType;
00058     char* m_pcFaultDetail;
00059     SOAPTransport* m_pInputStream;
00060 
00061 private:
00062     int AXISCALL getArraySize(const AnyElement* pElement);
00063     int getBody();
00064 public:
00065     int init();
00066     int getVersion();
00067     SoapEnvelope* getEnvelope();
00068     int getHeader();
00069     int flushInputStream();
00070     PROVIDERTYPE getCurrentProviderType() { return m_ProviderType;};
00071     void setCurrentProviderType(PROVIDERTYPE nType) { m_ProviderType = nType;};
00072     /*
00073      * Methods to manipulate entire body when the body is compressed or 
00074      * encrypted 
00075      * These functions are provided for handlers to manipulate entire soap body.
00076      */
00077     xsd__hexBinary AXISCALL getBodyAsHexBinary();
00078     xsd__base64Binary AXISCALL getBodyAsBase64Binary();
00079     int AXISCALL setNewSoapBody(AxisChar* pNewSoapBody);
00080     bool isAnyMustUnderstandHeadersLeft();
00081     int getFault();
00082     int AXISCALL checkMessageBody(const AxisChar* pName, 
00083         const AxisChar* pNamespace);
00084     int AXISCALL checkForFault(const AxisChar* pName, 
00085         const AxisChar* pNamespace);
00086     /* to get any header blocks left in the Deserializer */
00087     HeaderBlock* getHeaderBlock();
00088     /* to add a header block to the Deserializer. Probably a handler */
00089     int AXISCALL addHeaderBlock(IHeaderBlock* pBlk);
00090     /* to get a named header blcok from the Deserializer */
00091     IHeaderBlock* getHeaderBlock(const AxisChar* pName, 
00092         const AxisChar* pNamespace);
00093     int setInputStream(SOAPTransport* pInputStream);
00094     SoapDeSerializer();
00095     virtual ~SoapDeSerializer();
00096     /* Method used by wrappers to get a deserialized Array of complex types */
00097     Axis_Array AXISCALL getCmplxArray(void* pDZFunct, void* pCreFunct, 
00098         void* pDelFunct, void* pSizeFunct, const AxisChar* pName, 
00099         const AxisChar* pNamespace);
00100     /* Method used by wrappers to get a deserialized Array of basic types */
00101     Axis_Array AXISCALL getBasicArray(XSDTYPE nType, const AxisChar* pName, 
00102         const AxisChar* pNamespace);
00103     /* Method used by wrappers to get a deserialized single 
00104      * object of complex type 
00105      */
00106     void* AXISCALL getCmplxObject(void* pDZFunct, void* pCreFunct, 
00107         void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace);
00108     
00109     /* Methods used by wrappers to get a deserialized value of basic types */
00110     int AXISCALL getElementAsInt(const AxisChar* pName, 
00111         const AxisChar* pNamespace);
00112     int AXISCALL getFaultDetail(char** ppcDetail);
00113     xsd__boolean AXISCALL getElementAsBoolean(const AxisChar* pName, 
00114         const AxisChar* pNamespace);
00115     unsigned int AXISCALL getElementAsUnsignedInt(const AxisChar* pName, 
00116         const AxisChar* pNamespace);
00117     short AXISCALL getElementAsShort(const AxisChar* pName, 
00118         const AxisChar* pNamespace);
00119     unsigned short AXISCALL getElementAsUnsignedShort(const AxisChar* pName, 
00120         const AxisChar* pNamespace);
00121     char AXISCALL getElementAsByte(const AxisChar* pName, 
00122         const AxisChar* pNamespace);
00123     unsigned char AXISCALL getElementAsUnsignedByte(const AxisChar* pName, 
00124         const AxisChar* pNamespace);
00125     long AXISCALL getElementAsLong(const AxisChar* pName, 
00126         const AxisChar* pNamespace);
00127     long AXISCALL getElementAsInteger(const AxisChar* pName, 
00128         const AxisChar* pNamespace);
00129     unsigned long AXISCALL getElementAsUnsignedLong(const AxisChar* pName, 
00130         const AxisChar* pNamespace);
00131     float AXISCALL getElementAsFloat(const AxisChar* pName, 
00132         const AxisChar* pNamespace);
00133     double AXISCALL getElementAsDouble(const AxisChar* pName, 
00134         const AxisChar* pNamespace);
00135     double AXISCALL getElementAsDecimal(const AxisChar* pName, 
00136         const AxisChar* pNamespace);
00137     AxisChar* AXISCALL getElementAsString(const AxisChar* pName, 
00138         const AxisChar* pNamespace);
00139     AxisChar* AXISCALL getElementAsAnyURI(const AxisChar* pName, 
00140         const AxisChar* pNamespace);
00141     AxisChar* AXISCALL getElementAsQName(const AxisChar* pName, 
00142         const AxisChar* pNamespace);
00143     xsd__hexBinary AXISCALL getElementAsHexBinary(const AxisChar* pName, 
00144         const AxisChar* pNamespace);
00145     xsd__base64Binary AXISCALL getElementAsBase64Binary(const AxisChar* pName, 
00146         const AxisChar* pNamespace);
00147     struct tm AXISCALL getElementAsDateTime(const AxisChar* pName, 
00148         const AxisChar* pNamespace);
00149     struct tm AXISCALL getElementAsDate(const AxisChar* pName, 
00150         const AxisChar* pNamespace);
00151     struct tm AXISCALL getElementAsTime(const AxisChar* pName, 
00152         const AxisChar* pNamespace);
00153     long AXISCALL getElementAsDuration(const AxisChar* pName, 
00154         const AxisChar* pNamespace);
00155 
00156     int AXISCALL getAttributeAsInt(const AxisChar* pName, 
00157         const AxisChar* pNamespace);
00158     xsd__boolean AXISCALL getAttributeAsBoolean(const AxisChar* pName, 
00159         const AxisChar* pNamespace);
00160     unsigned int AXISCALL getAttributeAsUnsignedInt(const AxisChar* pName, 
00161         const AxisChar* pNamespace);
00162     short AXISCALL getAttributeAsShort(const AxisChar* pName, 
00163         const AxisChar* pNamespace);
00164     unsigned short AXISCALL getAttributeAsUnsignedShort(const AxisChar* pName, 
00165         const AxisChar* pNamespace);
00166     char AXISCALL getAttributeAsByte(const AxisChar* pName, 
00167         const AxisChar* pNamespace);
00168     unsigned char AXISCALL getAttributeAsUnsignedByte(const AxisChar* pName, 
00169         const AxisChar* pNamespace);
00170     long AXISCALL getAttributeAsLong(const AxisChar* pName, 
00171         const AxisChar* pNamespace);
00172     long AXISCALL getAttributeAsInteger(const AxisChar* pName, 
00173         const AxisChar* pNamespace);
00174     unsigned long AXISCALL getAttributeAsUnsignedLong(const AxisChar* pName, 
00175         const AxisChar* pNamespace);
00176     float AXISCALL getAttributeAsFloat(const AxisChar* pName, 
00177         const AxisChar* pNamespace);
00178     double AXISCALL getAttributeAsDouble(const AxisChar* pName, 
00179         const AxisChar* pNamespace);
00180     double AXISCALL getAttributeAsDecimal(const AxisChar* pName, 
00181         const AxisChar* pNamespace);
00182     AxisChar* AXISCALL getAttributeAsString(const AxisChar* pName, 
00183         const AxisChar* pNamespace);
00184     AxisChar* AXISCALL getAttributeAsAnyURI(const AxisChar* pName, 
00185         const AxisChar* pNamespace);
00186     AxisChar* AXISCALL getAttributeAsQName(const AxisChar* pName, 
00187         const AxisChar* pNamespace);
00188     xsd__hexBinary AXISCALL getAttributeAsHexBinary(const AxisChar* pName, 
00189         const AxisChar* pNamespace);
00190     xsd__base64Binary AXISCALL getAttributeAsBase64Binary
00191         (const AxisChar* pName, const AxisChar* pNamespace);
00192     struct tm AXISCALL getAttributeAsDateTime(const AxisChar* pName, 
00193         const AxisChar* pNamespace);
00194     struct tm AXISCALL getAttributeAsDate(const AxisChar* pName, 
00195         const AxisChar* pNamespace);
00196     struct tm AXISCALL getAttributeAsTime(const AxisChar* pName, 
00197         const AxisChar* pNamespace);
00198     long AXISCALL getAttributeAsDuration(const AxisChar* pName, 
00199         const AxisChar* pNamespace);
00200     
00201 /*    void* CreateArray(XSDTYPE nType, int nSize); */
00202 /*    void DeleteArray(Axis_Array* pArray , XSDTYPE nType); */
00203     void setStyle(AXIS_BINDING_STYLE nStyle){ m_nStyle = nStyle;};
00204     AXIS_BINDING_STYLE getStyle(){return m_nStyle;};    
00205     XSDTYPE getXSDType(const AnyElement* pElement);
00206     int AXISCALL getStatus(){return m_nStatus;};
00207         AnyType* AXISCALL getAnyObject();
00208     AxisString serializeTag(const AnyElement* node);
00209 
00210 private:
00211     int getElementForAttributes(const AxisChar* pName, 
00212         const AxisChar* pNamespace);
00213     xsd__base64Binary decodeFromBase64Binary(const AxisChar* pValue);
00214     xsd__hexBinary decodeFromHexBinary(const AxisChar* pValue);
00215 };
00216 
00217 #endif 
00218 

Generated on Tue Jun 15 19:13:23 2004 for axiscpp by doxygen1.2.18