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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.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_MESSAGE2_H
28 #define SEN_SOAP_MESSAGE2_H
31 #include <SenWsSecurityHeader2.h>
32 #include <SenSoapEnvelope2.h>
34 class MSenMessageContext;
39 * CSenSoapMessage extends basic SOAP envelope functionality by
40 * offering methods to set the security header and security token.
44 class CSenSoapMessage2 : public CSenSoapEnvelope2
46 public: // Constructors and destructor
49 * Two-phase constructor.
51 IMPORT_C static CSenSoapMessage2* NewL();
54 * Two-phase constructor.
56 IMPORT_C static CSenSoapMessage2* NewLC();
59 * Two-phase constructor.
61 IMPORT_C static CSenSoapMessage2* NewL(TSOAPVersion aVersion);
64 * Two-phase constructor.
66 IMPORT_C static CSenSoapMessage2* NewLC(TSOAPVersion aVersion);
69 * Two-phase constructor.
71 IMPORT_C static CSenSoapMessage2* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
74 * Two-phase constructor.
76 IMPORT_C static CSenSoapMessage2* NewLC(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
79 * Two-phase constructor.
81 IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext);
84 * Two-phase constructor.
86 IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext);
89 * Two-phase constructor.
91 IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext,
92 TSOAPVersion aVersion);
95 * Two-phase constructor.
97 IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext,
98 TSOAPVersion aVersion);
101 * Two-phase constructor.
103 IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext,
104 TSOAPVersion aVersion,
105 const TDesC8& aSecurityNs);
108 * Two-phase constructor.
110 IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext,
111 TSOAPVersion aVersion,
112 const TDesC8& aSecurityNs);
115 * Two-phased copy constructor.
117 IMPORT_C static CSenSoapMessage2* NewL(CSenSoapMessage2& aMessage);
120 * Two-phased copy constructor.
122 IMPORT_C static CSenSoapMessage2* NewLC(CSenSoapMessage2& aMessage);
127 IMPORT_C virtual ~CSenSoapMessage2();
132 * Sets a new security header for the soap message. If existant, the
133 * old security header is deleted and new one with given data is added.
134 * @since Series60 4.0
135 * @param aData Data to be used in the security header.
137 IMPORT_C void SetSecurityHeaderL(const TDesC8& aData);
140 * Adds new token (content) to current security header,
141 * appending to existing. The token is appended after the
142 * current content of security token. Method instantiates
143 * and adds default security header (without data), if
144 * such was not set in beforehand.
145 * @since Series60 4.0
146 * @param aNewToken Token to be inserted.
147 * @return KErrNone or some system-wide Symbian error codes.
149 IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken);
151 public: // From MSenMessage
152 IMPORT_C virtual TClass Type();
153 IMPORT_C virtual MSenMessage* CloneL();
158 * C++ default constructor.
160 IMPORT_C CSenSoapMessage2::CSenSoapMessage2();
165 * Helper function to make a new security header.
166 * @since Series60 4.0
167 * @param aData Default=NULL. Data to be set in the security header.
168 * @return new security header, which is located in the cleanup stack.
169 * Caller takes ownership.
171 IMPORT_C virtual CSenWsSecurityHeader2* NewSecurityHeaderLC(
173 RSenDocument aDocument,
174 TXmlEngElement element);
176 // Functions from base classes
178 // From CSenSoapEnvelope
179 IMPORT_C virtual void ParseHeaderL(const RTagInfo& aElement,
180 const RAttributeArray& aAttributes);
183 * This method should be called from the deriving classes ConstructL() methods.
184 * @since Series60 4.0
186 IMPORT_C void BaseConstructL();
189 * This method should be called from the deriving classes ConstructL() methods.
190 * @since Series60 4.0
192 IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
195 * This method should be called from the deriving classes ConstructL() methods.
196 * @since Series60 4.0
198 IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
201 * This method should be called from the deriving classes ConstructL() methods.
202 * @since Series60 4.0
204 IMPORT_C void BaseConstructL(MSenMessageContext& aContext);
207 * This method should be called from the deriving classes ConstructL() methods.
208 * @since Series60 4.0
210 IMPORT_C void BaseConstructL(MSenMessageContext& aContext,
211 TSOAPVersion aVersion);
214 * This method should be called from the deriving classes ConstructL() methods.
215 * @since Series60 4.0
217 IMPORT_C void BaseConstructL(MSenMessageContext& aContext,
218 TSOAPVersion aVersion,
219 const TDesC8& aSecurityNs);
222 * This method should be called from the deriving
223 * classes ConstructL() methods.
224 * @since Series60 4.0
226 IMPORT_C void BaseConstructL(CSenSoapMessage2& aMessage);
229 // Owned, but element not owned
230 CSenWsSecurityHeader2* ipSecurityHeader;
233 #endif // SEN_SOAP_MESSAGE_H