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

Stub.h

Go to the documentation of this file.
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 
00026 /*
00027  * Revision 1.1  2004/05/31 samisa
00028  * Added setProxy
00029  */
00030 
00031 /*
00032  * Revision 1.2  2004/05/31 roshan
00033  * Added calling conventions
00034  */
00035 
00036 /*
00037  * Revision 1.3  2004/06/01 roshan
00038  * Added setSOAPMethodAttribute
00039  */
00040 
00041 /*
00042  * Revision 1.4  2004/06/08 samisa
00043  * Added setTransportTimeout
00044  */
00045 
00046 /*
00047  * Revision 1.5  2004/06/10 samisa
00048  * Added doxygen comments to help autobuild API docs
00049  */
00050 
00051 /*
00052  * Revision 1.6  2004/06/13 roshan
00053  * Added doxygen comments to help autobuild API docs
00054  */
00055 
00056 /*
00057  * Revision 1.13  2004/06/13 susantha
00058  * Added support for writing C web services and handlers
00059  */
00060 
00061 #if !defined(_STUB_H____OF_AXIS_INCLUDED_)
00062 #define _STUB_H____OF_AXIS_INCLUDED_
00063 
00064 #include <axis/client/Call.h>
00065 #include <axis/server/Attribute.h>
00066 
00067 #ifdef __cplusplus
00068 
00069 #include <vector>
00070 
00071 AXIS_CPP_NAMESPACE_START
00072 
00073 using namespace std;
00074 
00075 AXIS_CPP_NAMESPACE_END
00076 
00077 #endif
00078 
00089 typedef struct {
00090     void (AXISCALL* setEndpoint)(void* pObj, const char* pchEndpoint);
00091     void (AXISCALL* setTransportProperty)(void* pObj, 
00092         const char *pcKey, const char *pcValue);
00093     char* (AXISCALL* getFirstTrasportPropertyKey)(void* pObj);
00094     char* (AXISCALL* getNextTrasportPropertyKey)(void* pObj);
00095     char* (AXISCALL* getCurrentTrasportPropertyKey)(void* pObj);
00096     char* (AXISCALL* getCurrentTrasportPropertyValue)(void* pObj);
00097     void (AXISCALL* deleteCurrentTrasportProperty)(void* pObj);
00098     void (AXISCALL* deleteTrasportProperty)(void* pObj, char* pcKey, 
00099         unsigned int uiOccurance);
00100     void (AXISCALL* setHandlerProperty)(void* pObj, AxisChar* name, 
00101                 void* value, int len);
00102     HeaderBlock_C (AXISCALL* createSOAPHeaderBlock)(void* pObj, 
00103         AxisChar * pachLocalName, AxisChar * pachUri);
00104     HeaderBlock_C (AXISCALL* getFirstSOAPHeaderBlock)(void* pObj);
00105     HeaderBlock_C (AXISCALL* getNextSOAPHeaderBlock)(void* pObj);
00106     HeaderBlock_C (AXISCALL* getCurrentSOAPHeaderBlock)(void* pObj);
00107     void (AXISCALL* deleteCurrentSOAPHeaderBlock)(void* pObj);
00108     void (AXISCALL* deleteSOAPHeaderBlock)(void* pObj,
00109         HeaderBlock_C hdrBlk);
00110     void (AXISCALL* setProxy)(void* pObj, const char* pcProxyHost,
00111         unsigned int uiProxyPort);
00112     void (AXISCALL* setSOAPMethodAttribute)(void* pObj,
00113         const AxisChar *pLocalname, const AxisChar *pPrefix,
00114         const AxisChar* pUri, const AxisChar *pValue);
00115     Attribute_C (AXISCALL* getFirstSOAPMethodAttribute)(void* pObj);
00116     Attribute_C (AXISCALL* getNextSOAPMethodAttribute)(void* pObj);
00117     Attribute_C (AXISCALL* getCurrentSOAPMethodAttribute)(void* pObj);
00118     void (AXISCALL* deleteCurrentSOAPMethodAttribute)(void* pObj);
00119     void (AXISCALL* deleteSOAPMethodAttribute)(void* pObj,
00120         Attribute_C Attr);
00121     void (AXISCALL* setTransportTimeout)(void* pObj, const long lSeconds);
00122        int (AXISCALL* getStatus)(void* pObj);
00123     const AxisChar* (AXISCALL* getNamespacePrefix)(void* pObj,
00124         const AxisChar* pNamespace);
00125 } StubFunctions;
00126 
00127 #ifdef __cplusplus
00128 
00145 AXIS_CPP_NAMESPACE_START
00146 
00147 class STORAGE_CLASS_INFO Stub
00148 {
00149   public:
00159     Stub(const char *pcEndPointURI, AXIS_PROTOCOL_TYPE eProtocol);
00160 
00168     virtual ~Stub();
00169 
00177     void AXISCALL setEndPoint(const char *pcEndPointURI);
00178 
00201     void AXISCALL setTransportProperty(const char *pcKey, const char *pcValue);
00202 
00212     char* getFirstTrasportPropertyKey();
00213 
00226     char* getNextTrasportPropertyKey();
00227 
00244     char* getCurrentTrasportPropertyKey();
00245     
00264     char* getCurrentTrasportPropertyValue();
00265 
00270     void deleteCurrentTrasportProperty();
00271 
00290     void deleteTrasportProperty(char* pcKey, unsigned int uiOccurance = 1);
00291 
00299     void setHandlerProperty(AxisChar* name, void* value, int len);
00300 
00361     IHeaderBlock * AXISCALL createSOAPHeaderBlock(AxisChar * pachLocalName,
00362                      AxisChar * pachUri);
00363 
00373     IHeaderBlock* getFirstSOAPHeaderBlock();
00374 
00387     IHeaderBlock* getNextSOAPHeaderBlock();
00388 
00406     IHeaderBlock* getCurrentSOAPHeaderBlock();
00407     
00412     void deleteCurrentSOAPHeaderBlock();
00413 
00433     void deleteSOAPHeaderBlock(IHeaderBlock* pHeaderBlock);
00434 
00441     void setProxy(const char* pcProxyHost, unsigned int uiProxyPort);
00442 
00450     void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const AxisChar *pValue);
00451 
00460     void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const AxisChar* pUri, const AxisChar *pValue);
00461   
00471     Attribute* getFirstSOAPMethodAttribute();
00472 
00485     Attribute* getNextSOAPMethodAttribute();
00486 
00504     Attribute* getCurrentSOAPMethodAttribute();
00505     
00510     void deleteCurrentSOAPMethodAttribute();
00511 
00531     void deleteSOAPMethodAttribute(Attribute* pAttribute);
00532 
00541     void setTransportTimeout(const long lSeconds);
00545        int getStatus();
00549     const AxisChar* AXISCALL getNamespacePrefix(const AxisChar* pNamespace);
00550 
00551   public:
00552     static StubFunctions ms_VFtable;
00553     static bool bInitialized;
00554     /* add static functions for all interface functions here */
00555     static void AXISCALL s_setEndpoint(void* pObj, const char* pchEndpoint)
00556     {((Stub*)pObj)->setEndPoint(pchEndpoint);};
00557     static void AXISCALL s_setTransportProperty(void* pObj, 
00558         const char *pcKey, const char *pcValue)
00559     {((Stub*)pObj)->setTransportProperty(pcKey, pcValue);};
00560     static char* AXISCALL s_getFirstTrasportPropertyKey(void* pObj)
00561     {return ((Stub*)pObj)->getFirstTrasportPropertyKey();};
00562     static char* AXISCALL s_getNextTrasportPropertyKey(void* pObj)
00563     {return ((Stub*)pObj)->getNextTrasportPropertyKey();};
00564     static char* AXISCALL s_getCurrentTrasportPropertyKey(void* pObj)
00565     {return ((Stub*)pObj)->getCurrentTrasportPropertyKey();};
00566     static char* AXISCALL s_getCurrentTrasportPropertyValue(void* pObj)
00567     {return ((Stub*)pObj)->getCurrentTrasportPropertyValue();};
00568     static void AXISCALL s_deleteCurrentTrasportProperty(void* pObj)
00569     {((Stub*)pObj)->deleteCurrentTrasportProperty();};
00570     static void AXISCALL s_deleteTrasportProperty(void* pObj, char* pcKey, 
00571         unsigned int uiOccurance)
00572     {((Stub*)pObj)->deleteTrasportProperty(pcKey, uiOccurance);};
00573     static void AXISCALL s_setHandlerProperty(void* pObj, AxisChar* name, 
00574                 void* value, int len)
00575     {((Stub*)pObj)->setHandlerProperty(name, value, len);};
00576     static HeaderBlock_C AXISCALL s_createSOAPHeaderBlock(void* pObj, 
00577         AxisChar * pachLocalName, AxisChar * pachUri);
00578     static HeaderBlock_C AXISCALL s_getFirstSOAPHeaderBlock(void* pObj);
00579     static HeaderBlock_C AXISCALL s_getNextSOAPHeaderBlock(void* pObj);
00580     static HeaderBlock_C AXISCALL s_getCurrentSOAPHeaderBlock(void* pObj);
00581     static void AXISCALL s_deleteCurrentSOAPHeaderBlock(void* pObj)
00582     {((Stub*)pObj)->deleteCurrentSOAPHeaderBlock();};
00583     static void AXISCALL s_deleteSOAPHeaderBlock(void* pObj,
00584         HeaderBlock_C hdrBlk)
00585     {((Stub*)pObj)->deleteSOAPHeaderBlock((IHeaderBlock*)hdrBlk._object);};
00586     static void AXISCALL s_setProxy(void* pObj, const char* pcProxyHost,
00587         unsigned int uiProxyPort)
00588     {((Stub*)pObj)->setProxy(pcProxyHost, uiProxyPort);};
00589     static void AXISCALL s_setSOAPMethodAttribute(void* pObj,
00590         const AxisChar *pLocalname, const AxisChar *pPrefix,
00591         const AxisChar* pUri, const AxisChar *pValue)
00592     {((Stub*)pObj)->setSOAPMethodAttribute(pLocalname, pPrefix, pUri,
00593                                             pValue);};
00594     static Attribute_C AXISCALL s_getFirstSOAPMethodAttribute(void* pObj);
00595     static Attribute_C AXISCALL s_getNextSOAPMethodAttribute(void* pObj);
00596     static Attribute_C AXISCALL s_getCurrentSOAPMethodAttribute(void* pObj);
00597     static void AXISCALL s_deleteCurrentSOAPMethodAttribute(void* pObj)
00598     {((Stub*)pObj)->deleteCurrentSOAPMethodAttribute();};
00599     static void AXISCALL s_deleteSOAPMethodAttribute(void* pObj,
00600         Attribute_C Attr)
00601     {((Stub*)pObj)->deleteSOAPMethodAttribute((Attribute*)Attr._object);};
00602     static void AXISCALL s_setTransportTimeout(void* pObj,
00603         const long lSeconds)
00604     {((Stub*)pObj)->setTransportTimeout(lSeconds);};
00605        static int AXISCALL s_getStatus(void* pObj)
00606     {return ((Stub*)pObj)->getStatus();};
00607     static const AxisChar* AXISCALL s_getNamespacePrefix(void* pObj,
00608         const AxisChar* pNamespace)
00609     {return ((Stub*)pObj)->getNamespacePrefix(pNamespace);};
00610     static void s_Initialize();
00611 
00612   protected:
00619     void applyUserPreferences();
00620     
00625     void setTransportProperties();
00626   
00631     void setSOAPHeaders();
00632     
00637     void setSOAPMethodAttributes();
00638 
00643     void setTransportTimeout();
00644 
00649     Call *m_pCall;
00650 
00654     vector < char *>m_vKeys;
00655 
00659     vector <char*>::iterator m_viCurrentKey;
00660 
00664     vector < char *>m_vValues;
00665   
00669     vector <char*>::iterator m_viCurrentValue;
00670 
00674     vector < IHeaderBlock * >m_vSOAPHeaderBlocks;
00675 
00679     vector <IHeaderBlock *>::iterator m_viCurrentSOAPHeaderBlock;
00680 
00684     vector <Attribute*> m_vSOAPMethodAttributes;
00685 
00689     vector <Attribute*>::iterator m_viCurrentSOAPMethodAttribute;
00690 
00694     long m_lTimeoutSeconds;
00695 
00696 };
00697 
00698 AXIS_CPP_NAMESPACE_END
00699 
00700 #endif
00701 
00702 typedef struct { 
00703     void* _object; /* this will be C++ Call Object */
00704     CallFunctions* _functions; /* this is the static function table */
00705     void* _stub_object; /* the stub object */
00706     StubFunctions* _stub_functions; /* this is the static function table */
00707 } Call_C;
00708 
00709 #ifndef __cplusplus
00710 typedef Call_C Call; 
00711 #endif
00712 
00713 #endif /* !defined(_STUB_H____OF_AXIS_INCLUDED_) */

Generated on Fri Oct 22 18:49:04 2004 for AxisC++ by doxygen1.2.18