sensoapenvelope.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : SenSoapEnvelope.h
00004 *  Part of     : Web Services Framework / Utils
00005 *  Interface   : 
00006 *  Description : CSenSoapEnvelope is an utility class offering capability to 
00007 *                                parse XML SOAP envelope and manipulation methods to alter its
00008 *                                contents.
00009 *  Version     :
00010 *
00011 *  Copyright © 2002-2005 Nokia. All rights reserved.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia. All rights are reserved. Copying, including 
00015 *  reproducing, storing, adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia.
00020 * ==============================================================================
00021 */
00022 
00023 #ifndef SEN_SOAP_ENVELOPE_H
00024 #define SEN_SOAP_ENVELOPE_H
00025 
00026 //  INCLUDES
00027 #include <SenBaseFragment.h>
00028 
00029 // CONSTANTS
00030 _LIT8(KSoapXmlns,               "http://schemas.xmlsoap.org/soap/envelope/");
00031 _LIT8(KEnvelopeName,    "Envelope");
00032 _LIT8(KEnvelopeQName,   "S:Envelope");
00033 _LIT8(KHeaderName,              "Header");
00034 _LIT8(KHeaderQName,             "S:Header");
00035 _LIT8(KBodyName,                "Body");
00036 _LIT8(KBodyQName,               "S:Body");
00037 _LIT8(KFault,                   "Fault");
00038 
00039 _LIT8(KSoapActionHeaderName,            "SOAPAction");
00040 _LIT8(KSoapActionHeaderValueEmpty,      "\"\""); // default, if not set
00041 
00042 const TInt KStateParsingSoapHeader      = 20; // ignore state   (even number)
00043 const TInt KStateParsingSoapBody        = 40; // ignore state   (even number)
00044 const TInt KStateParsingSoapFault       = 5;  // save state             (odd number)
00045 
00046 // FORWARD DECLARATIONS
00047 class CSenSoapFault;
00048 
00049 // CLASS DECLARATION
00050 
00062 class CSenSoapEnvelope : public CSenBaseFragment
00063     {
00064     public:  // Constructors and destructor
00065         
00069             IMPORT_C static CSenSoapEnvelope* NewL();
00070         
00074             IMPORT_C virtual ~CSenSoapEnvelope();
00075 
00076         // New functions
00077                 
00084             IMPORT_C virtual TPtrC8 SetBodyL(const TDesC8& aBody);
00085 
00091             IMPORT_C virtual CSenElement& BodyL();
00092 
00098             IMPORT_C virtual CSenElement& HeaderL();
00099 
00108             IMPORT_C virtual CSenElement& AddHeaderL(CSenElement& aHeaderElement);
00109 
00115                 IMPORT_C virtual HBufC8* BodyAsStringL();
00116 
00122                 IMPORT_C virtual TBool IsFault();
00123 
00131                 IMPORT_C virtual CSenSoapFault* DetachFaultL();
00132                 
00139                 IMPORT_C virtual CSenSoapFault* FaultL();
00140 
00158                 IMPORT_C virtual TPtrC8 SetSoapActionL(const TDesC8& aSoapAction);
00159 
00167                 IMPORT_C virtual TPtrC8 SoapAction();        
00168 
00169     protected:  
00170                 
00174                 CSenSoapEnvelope();
00175                 
00181             IMPORT_C void BaseConstructL();
00182                 
00183         // New functions
00184                 
00197             IMPORT_C virtual void ParseHeaderL( const TDesC8& aNsUri,
00198                                                                                 const TDesC8& aLocalName,
00199                                                                                 const TDesC8& aQName,
00200                                                                                 const RAttributeArray& aAttributes);
00201                                                                                 
00202         // Functions from base classes
00203             
00204             // From CSenBaseFragment 
00205                 
00224             IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
00225                                                                                 const TDesC8& aLocalName,
00226                                                                                 const TDesC8& aQName,
00227                                                                                 const RAttributeArray& aAttributes);
00228 
00238             IMPORT_C virtual void EndElementL(const TDesC8& aNsUri,
00239                                                                           const TDesC8& aLocalName,
00240                                                                           const TDesC8& aQName);
00241 
00242     protected: // Data
00243                 // Internal members, protected so that deriving classes have access to them.
00244                 CSenBaseFragment* ipBodyFragment;
00245                 CSenBaseFragment* ipHeaderFragment;
00246                 HBufC8* ipSoapAction;
00247 
00248     private: // Data
00249         TBool iFault;
00250         };
00251 
00252 // SEN_SOAP_ENVELOPE_H
00253 #endif
00254 
00255 // End of File
00256 
00257 
00258 

Copyright © Nokia Corporation 2001-2008
Back to top