williamr@2: /* williamr@2: * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: CSenSoapMessage is an utility class offering capability to williamr@2: * parse XML SOAP envelope and manipulation methods to alter its williamr@2: * contents. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef SEN_SOAP_MESSAGE_H williamr@2: #define SEN_SOAP_MESSAGE_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * CSenSoapMessage extends basic SOAP envelope functionality by williamr@2: * offering methods to set the security header and security token. williamr@2: * @lib SenUtils.lib williamr@2: * @since Series60 3.0 williamr@2: */ williamr@2: class CSenSoapMessage : public CSenSoapEnvelope williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phase constructor. williamr@2: */ williamr@2: IMPORT_C static CSenSoapMessage* NewL(); williamr@2: williamr@2: /** williamr@2: * Two-phase constructor. williamr@2: * @param aVersion version of SOAP (1.1 or 1.2) williamr@2: * @since Series60 4.0 williamr@2: */ williamr@2: IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion); williamr@2: williamr@2: /** williamr@2: * Two-phase constructor. williamr@2: * @param aVersion version of SOAP (1.1 or 1.2) williamr@2: * @param aSecurityNs seurity namespace version . williamr@2: * KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004 williamr@2: * @since Series60 4.0 williamr@2: */ williamr@2: IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CSenSoapMessage(); williamr@2: williamr@2: // New functions williamr@2: williamr@2: /** williamr@2: * Sets a new security header for the soap message. If existant, the williamr@2: * old security header is deleted and new one with given data is added. williamr@2: * @since Series60 3.0 williamr@2: * @param aData Data to be used in the security header. williamr@2: */ williamr@2: IMPORT_C void SetSecurityHeaderL(const TDesC8& aData); williamr@2: williamr@2: /** williamr@2: * Adds new token (content) to current security header, williamr@2: * appending to existing. The token is appended after the williamr@2: * current content of security token. Method instantiates williamr@2: * and adds default security header (without data), if williamr@2: * such was not set in beforehand. williamr@2: * @since Series60 3.0 williamr@2: * @param aNewToken Token to be inserted. williamr@2: * @return KErrNone or some system-wide Symbian error codes. williamr@2: */ williamr@2: IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: IMPORT_C CSenSoapMessage::CSenSoapMessage(); williamr@2: williamr@2: // New functions williamr@2: williamr@2: /** williamr@2: * Helper function to make a new security header. williamr@2: * @since Series60 3.0 williamr@2: * @param aData Default=NULL. Data to be set in the security header. williamr@2: * @return new security header, which is located in the cleanup stack. williamr@2: * Caller takes ownership. williamr@2: */ williamr@2: IMPORT_C virtual CSenWsSecurityHeader* NewSecurityHeaderLC( williamr@2: const TDesC8* aData=NULL); williamr@2: williamr@2: // Functions from base classes williamr@2: williamr@2: // From CSenSoapEnvelope williamr@2: williamr@2: /** williamr@2: * Implements functionality to parse SOAP header if one is found williamr@2: * during parsing the envelope. williamr@2: * Extends basic functionality from SOAP envelope by recognizing williamr@2: * and parsing element under following namespace: williamr@2: * http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd williamr@2: * All other headers are parsed using superclass (SOAP envelope) williamr@2: * functionality. williamr@2: * @since Series60 3.0 williamr@2: * @param aNsUri The namespace URI of the new element williamr@2: * @param aLocalName The local name of the new element williamr@2: * @param aQName The qualified name of the new element williamr@2: * @param aAttributes The attributes of the new element williamr@2: */ williamr@2: IMPORT_C virtual void ParseHeaderL(const TDesC8& aNsUri, williamr@2: const TDesC8& aLocalName, williamr@2: const TDesC8& aQName, williamr@2: const RAttributeArray& aAttributes); williamr@2: williamr@2: /** williamr@2: * This method should be called from the deriving classes ConstructL() methods. williamr@2: * @since Series60 3.0 williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(); williamr@2: williamr@2: /** williamr@2: * This method should be called from the deriving classes ConstructL() methods. williamr@2: * @since Series60 4.0 williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(TSOAPVersion aVersion); williamr@2: williamr@2: /** williamr@2: * This method should be called from the deriving classes ConstructL() methods. williamr@2: * @param aVersion version of SOAP (1.1 or 1.2) williamr@2: * @param aSecurityNs seurity namespace version . williamr@2: * KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004 williamr@2: * @since Series60 4.0 williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs); williamr@2: williamr@2: protected: // Data williamr@2: // Owned, but element not owned williamr@2: CSenWsSecurityHeader* ipSecurityHeader; williamr@2: }; williamr@2: williamr@2: #endif // SEN_SOAP_MESSAGE_H williamr@2: williamr@2: // End of File williamr@2: williamr@2: