1 sensoapmessage2.h |
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CSenSoapMessage is an utility class offering capability to |
|
15 * parse XML SOAP envelope and manipulation methods to alter its |
|
16 * contents. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 #ifndef SEN_SOAP_MESSAGE2_H |
|
28 #define SEN_SOAP_MESSAGE2_H |
|
29 |
|
30 // INCLUDES |
|
31 #include <SenWsSecurityHeader2.h> |
|
32 #include <SenSoapEnvelope2.h> |
|
33 |
|
34 class MSenMessageContext; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * CSenSoapMessage extends basic SOAP envelope functionality by |
|
40 * offering methods to set the security header and security token. |
|
41 * @lib SenUtils.lib |
|
42 * @since Series60 4.0 |
|
43 */ |
|
44 class CSenSoapMessage2 : public CSenSoapEnvelope2 |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phase constructor. |
|
50 */ |
|
51 IMPORT_C static CSenSoapMessage2* NewL(); |
|
52 |
|
53 /** |
|
54 * Two-phase constructor. |
|
55 */ |
|
56 IMPORT_C static CSenSoapMessage2* NewLC(); |
|
57 |
|
58 /** |
|
59 * Two-phase constructor. |
|
60 */ |
|
61 IMPORT_C static CSenSoapMessage2* NewL(TSOAPVersion aVersion); |
|
62 |
|
63 /** |
|
64 * Two-phase constructor. |
|
65 */ |
|
66 IMPORT_C static CSenSoapMessage2* NewLC(TSOAPVersion aVersion); |
|
67 |
|
68 /** |
|
69 * Two-phase constructor. |
|
70 */ |
|
71 IMPORT_C static CSenSoapMessage2* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs); |
|
72 |
|
73 /** |
|
74 * Two-phase constructor. |
|
75 */ |
|
76 IMPORT_C static CSenSoapMessage2* NewLC(TSOAPVersion aVersion, const TDesC8& aSecurityNs); |
|
77 |
|
78 /** |
|
79 * Two-phase constructor. |
|
80 */ |
|
81 IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext); |
|
82 |
|
83 /** |
|
84 * Two-phase constructor. |
|
85 */ |
|
86 IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext); |
|
87 |
|
88 /** |
|
89 * Two-phase constructor. |
|
90 */ |
|
91 IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext, |
|
92 TSOAPVersion aVersion); |
|
93 |
|
94 /** |
|
95 * Two-phase constructor. |
|
96 */ |
|
97 IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext, |
|
98 TSOAPVersion aVersion); |
|
99 |
|
100 /** |
|
101 * Two-phase constructor. |
|
102 */ |
|
103 IMPORT_C static CSenSoapMessage2* NewL(MSenMessageContext& aContext, |
|
104 TSOAPVersion aVersion, |
|
105 const TDesC8& aSecurityNs); |
|
106 |
|
107 /** |
|
108 * Two-phase constructor. |
|
109 */ |
|
110 IMPORT_C static CSenSoapMessage2* NewLC(MSenMessageContext& aContext, |
|
111 TSOAPVersion aVersion, |
|
112 const TDesC8& aSecurityNs); |
|
113 |
|
114 /** |
|
115 * Two-phased copy constructor. |
|
116 */ |
|
117 IMPORT_C static CSenSoapMessage2* NewL(CSenSoapMessage2& aMessage); |
|
118 |
|
119 /** |
|
120 * Two-phased copy constructor. |
|
121 */ |
|
122 IMPORT_C static CSenSoapMessage2* NewLC(CSenSoapMessage2& aMessage); |
|
123 |
|
124 /** |
|
125 * Destructor. |
|
126 */ |
|
127 IMPORT_C virtual ~CSenSoapMessage2(); |
|
128 |
|
129 // New functions |
|
130 |
|
131 /** |
|
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. |
|
136 */ |
|
137 IMPORT_C void SetSecurityHeaderL(const TDesC8& aData); |
|
138 |
|
139 /** |
|
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. |
|
148 */ |
|
149 IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken); |
|
150 |
|
151 public: // From MSenMessage |
|
152 IMPORT_C virtual TClass Type(); |
|
153 IMPORT_C virtual MSenMessage* CloneL(); |
|
154 |
|
155 protected: |
|
156 |
|
157 /** |
|
158 * C++ default constructor. |
|
159 */ |
|
160 IMPORT_C CSenSoapMessage2::CSenSoapMessage2(); |
|
161 |
|
162 // New functions |
|
163 |
|
164 /** |
|
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. |
|
170 */ |
|
171 IMPORT_C virtual CSenWsSecurityHeader2* NewSecurityHeaderLC( |
|
172 const TDesC8* aData, |
|
173 RSenDocument aDocument, |
|
174 TXmlEngElement element); |
|
175 |
|
176 // Functions from base classes |
|
177 |
|
178 // From CSenSoapEnvelope |
|
179 IMPORT_C virtual void ParseHeaderL(const RTagInfo& aElement, |
|
180 const RAttributeArray& aAttributes); |
|
181 |
|
182 /** |
|
183 * This method should be called from the deriving classes ConstructL() methods. |
|
184 * @since Series60 4.0 |
|
185 */ |
|
186 IMPORT_C void BaseConstructL(); |
|
187 |
|
188 /** |
|
189 * This method should be called from the deriving classes ConstructL() methods. |
|
190 * @since Series60 4.0 |
|
191 */ |
|
192 IMPORT_C void BaseConstructL(TSOAPVersion aVersion); |
|
193 |
|
194 /** |
|
195 * This method should be called from the deriving classes ConstructL() methods. |
|
196 * @since Series60 4.0 |
|
197 */ |
|
198 IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs); |
|
199 |
|
200 /** |
|
201 * This method should be called from the deriving classes ConstructL() methods. |
|
202 * @since Series60 4.0 |
|
203 */ |
|
204 IMPORT_C void BaseConstructL(MSenMessageContext& aContext); |
|
205 |
|
206 /** |
|
207 * This method should be called from the deriving classes ConstructL() methods. |
|
208 * @since Series60 4.0 |
|
209 */ |
|
210 IMPORT_C void BaseConstructL(MSenMessageContext& aContext, |
|
211 TSOAPVersion aVersion); |
|
212 |
|
213 /** |
|
214 * This method should be called from the deriving classes ConstructL() methods. |
|
215 * @since Series60 4.0 |
|
216 */ |
|
217 IMPORT_C void BaseConstructL(MSenMessageContext& aContext, |
|
218 TSOAPVersion aVersion, |
|
219 const TDesC8& aSecurityNs); |
|
220 |
|
221 /** |
|
222 * This method should be called from the deriving |
|
223 * classes ConstructL() methods. |
|
224 * @since Series60 4.0 |
|
225 */ |
|
226 IMPORT_C void BaseConstructL(CSenSoapMessage2& aMessage); |
|
227 |
|
228 protected: // Data |
|
229 // Owned, but element not owned |
|
230 CSenWsSecurityHeader2* ipSecurityHeader; |
|
231 }; |
|
232 |
|
233 #endif // SEN_SOAP_MESSAGE_H |
|
234 |
|
235 // End of File |
|
236 |
|
237 |