williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
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
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: CSenSoapMessage is an utility class offering capability to
|
williamr@2
|
15 |
* parse XML SOAP envelope and manipulation methods to alter its
|
williamr@2
|
16 |
* contents.
|
williamr@2
|
17 |
*
|
williamr@2
|
18 |
*/
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#ifndef SEN_SOAP_MESSAGE_H
|
williamr@2
|
28 |
#define SEN_SOAP_MESSAGE_H
|
williamr@2
|
29 |
|
williamr@2
|
30 |
// INCLUDES
|
williamr@2
|
31 |
#include <SenWsSecurityHeader.h>
|
williamr@2
|
32 |
#include <SenSoapEnvelope.h>
|
williamr@2
|
33 |
|
williamr@2
|
34 |
// CLASS DECLARATION
|
williamr@2
|
35 |
|
williamr@2
|
36 |
/**
|
williamr@2
|
37 |
* CSenSoapMessage extends basic SOAP envelope functionality by
|
williamr@2
|
38 |
* offering methods to set the security header and security token.
|
williamr@2
|
39 |
* @lib SenUtils.lib
|
williamr@2
|
40 |
* @since Series60 3.0
|
williamr@2
|
41 |
*/
|
williamr@2
|
42 |
class CSenSoapMessage : public CSenSoapEnvelope
|
williamr@2
|
43 |
{
|
williamr@2
|
44 |
public: // Constructors and destructor
|
williamr@2
|
45 |
|
williamr@2
|
46 |
/**
|
williamr@2
|
47 |
* Two-phase constructor.
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
IMPORT_C static CSenSoapMessage* NewL();
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/**
|
williamr@2
|
52 |
* Two-phase constructor.
|
williamr@2
|
53 |
* @param aVersion version of SOAP (1.1 or 1.2)
|
williamr@2
|
54 |
* @since Series60 4.0
|
williamr@2
|
55 |
*/
|
williamr@2
|
56 |
IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion);
|
williamr@2
|
57 |
|
williamr@2
|
58 |
/**
|
williamr@2
|
59 |
* Two-phase constructor.
|
williamr@2
|
60 |
* @param aVersion version of SOAP (1.1 or 1.2)
|
williamr@2
|
61 |
* @param aSecurityNs seurity namespace version .
|
williamr@2
|
62 |
* KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
|
williamr@2
|
63 |
* @since Series60 4.0
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
IMPORT_C static CSenSoapMessage* NewL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/**
|
williamr@2
|
68 |
* Destructor.
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
IMPORT_C virtual ~CSenSoapMessage();
|
williamr@2
|
71 |
|
williamr@2
|
72 |
// New functions
|
williamr@2
|
73 |
|
williamr@2
|
74 |
/**
|
williamr@2
|
75 |
* Sets a new security header for the soap message. If existant, the
|
williamr@2
|
76 |
* old security header is deleted and new one with given data is added.
|
williamr@2
|
77 |
* @since Series60 3.0
|
williamr@2
|
78 |
* @param aData Data to be used in the security header.
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
IMPORT_C void SetSecurityHeaderL(const TDesC8& aData);
|
williamr@2
|
81 |
|
williamr@2
|
82 |
/**
|
williamr@2
|
83 |
* Adds new token (content) to current security header,
|
williamr@2
|
84 |
* appending to existing. The token is appended after the
|
williamr@2
|
85 |
* current content of security token. Method instantiates
|
williamr@2
|
86 |
* and adds default security header (without data), if
|
williamr@2
|
87 |
* such was not set in beforehand.
|
williamr@2
|
88 |
* @since Series60 3.0
|
williamr@2
|
89 |
* @param aNewToken Token to be inserted.
|
williamr@2
|
90 |
* @return KErrNone or some system-wide Symbian error codes.
|
williamr@2
|
91 |
*/
|
williamr@2
|
92 |
IMPORT_C TInt AddSecurityTokenL(const TDesC8& aNewToken);
|
williamr@2
|
93 |
|
williamr@2
|
94 |
protected:
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/**
|
williamr@2
|
97 |
* C++ default constructor.
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
IMPORT_C CSenSoapMessage::CSenSoapMessage();
|
williamr@2
|
100 |
|
williamr@2
|
101 |
// New functions
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
* Helper function to make a new security header.
|
williamr@2
|
105 |
* @since Series60 3.0
|
williamr@2
|
106 |
* @param aData Default=NULL. Data to be set in the security header.
|
williamr@2
|
107 |
* @return new security header, which is located in the cleanup stack.
|
williamr@2
|
108 |
* Caller takes ownership.
|
williamr@2
|
109 |
*/
|
williamr@2
|
110 |
IMPORT_C virtual CSenWsSecurityHeader* NewSecurityHeaderLC(
|
williamr@2
|
111 |
const TDesC8* aData=NULL);
|
williamr@2
|
112 |
|
williamr@2
|
113 |
// Functions from base classes
|
williamr@2
|
114 |
|
williamr@2
|
115 |
// From CSenSoapEnvelope
|
williamr@2
|
116 |
|
williamr@2
|
117 |
/**
|
williamr@2
|
118 |
* Implements functionality to parse SOAP header if one is found
|
williamr@2
|
119 |
* during parsing the envelope.
|
williamr@2
|
120 |
* Extends basic functionality from SOAP envelope by recognizing
|
williamr@2
|
121 |
* and parsing <Security> element under following namespace:
|
williamr@2
|
122 |
* http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
|
williamr@2
|
123 |
* All other headers are parsed using superclass (SOAP envelope)
|
williamr@2
|
124 |
* functionality.
|
williamr@2
|
125 |
* @since Series60 3.0
|
williamr@2
|
126 |
* @param aNsUri The namespace URI of the new element
|
williamr@2
|
127 |
* @param aLocalName The local name of the new element
|
williamr@2
|
128 |
* @param aQName The qualified name of the new element
|
williamr@2
|
129 |
* @param aAttributes The attributes of the new element
|
williamr@2
|
130 |
*/
|
williamr@2
|
131 |
IMPORT_C virtual void ParseHeaderL(const TDesC8& aNsUri,
|
williamr@2
|
132 |
const TDesC8& aLocalName,
|
williamr@2
|
133 |
const TDesC8& aQName,
|
williamr@2
|
134 |
const RAttributeArray& aAttributes);
|
williamr@2
|
135 |
|
williamr@2
|
136 |
/**
|
williamr@2
|
137 |
* This method should be called from the deriving classes ConstructL() methods.
|
williamr@2
|
138 |
* @since Series60 3.0
|
williamr@2
|
139 |
*/
|
williamr@2
|
140 |
IMPORT_C void BaseConstructL();
|
williamr@2
|
141 |
|
williamr@2
|
142 |
/**
|
williamr@2
|
143 |
* This method should be called from the deriving classes ConstructL() methods.
|
williamr@2
|
144 |
* @since Series60 4.0
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
IMPORT_C void BaseConstructL(TSOAPVersion aVersion);
|
williamr@2
|
147 |
|
williamr@2
|
148 |
/**
|
williamr@2
|
149 |
* This method should be called from the deriving classes ConstructL() methods.
|
williamr@2
|
150 |
* @param aVersion version of SOAP (1.1 or 1.2)
|
williamr@2
|
151 |
* @param aSecurityNs seurity namespace version .
|
williamr@2
|
152 |
* KSecuritySchemeXmlNs from 2003 , or KSecurityXmlNs from 2004
|
williamr@2
|
153 |
* @since Series60 4.0
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
IMPORT_C void BaseConstructL(TSOAPVersion aVersion, const TDesC8& aSecurityNs);
|
williamr@2
|
156 |
|
williamr@2
|
157 |
protected: // Data
|
williamr@2
|
158 |
// Owned, but element not owned
|
williamr@2
|
159 |
CSenWsSecurityHeader* ipSecurityHeader;
|
williamr@2
|
160 |
};
|
williamr@2
|
161 |
|
williamr@2
|
162 |
#endif // SEN_SOAP_MESSAGE_H
|
williamr@2
|
163 |
|
williamr@2
|
164 |
// End of File
|
williamr@2
|
165 |
|
williamr@2
|
166 |
|