2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: CSenSoapMessage is an utility class offering capability to
15 * parse XML SOAP envelope and manipulation methods to alter its
27 #ifndef SEN_SOAP_MESSAGE_H
28 #define SEN_SOAP_MESSAGE_H
31 #include <SenWsSecurityHeader.h>
32 #include <SenSoapEnvelope.h>
37 * CSenSoapMessage extends basic SOAP envelope functionality by
38 * offering methods to set the security header and security token.
42 class CSenSoapMessage : public CSenSoapEnvelope
44 public: // Constructors and destructor
47 * Two-phase constructor.
49 IMPORT_C static CSenSoapMessage* NewL();
52 * Two-phase constructor.
53 * @param aVersion version of SOAP (1.1 or 1.2)
56 IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion);
59 * Two-phase constructor.
60 * @param aVersion version of SOAP (1.1 or 1.2)
61 * @param aSecurityNs seurity namespace version .
62 * KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
65 IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
70 IMPORT_C virtual ~CSenSoapMessage();
75 * Sets a new security header for the soap message. If existant, the
76 * old security header is deleted and new one with given data is added.
78 * @param aData Data to be used in the security header.
80 IMPORT_C void SetSecurityHeaderL(const TDesC8& aData);
83 * Adds new token (content) to current security header,
84 * appending to existing. The token is appended after the
85 * current content of security token. Method instantiates
86 * and adds default security header (without data), if
87 * such was not set in beforehand.
89 * @param aNewToken Token to be inserted.
90 * @return KErrNone or some system-wide Symbian error codes.
92 IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken);
97 * C++ default constructor.
99 IMPORT_C CSenSoapMessage::CSenSoapMessage();
104 * Helper function to make a new security header.
105 * @since Series60 3.0
106 * @param aData Default=NULL. Data to be set in the security header.
107 * @return new security header, which is located in the cleanup stack.
108 * Caller takes ownership.
110 IMPORT_C virtual CSenWsSecurityHeader* NewSecurityHeaderLC(
111 const TDesC8* aData=NULL);
113 // Functions from base classes
115 // From CSenSoapEnvelope
118 * Implements functionality to parse SOAP header if one is found
119 * during parsing the envelope.
120 * Extends basic functionality from SOAP envelope by recognizing
121 * and parsing <Security> element under following namespace:
122 * http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
123 * All other headers are parsed using superclass (SOAP envelope)
125 * @since Series60 3.0
126 * @param aNsUri The namespace URI of the new element
127 * @param aLocalName The local name of the new element
128 * @param aQName The qualified name of the new element
129 * @param aAttributes The attributes of the new element
131 IMPORT_C virtual void ParseHeaderL(const TDesC8& aNsUri,
132 const TDesC8& aLocalName,
133 const TDesC8& aQName,
134 const RAttributeArray& aAttributes);
137 * This method should be called from the deriving classes ConstructL() methods.
138 * @since Series60 3.0
140 IMPORT_C void BaseConstructL();
143 * This method should be called from the deriving classes ConstructL() methods.
144 * @since Series60 4.0
146 IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
149 * This method should be called from the deriving classes ConstructL() methods.
150 * @param aVersion version of SOAP (1.1 or 1.2)
151 * @param aSecurityNs seurity namespace version .
152 * KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
153 * @since Series60 4.0
155 IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
158 // Owned, but element not owned
159 CSenWsSecurityHeader* ipSecurityHeader;
162 #endif // SEN_SOAP_MESSAGE_H