epoc32/include/mw/sensoapmessage.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/sensoapmessage.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/sensoapmessage.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,166 @@
     1.4 -sensoapmessage.h
     1.5 +/*
     1.6 +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:        CSenSoapMessage is an utility class offering capability to
    1.19 +*                 parse XML SOAP envelope and manipulation methods to alter its
    1.20 +*                 contents.
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29 +
    1.30 +
    1.31 +#ifndef SEN_SOAP_MESSAGE_H
    1.32 +#define SEN_SOAP_MESSAGE_H
    1.33 +
    1.34 +//  INCLUDES
    1.35 +#include <SenWsSecurityHeader.h>
    1.36 +#include <SenSoapEnvelope.h>
    1.37 +
    1.38 +// CLASS DECLARATION
    1.39 +
    1.40 +/**
    1.41 +* CSenSoapMessage extends basic SOAP envelope functionality by
    1.42 +* offering methods to set the security header and security token.
    1.43 +* @lib SenUtils.lib
    1.44 +* @since Series60 3.0
    1.45 +*/
    1.46 +class CSenSoapMessage : public CSenSoapEnvelope
    1.47 +    {
    1.48 +    public:  // Constructors and destructor
    1.49 +        
    1.50 +        /**
    1.51 +        * Two-phase constructor.
    1.52 +        */
    1.53 +        IMPORT_C static CSenSoapMessage* NewL();
    1.54 +
    1.55 +        /**
    1.56 +        * Two-phase constructor.
    1.57 +        * @param    aVersion version of SOAP (1.1 or 1.2)
    1.58 +        * @since Series60 4.0
    1.59 +        */
    1.60 +        IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion);
    1.61 +        
    1.62 +        /**
    1.63 +        * Two-phase constructor.
    1.64 +        * @param    aVersion version of SOAP (1.1 or 1.2)
    1.65 +        * @param    aSecurityNs seurity namespace version . 
    1.66 +        *           KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
    1.67 +        * @since Series60 4.0
    1.68 +        */
    1.69 +        IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
    1.70 +        
    1.71 +        /**
    1.72 +        * Destructor.
    1.73 +        */
    1.74 +        IMPORT_C virtual ~CSenSoapMessage();
    1.75 +
    1.76 +        // New functions
    1.77 +        
    1.78 +        /**
    1.79 +        * Sets a new security header for the soap message. If existant, the
    1.80 +        * old security header is deleted and new one with given data is added.
    1.81 +        * @since Series60 3.0
    1.82 +        * @param    aData    Data to be used in the security header.
    1.83 +        */
    1.84 +        IMPORT_C void SetSecurityHeaderL(const TDesC8& aData);
    1.85 +        
    1.86 +        /**
    1.87 +        * Adds new token (content) to current security header, 
    1.88 +        * appending to existing. The token is appended after the
    1.89 +        * current content of security token. Method instantiates
    1.90 +        * and adds default security header (without data), if 
    1.91 +        * such was not set in beforehand.
    1.92 +        * @since Series60 3.0
    1.93 +        * @param    aNewToken    Token to be inserted.
    1.94 +        * @return    KErrNone or some system-wide Symbian error codes.
    1.95 +        */
    1.96 +        IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken);    
    1.97 +        
    1.98 +    protected:  
    1.99 +    
   1.100 +        /**
   1.101 +         *    C++ default constructor.
   1.102 +         */
   1.103 +        IMPORT_C CSenSoapMessage::CSenSoapMessage();
   1.104 +
   1.105 +        // New functions
   1.106 +        
   1.107 +        /**
   1.108 +        * Helper function to make a new security header.
   1.109 +        * @since Series60 3.0
   1.110 +        * @param    aData    Default=NULL. Data to be set in the security header.
   1.111 +        * @return    new security header, which is located in the cleanup stack.
   1.112 +        *            Caller takes ownership.
   1.113 +        */
   1.114 +        IMPORT_C virtual CSenWsSecurityHeader* NewSecurityHeaderLC(
   1.115 +                                                    const TDesC8* aData=NULL);
   1.116 +
   1.117 +        // Functions from base classes
   1.118 +        
   1.119 +        // From CSenSoapEnvelope 
   1.120 +        
   1.121 +        /**
   1.122 +        * Implements functionality to parse SOAP header if one is found
   1.123 +        * during parsing the envelope.
   1.124 +        * Extends basic functionality from SOAP envelope by recognizing
   1.125 +        * and parsing <Security> element under following namespace:
   1.126 +        * http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
   1.127 +        * All other headers are parsed using superclass (SOAP envelope)
   1.128 +        * functionality.
   1.129 +        * @since Series60 3.0
   1.130 +        * @param aNsUri            The namespace URI of the new element
   1.131 +        * @param aLocalName        The local name of the new element
   1.132 +        * @param aQName            The qualified name of the new element
   1.133 +        * @param aAttributes    The attributes of the new element
   1.134 +        */
   1.135 +        IMPORT_C virtual void ParseHeaderL(const TDesC8& aNsUri,
   1.136 +                                           const TDesC8& aLocalName,
   1.137 +                                           const TDesC8& aQName,
   1.138 +                                           const RAttributeArray& aAttributes);
   1.139 +
   1.140 +        /**
   1.141 +        * This method should be called from the deriving classes ConstructL() methods. 
   1.142 +        * @since Series60 3.0
   1.143 +        */
   1.144 +        IMPORT_C void BaseConstructL();
   1.145 +
   1.146 +        /**
   1.147 +        * This method should be called from the deriving classes ConstructL() methods. 
   1.148 +        * @since Series60 4.0
   1.149 +        */
   1.150 +        IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
   1.151 +        
   1.152 +        /**
   1.153 +        * This method should be called from the deriving classes ConstructL() methods.
   1.154 +        * @param    aVersion version of SOAP (1.1 or 1.2)
   1.155 +        * @param    aSecurityNs seurity namespace version . 
   1.156 +        *           KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
   1.157 +        * @since Series60 4.0
   1.158 +        */
   1.159 +        IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
   1.160 +
   1.161 +    protected: // Data
   1.162 +        // Owned, but element not owned
   1.163 +        CSenWsSecurityHeader* ipSecurityHeader; 
   1.164 +    };
   1.165 +
   1.166 +#endif // SEN_SOAP_MESSAGE_H
   1.167 +
   1.168 +// End of File
   1.169 +
   1.170 +