williamr@2
|
1 |
/*
|
williamr@4
|
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@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.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@4
|
14 |
* Description: CSenServiceConnection offers public API for
|
williamr@2
|
15 |
* service consumers to access invocable services,
|
williamr@2
|
16 |
* as a part of the Web Services Framework (WSF).
|
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 |
|
williamr@4
|
28 |
|
williamr@4
|
29 |
|
williamr@4
|
30 |
|
williamr@2
|
31 |
#ifndef SEN_SERVICE_CONNECTION_H
|
williamr@2
|
32 |
#define SEN_SERVICE_CONNECTION_H
|
williamr@2
|
33 |
|
williamr@2
|
34 |
// INCLUDES
|
williamr@2
|
35 |
#include <e32base.h> // for CActive
|
williamr@2
|
36 |
#include <MSenServiceConsumer.h>
|
williamr@2
|
37 |
#include <MSenServiceDescription.h>
|
williamr@2
|
38 |
|
williamr@2
|
39 |
#include <MSenAuthenticationProvider.h>
|
williamr@2
|
40 |
|
williamr@2
|
41 |
#include <SenSoapMessage.h>
|
williamr@2
|
42 |
#include <SenSoapMessage2.h>
|
williamr@2
|
43 |
//#include <SenAtomEntry.h>
|
williamr@2
|
44 |
|
williamr@2
|
45 |
|
williamr@2
|
46 |
#include <MSenMessage.h>
|
williamr@2
|
47 |
|
williamr@2
|
48 |
// CONSTANTS
|
williamr@2
|
49 |
const TInt KErrSenNotInitialized = -30291;
|
williamr@2
|
50 |
const TInt KErrSenServiceConnectionBusy = -30292;
|
williamr@2
|
51 |
const TInt KErrConnectionInitializing = -30293;
|
williamr@2
|
52 |
const TInt KErrConnectionExpired = -30294;
|
williamr@2
|
53 |
const TInt KErrSubmitting = -30295;
|
williamr@2
|
54 |
const TInt KErrSenSoapFault = -30296;
|
williamr@2
|
55 |
const TInt KErrSenInternal = -30297;
|
williamr@2
|
56 |
const TInt KErrSenNoEndpoint = -30298;
|
williamr@2
|
57 |
const TInt KErrSenNoContract = -30299;
|
williamr@2
|
58 |
|
williamr@2
|
59 |
const TInt KErrSenProviderIdInUseByAnotherEndpoint = -30305;
|
williamr@2
|
60 |
const TInt KErrSenNoContractNoEndPoint = -30306;
|
williamr@2
|
61 |
|
williamr@2
|
62 |
const TInt KErrSenBrokenSoapEnvelope = -30307;
|
williamr@2
|
63 |
const TInt KErrSenBrokenSoapFault = -30308;
|
williamr@2
|
64 |
const TInt KErrSenCancelled = -30309;
|
williamr@2
|
65 |
|
williamr@2
|
66 |
|
williamr@2
|
67 |
// HTTP transport error codes:
|
williamr@2
|
68 |
const TInt KErrSenNoHttpResponseBody = -30310;
|
williamr@2
|
69 |
const TInt KErrSenNoHttpContentType = -30311;
|
williamr@2
|
70 |
const TInt KErrSenHttpRedirectRequiresConfirmation = -30312;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
// SOAP message verification error codes:
|
williamr@2
|
73 |
const TInt KErrSenNoSoapBody = -30313;
|
williamr@2
|
74 |
const TInt KErrSenNoSoapHeader = -30314;
|
williamr@2
|
75 |
const TInt KErrSenNoPermission = -30315;
|
williamr@2
|
76 |
|
williamr@2
|
77 |
const TInt KErrSenHostNotAvailable = -30318;
|
williamr@2
|
78 |
|
williamr@2
|
79 |
const TInt KErrSenAuthenticationFault = -30319;
|
williamr@2
|
80 |
const TInt KErrSenNoEndUserPermission = -30321;
|
williamr@4
|
81 |
const TInt KErrSenBrandNotSupported = -30322;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
const TInt KSenConnectionStatusCreateFailed = -1; // post-state
|
williamr@2
|
84 |
const TInt KSenConnectionStatusNew = 0; // post-state
|
williamr@2
|
85 |
const TInt KSenConnectionStatusReady = 1; // post-state
|
williamr@2
|
86 |
const TInt KSenConnectionStatusExpired = 2; // post-state
|
williamr@2
|
87 |
const TInt KSenConnectionStatusAuthentication = 3; // pre-state
|
williamr@2
|
88 |
const TInt KSenConnectionStatusDiscovery = 4; // pre-state
|
williamr@2
|
89 |
const TInt KSenConnectionStatusMetadataExchange = 5; // pre-state
|
williamr@2
|
90 |
|
williamr@2
|
91 |
_LIT8(KDefaultBasicWebServicesFrameworkID, "WS-I");
|
williamr@2
|
92 |
_LIT8(KDefaultIdWsfFrameworkID, "ID-WSF");
|
williamr@2
|
93 |
_LIT8(KDefaultRestServicesFrameworkID, "REST");
|
williamr@2
|
94 |
_LIT8(KDefaultWSStarFrameworkID, "WS-STAR");
|
williamr@2
|
95 |
_LIT8(KDefaultAtomPubFrameworkID, "ATOM-PUB");
|
williamr@2
|
96 |
_LIT8(KDefaultOviFrameworkID, "OVI");
|
williamr@2
|
97 |
|
williamr@2
|
98 |
const TInt KSenTransportStatusCodeOffsetBaseHttp = 1000;
|
williamr@2
|
99 |
const TInt KSenTransportStatusCodeOffsetBaseVtcp = 2000;
|
williamr@2
|
100 |
|
williamr@2
|
101 |
const TInt KSenTransportStatusCodeVtcpInit = 2001; // KSenTransportStatusCodeOffsetBaseVtcp +1
|
williamr@2
|
102 |
const TInt KSenTransportStatusCodeVtcpActive = 2002; // KSenTransportStatusCodeOffsetBaseVtcp +2
|
williamr@2
|
103 |
const TInt KSenTransportStatusCodeVtcpSuspended = 2003; // KSenTransportStatusCodeOffsetBaseVtcp +3
|
williamr@2
|
104 |
const TInt KSenTransportStatusCodeVtcpInactive = 2004; // KSenTransportStatusCodeOffsetBaseVtcp +4
|
williamr@2
|
105 |
const TInt KSenTransportStatusCodeVtcpUnavailable = 2005; // KSenTransportStatusCodeOffsetBaseVtcp +5
|
williamr@2
|
106 |
|
williamr@2
|
107 |
// FORWARD DECLARATIONS
|
williamr@2
|
108 |
class CSenServicePattern;
|
williamr@2
|
109 |
class CSenIdentityProvider;
|
williamr@2
|
110 |
|
williamr@4
|
111 |
struct TSenDataTrafficDetails
|
williamr@4
|
112 |
{
|
williamr@4
|
113 |
public:
|
williamr@4
|
114 |
|
williamr@4
|
115 |
TSenDataTrafficDetails():iTotalBytesSent(0),
|
williamr@4
|
116 |
iTotalBytesRecieved(0)
|
williamr@4
|
117 |
{
|
williamr@4
|
118 |
}
|
williamr@4
|
119 |
|
williamr@4
|
120 |
TBool operator==(TSenDataTrafficDetails& rhs)
|
williamr@4
|
121 |
{
|
williamr@4
|
122 |
if( (this->iTotalBytesSent == rhs.iTotalBytesSent) &&
|
williamr@4
|
123 |
(this->iTotalBytesRecieved == rhs.iTotalBytesRecieved) )
|
williamr@4
|
124 |
return ETrue;
|
williamr@4
|
125 |
else
|
williamr@4
|
126 |
return EFalse;
|
williamr@4
|
127 |
}
|
williamr@4
|
128 |
|
williamr@4
|
129 |
TSenDataTrafficDetails& operator=(TSenDataTrafficDetails& rhs)
|
williamr@4
|
130 |
{
|
williamr@4
|
131 |
if(*this == rhs)
|
williamr@4
|
132 |
return *this;
|
williamr@4
|
133 |
this->iTotalBytesSent = rhs.iTotalBytesSent;
|
williamr@4
|
134 |
this->iTotalBytesRecieved = rhs.iTotalBytesRecieved;
|
williamr@4
|
135 |
return *this;
|
williamr@4
|
136 |
}
|
williamr@4
|
137 |
|
williamr@4
|
138 |
TSenDataTrafficDetails& operator+=(TSenDataTrafficDetails& rhs)
|
williamr@4
|
139 |
{
|
williamr@4
|
140 |
this->iTotalBytesSent += rhs.iTotalBytesSent;
|
williamr@4
|
141 |
this->iTotalBytesRecieved += rhs.iTotalBytesRecieved;
|
williamr@4
|
142 |
return *this;
|
williamr@4
|
143 |
}
|
williamr@4
|
144 |
|
williamr@4
|
145 |
TUint iTotalBytesSent ;
|
williamr@4
|
146 |
TUint iTotalBytesRecieved ;
|
williamr@4
|
147 |
private:
|
williamr@4
|
148 |
TAny* iReserved;
|
williamr@4
|
149 |
};
|
williamr@4
|
150 |
|
williamr@4
|
151 |
struct TSenDataTrafficOperations
|
williamr@4
|
152 |
{
|
williamr@4
|
153 |
public:
|
williamr@4
|
154 |
TSenDataTrafficOperations(): iReset(EFalse)
|
williamr@4
|
155 |
{
|
williamr@4
|
156 |
}
|
williamr@4
|
157 |
TBool iReset;
|
williamr@4
|
158 |
private:
|
williamr@4
|
159 |
TAny* iReserved;
|
williamr@4
|
160 |
};
|
williamr@4
|
161 |
|
williamr@2
|
162 |
// CLASS DECLARATION
|
williamr@2
|
163 |
|
williamr@2
|
164 |
/**
|
williamr@2
|
165 |
* The class for connecting to service providers
|
williamr@2
|
166 |
* through Web Services Framework (WSF).
|
williamr@2
|
167 |
*
|
williamr@2
|
168 |
* The class offers asynchronous construction of a
|
williamr@2
|
169 |
* service connection. Further, there are asynchronous
|
williamr@2
|
170 |
* and synchronous interaction methods for e.g. sending
|
williamr@2
|
171 |
* and receiving data from (possibly remote) service.
|
williamr@2
|
172 |
*
|
williamr@2
|
173 |
* WSF offers two default frameworks:
|
williamr@2
|
174 |
*
|
williamr@2
|
175 |
* 1. Identity Based Web Services Framework
|
williamr@2
|
176 |
* (ID-WSF). The framework ID for this is
|
williamr@2
|
177 |
* KDefaultIdWsfFrameworkID ("ID-WSF").
|
williamr@2
|
178 |
*
|
williamr@2
|
179 |
* 2. Basic Web Services Framework. Framework
|
williamr@2
|
180 |
* ID is KDefaultBasicWebServicesFrameworkID
|
williamr@2
|
181 |
* ("WS-I").
|
williamr@2
|
182 |
*
|
williamr@2
|
183 |
* The most typical use of CSenServiceConnection
|
williamr@2
|
184 |
* is to interact with a service of certain type
|
williamr@2
|
185 |
* through some invocable framework and submitting
|
williamr@2
|
186 |
* and receiving messages.
|
williamr@2
|
187 |
*
|
williamr@2
|
188 |
* In case of WebServices, the actual service is remote
|
williamr@2
|
189 |
* and submitted messages are SOAP envelopes. However,
|
williamr@2
|
190 |
* CSenServiceConnection supports accessing any
|
williamr@2
|
191 |
* ServiceInvocationFramework which ECOM plug-in
|
williamr@2
|
192 |
* implementation is present. These plug-ins may
|
williamr@2
|
193 |
* further communicate with some service, including
|
williamr@2
|
194 |
* local services.
|
williamr@2
|
195 |
*
|
williamr@2
|
196 |
* The link between CSenServiceConnection and any plug-in
|
williamr@2
|
197 |
* implementation interacting with some service is the
|
williamr@2
|
198 |
* framework ID, which is a property of ServiceDescription (SD)
|
williamr@2
|
199 |
* and accessible via MSenServiceDescription interface, which
|
williamr@2
|
200 |
* each SD class must implement.
|
williamr@2
|
201 |
*
|
williamr@2
|
202 |
* When creating a connection, one offers predefined SD as
|
williamr@2
|
203 |
* an argument for asynchronous constructor. Or, optionally
|
williamr@2
|
204 |
* only a Liberty Alliance ID-WSF specific contract string
|
williamr@2
|
205 |
* - typically some URN. If only contract is offered, then
|
williamr@2
|
206 |
* the created connection defaults to ID-WSF service and
|
williamr@2
|
207 |
* ID-WSF framework (ID) will be used.
|
williamr@2
|
208 |
*
|
williamr@2
|
209 |
* The WSF further uses the offered framework ID while looking
|
williamr@2
|
210 |
* up any matching framework plug-in implementation. As a
|
williamr@2
|
211 |
* result the SD might be offered to several plug-ins.
|
williamr@2
|
212 |
*
|
williamr@2
|
213 |
* @lib SenServConn.lib
|
williamr@2
|
214 |
* @since Series60 3.0
|
williamr@2
|
215 |
*/
|
williamr@2
|
216 |
|
williamr@2
|
217 |
class CSenServiceConnection : public CActive, public MSenFragment
|
williamr@2
|
218 |
{
|
williamr@2
|
219 |
public: // Constructors and destructor
|
williamr@2
|
220 |
|
williamr@2
|
221 |
/**
|
williamr@2
|
222 |
* Two-phased constructor intended for Identity based service
|
williamr@2
|
223 |
* consumers (like ID-WSF). The pointer is left on the cleanup stack.
|
williamr@2
|
224 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
225 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
226 |
* HandleErrorL() functions.
|
williamr@2
|
227 |
* If service is found, the SetStatus() call-back is performed
|
williamr@2
|
228 |
* with a status value KSenConnectionStatusReady (1).
|
williamr@2
|
229 |
* Contract of the service (typically some URN) is provided.
|
williamr@2
|
230 |
* Authentication for the Web Service Provider (WSP) connection
|
williamr@2
|
231 |
* is resolved using one of the identity providers which have
|
williamr@2
|
232 |
* been associated with this contract (typically an URN).
|
williamr@2
|
233 |
*
|
williamr@2
|
234 |
* This constructor is ASYNCHRONOUS and the actual state of newly
|
williamr@2
|
235 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
236 |
* HandleErrorL() functions.
|
williamr@2
|
237 |
* If service is found, a SetStatus call-back with value
|
williamr@2
|
238 |
* KSenConnectionStatusReady (1) is executed.
|
williamr@2
|
239 |
* If some error occurs, HandleErrorL() will be called to inform the
|
williamr@2
|
240 |
* creator of this connection (service consumer application)
|
williamr@2
|
241 |
*
|
williamr@2
|
242 |
* For example, if service is not found, a system wide error
|
williamr@2
|
243 |
* code of -1 is deliver via HandleErrorL() to WSC.
|
williamr@2
|
244 |
*
|
williamr@2
|
245 |
* Second example: server response HTTP 501 means, that this error
|
williamr@2
|
246 |
* code. 501 will be delivered via HandleErrorL() to WSC.
|
williamr@2
|
247 |
* This can happen in ID-WSF connection being initialized, if
|
williamr@2
|
248 |
* either Authentication Service (AS) or Discovery Service (DS)
|
williamr@2
|
249 |
* cannot be reached.
|
williamr@2
|
250 |
*
|
williamr@2
|
251 |
* @param aConsumer (web) service consumer (for call-backs)
|
williamr@2
|
252 |
* @param aContract contract of the service, typically an URI.
|
williamr@2
|
253 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
254 |
*
|
williamr@2
|
255 |
*/
|
williamr@2
|
256 |
IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
|
williamr@2
|
257 |
const TDesC8& aContract);
|
williamr@2
|
258 |
|
williamr@2
|
259 |
/**
|
williamr@2
|
260 |
* Two-phased constructor intended for Identity based service
|
williamr@2
|
261 |
* consumers (like ID-WSF).
|
williamr@2
|
262 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
263 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
264 |
* HandleErrorL() functions.
|
williamr@2
|
265 |
* If service is found, the SetStatus() call-back is performed
|
williamr@2
|
266 |
* with a status value KSenConnectionStatusReady (1).
|
williamr@2
|
267 |
* Contract of the service (typically some URN) is provided.
|
williamr@2
|
268 |
* Authentication for the Web Service Provider (WSP) connection
|
williamr@2
|
269 |
* is resolved using one of the identity providers which have
|
williamr@2
|
270 |
* been associated with this contract (typically an URN).
|
williamr@2
|
271 |
* This constructor is ASYNCHRONOUS and the actual state of newly
|
williamr@2
|
272 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
273 |
* HandleErrorL() functions.
|
williamr@2
|
274 |
* If service is found, a SetStatus call-back with value
|
williamr@2
|
275 |
* KSenConnectionStatusReady (1) is executed.
|
williamr@2
|
276 |
* If some error occurs, HandleErrorL() will be called to inform the
|
williamr@2
|
277 |
* creator of this connection (service consumer application)
|
williamr@2
|
278 |
*
|
williamr@2
|
279 |
* For example, if service is not found, a system wide error
|
williamr@2
|
280 |
* code of -1 is deliver via HandleErrorL() to WSC.
|
williamr@2
|
281 |
*
|
williamr@2
|
282 |
* Second example: server response HTTP 501 means, that this error
|
williamr@2
|
283 |
* code. 501 will be delivered via HandleErrorL() to WSC.
|
williamr@2
|
284 |
* This can happen in ID-WSF connection being initialized, if
|
williamr@2
|
285 |
* either Authentication Service (AS) or Discovery Service (DS)
|
williamr@2
|
286 |
* cannot be reached.
|
williamr@2
|
287 |
*
|
williamr@2
|
288 |
* @param aConsumer (web) service consumer (for call-backs)
|
williamr@2
|
289 |
* @param aContract contract of the service, typically an URI.
|
williamr@2
|
290 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
291 |
* The pointer is left on the cleanup stack.
|
williamr@2
|
292 |
*/
|
williamr@2
|
293 |
IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
|
williamr@2
|
294 |
const TDesC8& aContract);
|
williamr@2
|
295 |
|
williamr@2
|
296 |
/**
|
williamr@2
|
297 |
* Two-phased constructor using a service description.
|
williamr@2
|
298 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
299 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
300 |
* HandleErrorL() functions.
|
williamr@2
|
301 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
302 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
303 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
304 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
305 |
* providers which have been associated with the contract found in
|
williamr@2
|
306 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
307 |
* has to provided in the SD.
|
williamr@2
|
308 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
309 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
310 |
* @param aObserver connection observer.
|
williamr@2
|
311 |
* @param aServiceDescription is the description used to
|
williamr@2
|
312 |
* obtain a service connection.
|
williamr@2
|
313 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
314 |
*/
|
williamr@2
|
315 |
IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aObserver,
|
williamr@2
|
316 |
MSenServiceDescription& aServiceDescription);
|
williamr@2
|
317 |
|
williamr@2
|
318 |
/**
|
williamr@2
|
319 |
* Two-phased constructor using a service description. The pointer
|
williamr@2
|
320 |
* is left on the cleanup stack.
|
williamr@2
|
321 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
322 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
323 |
* HandleErrorL() functions.
|
williamr@2
|
324 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
325 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
326 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
327 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
328 |
* providers which have been associated with the contract found in
|
williamr@2
|
329 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
330 |
* has to provided in the SD.
|
williamr@2
|
331 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
332 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
333 |
* @param aObserver connection observer.
|
williamr@2
|
334 |
* @param aServiceDescription is the description used to
|
williamr@2
|
335 |
* obtain a service connection.
|
williamr@2
|
336 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
337 |
* The pointer is left on the cleanup stack.
|
williamr@2
|
338 |
*/
|
williamr@2
|
339 |
IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
|
williamr@2
|
340 |
MSenServiceDescription& aServiceDescription);
|
williamr@2
|
341 |
|
williamr@2
|
342 |
/*
|
williamr@2
|
343 |
* The ServicePattern version of two phased constructor.
|
williamr@2
|
344 |
* Note, that this method is intended to be used by service consumers
|
williamr@2
|
345 |
* wishing to initialize connection in specific context called
|
williamr@2
|
346 |
* consumer policy. In consumer policy, certain properties
|
williamr@2
|
347 |
* can be set to further define what kind of connection is acceptable
|
williamr@2
|
348 |
* and how the connection interacts with transport (for example, which
|
williamr@2
|
349 |
* Internet Access Point (IAP) will be used).
|
williamr@2
|
350 |
* However, any ConsumerPolicy feature is applicable in
|
williamr@2
|
351 |
* one-policy-per-client scope and not used as a common policy.
|
williamr@2
|
352 |
* To set permanent information about known WSP, please use the
|
williamr@2
|
353 |
* CSenXmlServiceDescription, which implements MSenProviderPolicy
|
williamr@2
|
354 |
* interface.
|
williamr@2
|
355 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
356 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
357 |
* HandleErrorL() functions.
|
williamr@2
|
358 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
359 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
360 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
361 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
362 |
* providers which have been associated with the contract found in
|
williamr@2
|
363 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
364 |
* has to provided in the SD.
|
williamr@2
|
365 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
366 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
367 |
* @param aObserver connection observer.
|
williamr@2
|
368 |
* @param aServiceDescription is the description used to
|
williamr@2
|
369 |
* obtain a service connection.
|
williamr@2
|
370 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
371 |
*/
|
williamr@2
|
372 |
IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aObserver,
|
williamr@2
|
373 |
CSenServicePattern& aServicePattern);
|
williamr@2
|
374 |
|
williamr@2
|
375 |
/*
|
williamr@2
|
376 |
* The ServicePattern version of two phased constructor.
|
williamr@2
|
377 |
* Note, that this method is intended to be used by service consumers
|
williamr@2
|
378 |
* wishing to initialize connection in specific context called
|
williamr@2
|
379 |
* consumer policy. In consumer policy, certain properties
|
williamr@2
|
380 |
* can be set to further define what kind of connection is acceptable
|
williamr@2
|
381 |
* and how the connection interacts with transport (for example, which
|
williamr@2
|
382 |
* Internet Access Point (IAP) will be used).
|
williamr@2
|
383 |
* However, any ConsumerPolicy feature is applicable in
|
williamr@2
|
384 |
* one-policy-per-client scope and not used as a common policy.
|
williamr@2
|
385 |
* To set permanent information about known WSP, please use the
|
williamr@2
|
386 |
* CSenXmlServiceDescription, which implements MSenProviderPolicy
|
williamr@2
|
387 |
* interface.
|
williamr@2
|
388 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
389 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
390 |
* HandleErrorL() functions.
|
williamr@2
|
391 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
392 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
393 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
394 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
395 |
* providers which have been associated with the contract found in
|
williamr@2
|
396 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
397 |
* has to provided in the SD.
|
williamr@2
|
398 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
399 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
400 |
* @param aObserver connection observer.
|
williamr@2
|
401 |
* @param aServiceDescription is the description used to
|
williamr@2
|
402 |
* obtain a service connection.
|
williamr@2
|
403 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
404 |
* The pointer is left on the cleanup stack.
|
williamr@2
|
405 |
*/
|
williamr@2
|
406 |
IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
|
williamr@2
|
407 |
CSenServicePattern& aServicePattern);
|
williamr@2
|
408 |
|
williamr@2
|
409 |
/**
|
williamr@2
|
410 |
* Two-phased constructor intended for Identity based service
|
williamr@2
|
411 |
* consumers (like ID-WSF). The pointer is left on the cleanup stack.
|
williamr@2
|
412 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
413 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
414 |
* HandleErrorL() functions.
|
williamr@2
|
415 |
* If service is found, the SetStatus() call-back is performed
|
williamr@2
|
416 |
* with a status value KSenConnectionStatusReady (1).
|
williamr@2
|
417 |
* Contract of the service (typically some URN) is provided.
|
williamr@2
|
418 |
* Authentication for the Web Service Provider (WSP) connection
|
williamr@2
|
419 |
* is resolved using one of the identity providers which have
|
williamr@2
|
420 |
* been associated with this contract (typically an URN).
|
williamr@2
|
421 |
*
|
williamr@2
|
422 |
* This constructor is ASYNCHRONOUS and the actual state of newly
|
williamr@2
|
423 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
424 |
* HandleErrorL() functions.
|
williamr@2
|
425 |
* If service is found, a SetStatus call-back with value
|
williamr@2
|
426 |
* KSenConnectionStatusReady (1) is executed.
|
williamr@2
|
427 |
* If some error occurs, HandleErrorL() will be called to inform the
|
williamr@2
|
428 |
* creator of this connection (service consumer application)
|
williamr@2
|
429 |
*
|
williamr@2
|
430 |
* For example, if service is not found, a system wide error
|
williamr@2
|
431 |
* code of -1 is deliver via HandleErrorL() to WSC.
|
williamr@2
|
432 |
*
|
williamr@2
|
433 |
* Second example: server response HTTP 501 means, that this error
|
williamr@2
|
434 |
* code. 501 will be delivered via HandleErrorL() to WSC.
|
williamr@2
|
435 |
* This can happen in ID-WSF connection being initialized, if
|
williamr@2
|
436 |
* either Authentication Service (AS) or Discovery Service (DS)
|
williamr@2
|
437 |
* cannot be reached.
|
williamr@2
|
438 |
*
|
williamr@2
|
439 |
* @param aConsumer (web) service consumer (for call-backs)
|
williamr@2
|
440 |
* @param aContract contract of the service, typically an URI.
|
williamr@2
|
441 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
442 |
* @param aAuthProvider Authentication Provider
|
williamr@2
|
443 |
*/
|
williamr@2
|
444 |
IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
|
williamr@2
|
445 |
const TDesC8& aContract,
|
williamr@2
|
446 |
MSenExtendedConsumerInterface& aExtendedConsumer);
|
williamr@2
|
447 |
/**
|
williamr@2
|
448 |
* Two-phased constructor intended for Identity based service
|
williamr@2
|
449 |
* consumers (like ID-WSF).
|
williamr@2
|
450 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
451 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
452 |
* HandleErrorL() functions.
|
williamr@2
|
453 |
* If service is found, the SetStatus() call-back is performed
|
williamr@2
|
454 |
* with a status value KSenConnectionStatusReady (1).
|
williamr@2
|
455 |
* Contract of the service (typically some URN) is provided.
|
williamr@2
|
456 |
* Authentication for the Web Service Provider (WSP) connection
|
williamr@2
|
457 |
* is resolved using one of the identity providers which have
|
williamr@2
|
458 |
* been associated with this contract (typically an URN).
|
williamr@2
|
459 |
* This constructor is ASYNCHRONOUS and the actual state of newly
|
williamr@2
|
460 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
461 |
* HandleErrorL() functions.
|
williamr@2
|
462 |
* If service is found, a SetStatus call-back with value
|
williamr@2
|
463 |
* KSenConnectionStatusReady (1) is executed.
|
williamr@2
|
464 |
* If some error occurs, HandleErrorL() will be called to inform the
|
williamr@2
|
465 |
* creator of this connection (service consumer application)
|
williamr@2
|
466 |
*
|
williamr@2
|
467 |
* For example, if service is not found, a system wide error
|
williamr@2
|
468 |
* code of -1 is deliver via HandleErrorL() to WSC.
|
williamr@2
|
469 |
*
|
williamr@2
|
470 |
* Second example: server response HTTP 501 means, that this error
|
williamr@2
|
471 |
* code. 501 will be delivered via HandleErrorL() to WSC.
|
williamr@2
|
472 |
* This can happen in ID-WSF connection being initialized, if
|
williamr@2
|
473 |
* either Authentication Service (AS) or Discovery Service (DS)
|
williamr@2
|
474 |
* cannot be reached.
|
williamr@2
|
475 |
*
|
williamr@2
|
476 |
* @param aConsumer (web) service consumer (for call-backs)
|
williamr@2
|
477 |
* @param aContract contract of the service, typically an URI.
|
williamr@2
|
478 |
* @param aAuthProvider Authentication Provider
|
williamr@2
|
479 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
480 |
* The pointer is left on the cleanup stack.
|
williamr@2
|
481 |
*/
|
williamr@2
|
482 |
IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
|
williamr@2
|
483 |
const TDesC8& aContract,
|
williamr@2
|
484 |
MSenExtendedConsumerInterface& aExtendedConsumer);
|
williamr@2
|
485 |
|
williamr@2
|
486 |
/**
|
williamr@2
|
487 |
* Two-phased constructor using a service description.
|
williamr@2
|
488 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
489 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
490 |
* HandleErrorL() functions.
|
williamr@2
|
491 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
492 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
493 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
494 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
495 |
* providers which have been associated with the contract found in
|
williamr@2
|
496 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
497 |
* has to provided in the SD.
|
williamr@2
|
498 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
499 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
500 |
* @param aConsumer connection observer.
|
williamr@2
|
501 |
* @param aServiceDescription is the description used to
|
williamr@2
|
502 |
* obtain a service connection.
|
williamr@2
|
503 |
* @param aAuthProvider Authentication Provider
|
williamr@2
|
504 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
505 |
*/
|
williamr@2
|
506 |
IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
|
williamr@2
|
507 |
MSenServiceDescription& aServiceDescription,
|
williamr@2
|
508 |
MSenExtendedConsumerInterface& aExtendedConsumer);
|
williamr@2
|
509 |
|
williamr@2
|
510 |
/**
|
williamr@2
|
511 |
* Two-phased constructor using a service description. The pointer
|
williamr@2
|
512 |
* is left on the cleanup stack.
|
williamr@2
|
513 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
514 |
* created connection has to be observed from SetStatus() AND
|
williamr@2
|
515 |
* HandleErrorL() functions.
|
williamr@2
|
516 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
517 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
518 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
519 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
520 |
* providers which have been associated with the contract found in
|
williamr@2
|
521 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
522 |
* has to provided in the SD.
|
williamr@2
|
523 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
524 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
525 |
* @param aConsumer connection observer.
|
williamr@2
|
526 |
* @param aServiceDescription is the description used to
|
williamr@2
|
527 |
* obtain a service connection.
|
williamr@2
|
528 |
* @param aAuthProvider Authentication Provider
|
williamr@2
|
529 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
530 |
* The pointer is left on the cleanup stack.
|
williamr@2
|
531 |
*/
|
williamr@2
|
532 |
IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
|
williamr@2
|
533 |
MSenServiceDescription& aServiceDescription,
|
williamr@2
|
534 |
MSenExtendedConsumerInterface& aExtendedConsumer);
|
williamr@2
|
535 |
|
williamr@2
|
536 |
/*
|
williamr@2
|
537 |
* The ServicePattern version of two phased constructor.
|
williamr@2
|
538 |
* Note, that this method is intended to be used by service consumers
|
williamr@2
|
539 |
* wishing to initialize connection in specific context called
|
williamr@2
|
540 |
* consumer policy. In consumer policy, certain properties
|
williamr@2
|
541 |
* can be set to further define what kind of connection is acceptable
|
williamr@2
|
542 |
* and how the connection interacts with transport (for example, which
|
williamr@2
|
543 |
* Internet Access Point (IAP) will be used).
|
williamr@2
|
544 |
* However, any ConsumerPolicy feature is applicable in
|
williamr@2
|
545 |
* one-policy-per-client scope and not used as a common policy.
|
williamr@2
|
546 |
* To set permanent information about known WSP, please use the
|
williamr@2
|
547 |
* CSenXmlServiceDescription, which implements MSenProviderPolicy
|
williamr@2
|
548 |
* interface.
|
williamr@2
|
549 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
550 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
551 |
* HandleErrorL() functions.
|
williamr@2
|
552 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
553 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
554 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
555 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
556 |
* providers which have been associated with the contract found in
|
williamr@2
|
557 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
558 |
* has to provided in the SD.
|
williamr@2
|
559 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
560 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
561 |
* @param aConsumer connection observer.
|
williamr@2
|
562 |
* @param aServiceDescription is the description used to
|
williamr@2
|
563 |
* obtain a service connection.
|
williamr@2
|
564 |
* @param aAuthProvider Authentication Provider
|
williamr@2
|
565 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
566 |
*/
|
williamr@2
|
567 |
IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
|
williamr@2
|
568 |
CSenServicePattern& aServicePattern,
|
williamr@2
|
569 |
MSenExtendedConsumerInterface& aExtendedConsumer);
|
williamr@2
|
570 |
|
williamr@2
|
571 |
/*
|
williamr@2
|
572 |
* The ServicePattern version of two phased constructor.
|
williamr@2
|
573 |
* Note, that this method is intended to be used by service consumers
|
williamr@2
|
574 |
* wishing to initialize connection in specific context called
|
williamr@2
|
575 |
* consumer policy. In consumer policy, certain properties
|
williamr@2
|
576 |
* can be set to further define what kind of connection is acceptable
|
williamr@2
|
577 |
* and how the connection interacts with transport (for example, which
|
williamr@2
|
578 |
* Internet Access Point (IAP) will be used).
|
williamr@2
|
579 |
* However, any ConsumerPolicy feature is applicable in
|
williamr@2
|
580 |
* one-policy-per-client scope and not used as a common policy.
|
williamr@2
|
581 |
* To set permanent information about known WSP, please use the
|
williamr@2
|
582 |
* CSenXmlServiceDescription, which implements MSenProviderPolicy
|
williamr@2
|
583 |
* interface.
|
williamr@2
|
584 |
* This constructor is ASYNCHRONOUS and the actual state of
|
williamr@2
|
585 |
* created connection has to be observed from SetStatus() and
|
williamr@2
|
586 |
* HandleErrorL() functions.
|
williamr@2
|
587 |
* If service is found, the SetStatus() call-back is executed
|
williamr@2
|
588 |
* with a status value KSenConnectionStatusReady (1)
|
williamr@2
|
589 |
* For ID-WSF connections, the authentication for the Web Service
|
williamr@2
|
590 |
* Provider (WSP) connection is resolved using one of the identity
|
williamr@2
|
591 |
* providers which have been associated with the contract found in
|
williamr@2
|
592 |
* the SD. At minimum, the contract of the service (typically some URN)
|
williamr@2
|
593 |
* has to provided in the SD.
|
williamr@2
|
594 |
* Basic Web Service consumers instantiate a SD where an endpoint
|
williamr@2
|
595 |
* and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
williamr@2
|
596 |
* @param aConsumer connection observer.
|
williamr@2
|
597 |
* @param aServiceDescription is the description used to
|
williamr@2
|
598 |
* obtain a service connection.
|
williamr@2
|
599 |
* @param aAuthProvider Authentication Provider
|
williamr@2
|
600 |
* @return a pointer to a CSenServiceConnection instance.
|
williamr@2
|
601 |
* The pointer is left on the cleanup stack.
|
williamr@2
|
602 |
*/
|
williamr@2
|
603 |
IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
|
williamr@2
|
604 |
CSenServicePattern& aServicePattern,
|
williamr@2
|
605 |
MSenExtendedConsumerInterface& aExtendedConsumer);
|
williamr@2
|
606 |
|
williamr@2
|
607 |
// New functions
|
williamr@2
|
608 |
|
williamr@2
|
609 |
/**
|
williamr@2
|
610 |
* Send an ASYNCHRONOUS request to a service.
|
williamr@2
|
611 |
* In ID-WSF, the request data is a SOAP Body.
|
williamr@2
|
612 |
* Response message is received either via
|
williamr@2
|
613 |
* HandleMessageL() or HandleErrorL() callback.
|
williamr@2
|
614 |
* There are two default frameworks available -
|
williamr@2
|
615 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
616 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
617 |
* Please note, that Basic Web Services framework does NOT support this method.
|
williamr@2
|
618 |
* Instead, one should send complete SOAP envelopes using SendL(CSenSoapEnvelope&).
|
williamr@2
|
619 |
* So, currently this method is supported only in ID-WSF.
|
williamr@2
|
620 |
* @param aRequest outgoing request message.
|
williamr@2
|
621 |
* @return Transaction ID (positive integer) or error code, if method fails.
|
williamr@2
|
622 |
* Transaction ids:
|
williamr@2
|
623 |
* Positive integers SendL returns transaction ID of the request,
|
williamr@2
|
624 |
* which can be later on utilized inside
|
williamr@2
|
625 |
* HandleMessageL and HandleErrorL methods,
|
williamr@2
|
626 |
* in order to map request and its response
|
williamr@2
|
627 |
* together.
|
williamr@2
|
628 |
* Error codes:
|
williamr@2
|
629 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
630 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
631 |
* request.
|
williamr@2
|
632 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
633 |
* cannot yet process commands.
|
williamr@2
|
634 |
* KErrConnectionExpired Credential for the connection is
|
williamr@2
|
635 |
* expired and needs to be renewed.
|
williamr@2
|
636 |
* This can be done by instantiating a new
|
williamr@2
|
637 |
* ServiceConnection.
|
williamr@2
|
638 |
* KErrSubmitting An error occurred
|
williamr@2
|
639 |
* KErrNoMemory Not enough memory to process the message.
|
williamr@2
|
640 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
641 |
*/
|
williamr@2
|
642 |
virtual TInt SendL(const TDesC8& aRequest) = 0;
|
williamr@2
|
643 |
|
williamr@2
|
644 |
|
williamr@2
|
645 |
/**
|
williamr@2
|
646 |
* Submit a synchronous request to a service
|
williamr@2
|
647 |
* (in ID-WSF, the SOAP message Body) and receive a response as XML.
|
williamr@2
|
648 |
* There are two default frameworks available -
|
williamr@2
|
649 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
650 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
651 |
* Please note, that Basic Web Services framework does NOT support this method.
|
williamr@2
|
652 |
* Instead, one must send complete SOAP envelopes using SubmitL(CSenSoapEnvelope&).
|
williamr@2
|
653 |
* So, currently this method is supported only in ID-WSF.
|
williamr@2
|
654 |
* @param aRequest outgoing request message.
|
williamr@2
|
655 |
* @param aResponse the resolved response message.
|
williamr@2
|
656 |
* The ownership of the aResponse is transfered to the caller.
|
williamr@2
|
657 |
* The response is service specific part of the response.
|
williamr@2
|
658 |
* For ID-WSF services response contents is the SOAP Body, or complete SOAP
|
williamr@2
|
659 |
* envelope as XML, depending on the complete server messages on/off setting
|
williamr@2
|
660 |
* (default is off).
|
williamr@2
|
661 |
* @return status/error code.
|
williamr@2
|
662 |
* Status codes:
|
williamr@2
|
663 |
* KErrNone ok
|
williamr@2
|
664 |
* Error codes:
|
williamr@2
|
665 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
666 |
* KErrSenServiceConnectionBusy Connection is already busy with another request.
|
williamr@2
|
667 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
668 |
* cannot yet process commands.
|
williamr@2
|
669 |
* KErrConnectionExpired Credential for the connection is
|
williamr@2
|
670 |
* expired and needs to be renewed.
|
williamr@2
|
671 |
* This can be done by instantiating a new
|
williamr@2
|
672 |
* ServiceConnection.
|
williamr@2
|
673 |
* KErrSubmitting An internal error occurred.
|
williamr@2
|
674 |
* KErrSenInternal Internal state is invalid.
|
williamr@2
|
675 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
676 |
*/
|
williamr@2
|
677 |
virtual TInt SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) = 0;
|
williamr@2
|
678 |
|
williamr@2
|
679 |
|
williamr@2
|
680 |
/**
|
williamr@2
|
681 |
* Consumer application can use this method to check that
|
williamr@2
|
682 |
* service connection is in ready state.
|
williamr@2
|
683 |
* In ID-WSF, this means that WSF interprets that credentials
|
williamr@2
|
684 |
* for the service connection are valid (not expired).
|
williamr@2
|
685 |
* @param aReady indicates that the connection is ready to be used.
|
williamr@2
|
686 |
* @return status/error code.
|
williamr@2
|
687 |
* Status codes:
|
williamr@2
|
688 |
* KErrNone ok
|
williamr@2
|
689 |
* Error codes are system-wide Symbian error codes.
|
williamr@2
|
690 |
*/
|
williamr@2
|
691 |
virtual TInt IsReady(TBool& aReady) = 0;
|
williamr@2
|
692 |
|
williamr@2
|
693 |
|
williamr@2
|
694 |
/**
|
williamr@2
|
695 |
* Check if the underlying service connection has a certain characteristic
|
williamr@2
|
696 |
* called a facet.
|
williamr@2
|
697 |
* Currently, only ID-WSF framework supports facets.
|
williamr@2
|
698 |
* For example, if consumer application is interested to resolve if
|
williamr@2
|
699 |
* initialized service connection has a facet indicating that service
|
williamr@2
|
700 |
* is free of charge (for e.g. "urn:framework.com.free:cost"), the
|
williamr@2
|
701 |
* method used to check this would be:
|
williamr@2
|
702 |
* _LIT8(KFacetOfFreeService, "urn:some.service.free:cost");
|
williamr@2
|
703 |
* int err = HasFacetL(KFacetOfFreeService, hasFacet);
|
williamr@2
|
704 |
*
|
williamr@2
|
705 |
* In the service session of initialed connection, this would be the form
|
williamr@2
|
706 |
* of the facet element:
|
williamr@2
|
707 |
* <Facet name="urn:framework.com.free:cost"/>
|
williamr@2
|
708 |
*
|
williamr@2
|
709 |
* If there is no facet in the service connection then the element is not
|
williamr@2
|
710 |
* present.
|
williamr@2
|
711 |
* @param aURI the name of the facet
|
williamr@2
|
712 |
* @param aHasFacet will indicate if underlying service has a certain
|
williamr@2
|
713 |
* characteristic.
|
williamr@2
|
714 |
* @return status/error code.
|
williamr@2
|
715 |
* Status codes:
|
williamr@2
|
716 |
* KErrNone ok
|
williamr@2
|
717 |
* Error codes:
|
williamr@2
|
718 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
719 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
720 |
* cannot yet process commands.
|
williamr@2
|
721 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
722 |
* renewed.
|
williamr@2
|
723 |
* KErrBadDescriptor The aUri parameter was an invalid
|
williamr@2
|
724 |
* descriptor.
|
williamr@2
|
725 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
726 |
*/
|
williamr@2
|
727 |
virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) = 0;
|
williamr@2
|
728 |
|
williamr@2
|
729 |
|
williamr@2
|
730 |
/**
|
williamr@2
|
731 |
* Consumer application can use this method to set flag which defines
|
williamr@2
|
732 |
* whether or not the consumer wishes to receive complete SOAP envelope
|
williamr@2
|
733 |
* from the service.
|
williamr@2
|
734 |
* If complete server messages mode is off, then only the <Body> element
|
williamr@2
|
735 |
* is received from the SOAP envelope, otherwise full SOAP envelope.
|
williamr@2
|
736 |
* Note: Calling this function must not be done before connection is
|
williamr@2
|
737 |
* initialized (the observer's SetStatus() has been called with value
|
williamr@2
|
738 |
* KSenConnectionStatusReady).
|
williamr@2
|
739 |
* Calling this function should be done before sending or submitting
|
williamr@2
|
740 |
* anything.
|
williamr@2
|
741 |
* @param aCompleteOnOff defines the content of HandleMessageL() callback.
|
williamr@2
|
742 |
* If set to ETrue (ON), then complete SOAP envelopes are
|
williamr@2
|
743 |
* received, including <Header> element.
|
williamr@2
|
744 |
* If set to EFalse (OFF), only the service specific
|
williamr@2
|
745 |
* content - SOAP envelope <Body> element - is received.
|
williamr@2
|
746 |
* In WSF frameworks the default settings are:
|
williamr@2
|
747 |
* 1. In ID-WSF, the complete server messages is OFF.
|
williamr@2
|
748 |
* 2. In Basic Web Services, the default is ON.
|
williamr@2
|
749 |
* @return status/error code.
|
williamr@2
|
750 |
* Status codes:
|
williamr@2
|
751 |
* KErrNone ok
|
williamr@2
|
752 |
* Error codes:
|
williamr@2
|
753 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
754 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
755 |
* cannot yet process commands.
|
williamr@2
|
756 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
757 |
* renewed.
|
williamr@2
|
758 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
759 |
*/
|
williamr@2
|
760 |
virtual TInt CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) = 0;
|
williamr@2
|
761 |
|
williamr@2
|
762 |
|
williamr@2
|
763 |
/*
|
williamr@2
|
764 |
* Sends a SOAP message to the service. The SOAP envelope may contain
|
williamr@2
|
765 |
* proprietary headers. The system will augment the message with the
|
williamr@2
|
766 |
* appropriate headers specified in the service invocation framework,
|
williamr@2
|
767 |
* so a client application should add only non-standard headers; and
|
williamr@2
|
768 |
* if it doesn't need to set such headers it is strongly recommended
|
williamr@2
|
769 |
* to use SendL(TDesC8&), which is meant for that.
|
williamr@2
|
770 |
* This is an asynchronous function, that returns immediately.
|
williamr@2
|
771 |
* When the service responds, the SOAP envelope content will
|
williamr@2
|
772 |
* be received via HandleMessageL() callback. In case of an
|
williamr@2
|
773 |
* error - like a SOAP fault - HandleErrorL() will be called
|
williamr@2
|
774 |
* with appropriate error code.
|
williamr@2
|
775 |
* There are two default frameworks available -
|
williamr@2
|
776 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
777 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
778 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@2
|
779 |
* Instead, one should send SOAP envelope Bodies using
|
williamr@2
|
780 |
* SendL(const TDesC8&).
|
williamr@2
|
781 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@2
|
782 |
* @param aMessage The service specific message - a full SOAP envelope
|
williamr@2
|
783 |
* @return Transaction ID (positive integer) or error code, if method fails.
|
williamr@2
|
784 |
* Transaction ids:
|
williamr@2
|
785 |
* Positive integers SendL returns transaction ID of the request,
|
williamr@2
|
786 |
* which can be later on utilized inside
|
williamr@2
|
787 |
* HandleMessageL and HandleErrorL methods,
|
williamr@2
|
788 |
* in order to map request and its response
|
williamr@2
|
789 |
* together.
|
williamr@2
|
790 |
* Error codes:
|
williamr@2
|
791 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
792 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
793 |
* request.
|
williamr@2
|
794 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
795 |
* cannot yet process commands.
|
williamr@2
|
796 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
797 |
* renewed.
|
williamr@2
|
798 |
* KErrSubmitting An internal error has occurred.
|
williamr@2
|
799 |
* KErrNoMemory Not enough memory to process the
|
williamr@2
|
800 |
* message.
|
williamr@2
|
801 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
802 |
*/
|
williamr@2
|
803 |
virtual TInt SendL(CSenSoapEnvelope& aMessage) = 0;
|
williamr@2
|
804 |
|
williamr@2
|
805 |
|
williamr@2
|
806 |
/*
|
williamr@2
|
807 |
* Submits a SOAP message to the service. This is a synchronous call,
|
williamr@2
|
808 |
* returning a SOAP envelope that was received from the service.
|
williamr@2
|
809 |
* There are two default frameworks available:
|
williamr@2
|
810 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
811 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
812 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@2
|
813 |
* Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
|
williamr@2
|
814 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@2
|
815 |
* @param aMessage SOAPEnvelope with the service specific message
|
williamr@2
|
816 |
* without any framework wrapping
|
williamr@2
|
817 |
* @param aResponseTo This is a ref-to-pointer where response
|
williamr@2
|
818 |
* from the service will be allocated. If the
|
williamr@2
|
819 |
* complete server messages mode is set to OFF,
|
williamr@2
|
820 |
* then only <Body> element will be returned,
|
williamr@2
|
821 |
* otherwise a complete SOAP envelope.
|
williamr@2
|
822 |
* The ownership of aResponse is transfered to
|
williamr@2
|
823 |
* the caller.
|
williamr@2
|
824 |
* @return status/error code
|
williamr@2
|
825 |
* Status codes:
|
williamr@2
|
826 |
* KErrNone ok
|
williamr@2
|
827 |
* Error codes:
|
williamr@2
|
828 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
829 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
830 |
* request.
|
williamr@2
|
831 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
832 |
* cannot yet process commands.
|
williamr@2
|
833 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
834 |
* renewed.
|
williamr@2
|
835 |
* KErrSubmitting An internal error has occurred.
|
williamr@2
|
836 |
* KErrNoMemory Not enough memory to process the
|
williamr@2
|
837 |
* message.
|
williamr@2
|
838 |
* KErrSenInternal Internal state is invalid.
|
williamr@2
|
839 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
840 |
*/
|
williamr@2
|
841 |
virtual TInt SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) = 0;
|
williamr@2
|
842 |
|
williamr@2
|
843 |
|
williamr@2
|
844 |
/**
|
williamr@2
|
845 |
* Gets service description of current connection.
|
williamr@2
|
846 |
* @param aServiceDescription Contains the service description on return
|
williamr@2
|
847 |
* @return status/error code.
|
williamr@2
|
848 |
* Status codes:
|
williamr@2
|
849 |
* KErrNone ok
|
williamr@2
|
850 |
* Error codes:
|
williamr@2
|
851 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
852 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
853 |
* request.
|
williamr@2
|
854 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
855 |
* cannot yet process commands.
|
williamr@2
|
856 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
857 |
* renewed.
|
williamr@2
|
858 |
* KErrUnderFlow Server side returned invalid service
|
williamr@2
|
859 |
* description.
|
williamr@2
|
860 |
* KErrUnknown Client-Server request mismatch.
|
williamr@2
|
861 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
862 |
*/
|
williamr@2
|
863 |
virtual TInt ServiceDescriptionL(HBufC8*& aServiceDescription) = 0;
|
williamr@2
|
864 |
|
williamr@2
|
865 |
|
williamr@2
|
866 |
/**
|
williamr@2
|
867 |
* Starts an application level transaction. The consumer may now start
|
williamr@2
|
868 |
* to communicate with some service withing a chain of correlated messages.
|
williamr@2
|
869 |
* When responding to a certain SOAP message inside a transaction, the last
|
williamr@2
|
870 |
* received message ID is used as "refToMessageId".
|
williamr@2
|
871 |
* From default frameworks, only ID-WSF supports transactions.
|
williamr@2
|
872 |
* @return KErrNone if no errors occur.
|
williamr@2
|
873 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
874 |
*/
|
williamr@2
|
875 |
virtual TInt StartTransaction() = 0;
|
williamr@2
|
876 |
|
williamr@2
|
877 |
|
williamr@2
|
878 |
/**
|
williamr@2
|
879 |
* Stops application level transaction by resetting the "refToMessageId".
|
williamr@2
|
880 |
* After stopping a transaction the next message will have no
|
williamr@2
|
881 |
* "refToMessageId"
|
williamr@2
|
882 |
* @return KErrNone if no errors occur.
|
williamr@2
|
883 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
884 |
*/
|
williamr@2
|
885 |
virtual TInt TransactionCompleted() = 0;
|
williamr@2
|
886 |
|
williamr@2
|
887 |
|
williamr@2
|
888 |
/*
|
williamr@2
|
889 |
* Returns the transasction ID of this message or error. Id is guaranteed
|
williamr@2
|
890 |
* to return unique ID when called from inside HandleMessageL() or
|
williamr@2
|
891 |
* HandleErrorL callback. This transasction ID may be used to map the
|
williamr@2
|
892 |
* response with the preceedeing SendL() call (a request).
|
williamr@2
|
893 |
* @return TInt transaction ID, or KErrNotFound, if no transaction is
|
williamr@2
|
894 |
* on-going.
|
williamr@2
|
895 |
*/
|
williamr@2
|
896 |
virtual TInt TxnId() = 0;
|
williamr@2
|
897 |
|
williamr@2
|
898 |
|
williamr@2
|
899 |
/**
|
williamr@2
|
900 |
* Sets transport specific properties which apply as long as this connection
|
williamr@2
|
901 |
* is alive (session). Furthermore, the properties are effective for this session
|
williamr@2
|
902 |
* in cumulative manner: each property has unique key (name) which is associated
|
williamr@2
|
903 |
* to the actual value of that property. When SetTransportPropertiesL method is
|
williamr@2
|
904 |
* called multiple times - in sequence - the last value for each key overrides any
|
williamr@2
|
905 |
* previous definitions. If any latter call introduces new keys (property names),
|
williamr@2
|
906 |
* they are appended to the list of currently effective properties.
|
williamr@2
|
907 |
* Also note, that it is also possible to set message specific properties when making
|
williamr@2
|
908 |
* a SendL/SubmitL call. If such transport properties for message are provided, and
|
williamr@2
|
909 |
* those include updates to some properties, the new ones are effective only for that
|
williamr@2
|
910 |
* certain message, i.e. those are transaction specific. For any following message,
|
williamr@2
|
911 |
* that is sent over a service connection, the session specific properties apply,
|
williamr@2
|
912 |
* assuming that the new message does not (again) override some of the property values.
|
williamr@2
|
913 |
* @param aProperties contains the transport properties in serialized (UTF-8) form.
|
williamr@2
|
914 |
* With HTTP, this descriptor is typically created by utilizing CSenHttpProperties class.
|
williamr@2
|
915 |
* @return KErrNone if successful or otherwise some system-wide error code.
|
williamr@2
|
916 |
*/
|
williamr@2
|
917 |
virtual TInt SetTransportPropertiesL(const TDesC8& aProperties) = 0;
|
williamr@2
|
918 |
|
williamr@2
|
919 |
|
williamr@2
|
920 |
/*
|
williamr@2
|
921 |
* Method returns currently effective transport properties as a serialized
|
williamr@2
|
922 |
* descriptor. With HTTP, one may utilize CSenHttpProperities class in
|
williamr@2
|
923 |
* order to read this data into properties object. Note that returned
|
williamr@2
|
924 |
* list of properties also includes properties, which are defined as default
|
williamr@2
|
925 |
* for certain transport in the webservice framework.
|
williamr@2
|
926 |
*/
|
williamr@2
|
927 |
virtual TInt TransportPropertiesL(HBufC8*& aProperties) = 0;
|
williamr@2
|
928 |
|
williamr@2
|
929 |
|
williamr@2
|
930 |
/**
|
williamr@2
|
931 |
* Send an ASYNCHRONOUS request to a service.
|
williamr@2
|
932 |
* In ID-WSF, the request data is a SOAP Body.
|
williamr@2
|
933 |
* Response message is received either via
|
williamr@2
|
934 |
* HandleMessageL() or HandleErrorL() callback.
|
williamr@2
|
935 |
* There are two default frameworks available -
|
williamr@2
|
936 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
937 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
938 |
* Please note, that Basic Web Services framework does NOT support this method.
|
williamr@2
|
939 |
* Instead, one should send complete SOAP envelopes using SendL(CSenSoapEnvelope&).
|
williamr@2
|
940 |
* So, currently this method is supported only in ID-WSF.
|
williamr@2
|
941 |
* @param aRequest outgoing request message.
|
williamr@2
|
942 |
* @param aProperties contains transport spesific properties, serialized
|
williamr@2
|
943 |
* into descriptor. With HTTP, one can create this by utilizing specialized
|
williamr@2
|
944 |
* CSenHttpProperties class.
|
williamr@2
|
945 |
* @return Transaction ID (positive integer) or error code, if method fails.
|
williamr@2
|
946 |
* Transaction ids:
|
williamr@2
|
947 |
* Positive integers SendL returns transaction ID of the request,
|
williamr@2
|
948 |
* which can be later on utilized inside
|
williamr@2
|
949 |
* HandleMessageL and HandleErrorL methods,
|
williamr@2
|
950 |
* in order to map request and its response
|
williamr@2
|
951 |
* together.
|
williamr@2
|
952 |
* Error codes
|
williamr@2
|
953 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
954 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
955 |
* request.
|
williamr@2
|
956 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
957 |
* cannot yet process commands.
|
williamr@2
|
958 |
* KErrConnectionExpired Credential for the connection is
|
williamr@2
|
959 |
* expired and needs to be renewed.
|
williamr@2
|
960 |
* This can be done by instantiating a new
|
williamr@2
|
961 |
* ServiceConnection.
|
williamr@2
|
962 |
* KErrSubmitting An error occurred
|
williamr@2
|
963 |
* KErrNoMemory Not enough memory to process the message.
|
williamr@2
|
964 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
965 |
*/
|
williamr@2
|
966 |
virtual TInt SendL(const TDesC8& aRequest, const TDesC8& aProperties) = 0;
|
williamr@2
|
967 |
|
williamr@2
|
968 |
|
williamr@2
|
969 |
/**
|
williamr@2
|
970 |
* Submit a request via SYNCHRONOUS call to a service
|
williamr@2
|
971 |
* (in ID-WSF, the SOAP message Body) and receive a response as XML.
|
williamr@2
|
972 |
* There are two default frameworks available -
|
williamr@2
|
973 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
974 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
975 |
* Please note, that Basic Web Services framework does NOT support this method.
|
williamr@2
|
976 |
* Instead, one must send complete SOAP envelopes using SubmitL(CSenSoapEnvelope&).
|
williamr@2
|
977 |
* So, currently this method is supported only in ID-WSF.
|
williamr@2
|
978 |
* @param aRequest outgoing request message.
|
williamr@2
|
979 |
* @param aResponse the resolved response message.
|
williamr@2
|
980 |
* The ownership of the aResponse is transfered to the caller.
|
williamr@2
|
981 |
* The response is service specific part of the response.
|
williamr@2
|
982 |
* For ID-WSF services response contents is the SOAP Body, or complete SOAP
|
williamr@2
|
983 |
* envelope as XML, depending on the complete server messages on/off setting
|
williamr@2
|
984 |
* (default is off).
|
williamr@2
|
985 |
* @param aProperties contains transport spesific properties, serialized
|
williamr@2
|
986 |
* into descriptor. With HTTP, one can create this by utilizing specialized
|
williamr@2
|
987 |
* CSenHttpProperties class.
|
williamr@2
|
988 |
* @return status/error code.
|
williamr@2
|
989 |
* Status codes:
|
williamr@2
|
990 |
* KErrNone ok
|
williamr@2
|
991 |
* Error codes:
|
williamr@2
|
992 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
993 |
* KErrSenServiceConnectionBusy Connection is already busy with another request.
|
williamr@2
|
994 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
995 |
* cannot yet process commands.
|
williamr@2
|
996 |
* KErrConnectionExpired Credential for the connection is
|
williamr@2
|
997 |
* expired and needs to be renewed.
|
williamr@2
|
998 |
* This can be done by instantiating a new
|
williamr@2
|
999 |
* ServiceConnection.
|
williamr@2
|
1000 |
* KErrSubmitting An internal error occurred.
|
williamr@2
|
1001 |
* KErrSenInternal Internal state is invalid.
|
williamr@2
|
1002 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
1003 |
*/
|
williamr@2
|
1004 |
virtual TInt SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) = 0;
|
williamr@2
|
1005 |
|
williamr@2
|
1006 |
|
williamr@2
|
1007 |
/*
|
williamr@2
|
1008 |
* Sends a SOAP message to the service. The SOAP envelope may contain
|
williamr@2
|
1009 |
* proprietary headers. The system will augment the message with the
|
williamr@2
|
1010 |
* appropriate headers specified in the service invocation framework,
|
williamr@2
|
1011 |
* so a client application should add only non-standard headers; and
|
williamr@2
|
1012 |
* if it doesn't need to set such headers it is strongly recommended
|
williamr@2
|
1013 |
* to use SendL(TDesC8&), which is meant for this.
|
williamr@2
|
1014 |
* This is an asynchronous function, that returns immediately.
|
williamr@2
|
1015 |
* When the service responds, the SOAP envelope content will
|
williamr@2
|
1016 |
* be received via HandleMessageL() callback. In case of an
|
williamr@2
|
1017 |
* error - like a SOAP fault - HandleErrorL() will be called
|
williamr@2
|
1018 |
* with appropriate error code.
|
williamr@2
|
1019 |
* There are two default frameworks available -
|
williamr@2
|
1020 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
1021 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
1022 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@2
|
1023 |
* Instead, one should send SOAP envelope Bodies using
|
williamr@2
|
1024 |
* SendL(const TDesC8&).
|
williamr@2
|
1025 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@2
|
1026 |
*
|
williamr@2
|
1027 |
* NOTE:
|
williamr@2
|
1028 |
* Message is send as serialized XML or Soap message to SendL
|
williamr@2
|
1029 |
* aProperties could be "HTTP GET" or "HTTP DELETE"
|
williamr@2
|
1030 |
* HTTP GET or HTTP DELETE transport property has been enabled via CSenHttpTransportProperties.
|
williamr@2
|
1031 |
* This scenario is not supported
|
williamr@2
|
1032 |
*
|
williamr@2
|
1033 |
* @param aMessage The service specific message - a full SOAP envelope
|
williamr@2
|
1034 |
* @param aProperties contains transport spesific properties, serialized
|
williamr@2
|
1035 |
* into descriptor. With HTTP, one can create this by utilizing specialized
|
williamr@2
|
1036 |
* CSenHttpProperties class.
|
williamr@2
|
1037 |
* @return Transaction ID (positive integer) or error code, if method fails.
|
williamr@2
|
1038 |
* Transaction ids:
|
williamr@2
|
1039 |
* Positive integers SendL returns transaction ID of the request,
|
williamr@2
|
1040 |
* which can be later on utilized inside
|
williamr@2
|
1041 |
* HandleMessageL and HandleErrorL methods,
|
williamr@2
|
1042 |
* in order to map request and its response
|
williamr@2
|
1043 |
* together.
|
williamr@2
|
1044 |
* Error codes:
|
williamr@2
|
1045 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
1046 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
1047 |
* request.
|
williamr@2
|
1048 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
1049 |
* cannot yet process commands.
|
williamr@2
|
1050 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
1051 |
* renewed.
|
williamr@2
|
1052 |
* KErrSubmitting An internal error has occurred.
|
williamr@2
|
1053 |
* KErrNoMemory Not enough memory to process the
|
williamr@2
|
1054 |
* message.
|
williamr@2
|
1055 |
* KErrNotSupported HTTP GET or HTTP DELETE is enabled
|
williamr@2
|
1056 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
1057 |
*/
|
williamr@2
|
1058 |
virtual TInt SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) = 0;
|
williamr@2
|
1059 |
|
williamr@2
|
1060 |
/*
|
williamr@2
|
1061 |
* Submits a SOAP message to the service. This is a synchronous call,
|
williamr@2
|
1062 |
* returning a SOAP envelope that was received from the service.
|
williamr@2
|
1063 |
* There are two default frameworks available:
|
williamr@2
|
1064 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
1065 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
1066 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@2
|
1067 |
* Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
|
williamr@2
|
1068 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@2
|
1069 |
*
|
williamr@2
|
1070 |
* NOTE:
|
williamr@2
|
1071 |
* Message is send as serialized XML or Soap message to SubmitL
|
williamr@2
|
1072 |
* aProperties could be "HTTP GET" or "HTTP DELETE"
|
williamr@2
|
1073 |
* HTTP GET or HTTP DELETE transport property has been enabled via CSenHttpTransportProperties.
|
williamr@2
|
1074 |
* This scenario is not supported
|
williamr@2
|
1075 |
*
|
williamr@2
|
1076 |
* @param aMessage SOAPEnvelope with the service specific message
|
williamr@2
|
1077 |
* without any framework wrapping
|
williamr@2
|
1078 |
* @param aProperties contains transport spesific properties, serialized
|
williamr@2
|
1079 |
* into descriptor. With HTTP, one can create this by utilizing specialized
|
williamr@2
|
1080 |
* CSenHttpProperties class.
|
williamr@2
|
1081 |
* @param aResponseTo This is a ref-to-pointer where response
|
williamr@2
|
1082 |
* from the service will be allocated. If the
|
williamr@2
|
1083 |
* complete server messages mode is set to OFF,
|
williamr@2
|
1084 |
* then only <Body> element will be returned,
|
williamr@2
|
1085 |
* otherwise a complete SOAP envelope.
|
williamr@2
|
1086 |
* The ownership of aResponse is transfered to
|
williamr@2
|
1087 |
* the caller.
|
williamr@2
|
1088 |
* @return status/error code
|
williamr@2
|
1089 |
* Status codes:
|
williamr@2
|
1090 |
* KErrNone ok
|
williamr@2
|
1091 |
* Error codes:
|
williamr@2
|
1092 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
1093 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
1094 |
* request.
|
williamr@2
|
1095 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
1096 |
* cannot yet process commands.
|
williamr@2
|
1097 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
1098 |
* renewed.
|
williamr@2
|
1099 |
* KErrSubmitting An internal error has occurred.
|
williamr@2
|
1100 |
* KErrNoMemory Not enough memory to process the
|
williamr@2
|
1101 |
* message.
|
williamr@2
|
1102 |
* KErrSenInternal Internal state is invalid.
|
williamr@2
|
1103 |
* KErrNotSupported HTTP GET or HTTP DELETE is enabled
|
williamr@2
|
1104 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
1105 |
*/
|
williamr@2
|
1106 |
virtual TInt SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) = 0;
|
williamr@2
|
1107 |
|
williamr@2
|
1108 |
/*
|
williamr@2
|
1109 |
* Sends a SOAP message to the service. The SOAP envelope may contain
|
williamr@2
|
1110 |
* proprietary headers. The system will augment the message with the
|
williamr@2
|
1111 |
* appropriate headers specified in the service invocation framework,
|
williamr@2
|
1112 |
* so a client application should add only non-standard headers.
|
williamr@2
|
1113 |
* This is an asynchronous function, that returns immediately.
|
williamr@2
|
1114 |
* When the service responds, the SOAP envelope content will
|
williamr@2
|
1115 |
* be received via HandleMessageL() callback. In case of an
|
williamr@2
|
1116 |
* error - like a SOAP fault - HandleErrorL() will be called
|
williamr@2
|
1117 |
* with appropriate error code.
|
williamr@2
|
1118 |
* There are two default frameworks available -
|
williamr@2
|
1119 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
1120 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
1121 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@2
|
1122 |
* Instead, one should send SOAP envelope Bodies using
|
williamr@2
|
1123 |
* SendL(const TDesC8&).
|
williamr@2
|
1124 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@2
|
1125 |
*
|
williamr@2
|
1126 |
* @param aMessage The service specific message - a full SOAP envelope
|
williamr@2
|
1127 |
* @return Transaction ID (positive integer) or error code, if method fails.
|
williamr@2
|
1128 |
* Transaction ids:
|
williamr@2
|
1129 |
* Positive integers SendL returns transaction ID of the request,
|
williamr@2
|
1130 |
* which can be later on utilized inside
|
williamr@2
|
1131 |
* HandleMessageL and HandleErrorL methods,
|
williamr@2
|
1132 |
* in order to map request and its response
|
williamr@2
|
1133 |
* together.
|
williamr@2
|
1134 |
* Error codes:
|
williamr@2
|
1135 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
1136 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
1137 |
* request.
|
williamr@2
|
1138 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
1139 |
* cannot yet process commands.
|
williamr@2
|
1140 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
1141 |
* renewed.
|
williamr@2
|
1142 |
* KErrSubmitting An internal error has occurred.
|
williamr@2
|
1143 |
* KErrNoMemory Not enough memory to process the
|
williamr@2
|
1144 |
* message.
|
williamr@2
|
1145 |
* KErrNotSupported HTTP GET or HTTP DELETE is enabled
|
williamr@2
|
1146 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
1147 |
*/
|
williamr@2
|
1148 |
virtual TInt SendL(MSenMessage& aMessage) = 0;
|
williamr@2
|
1149 |
|
williamr@2
|
1150 |
/*
|
williamr@2
|
1151 |
* Submits a SOAP message to the service. This is a synchronous call,
|
williamr@2
|
1152 |
* returning a SOAP envelope that was received from the service.
|
williamr@2
|
1153 |
* There are two default frameworks available:
|
williamr@2
|
1154 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@2
|
1155 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@2
|
1156 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@2
|
1157 |
* Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
|
williamr@2
|
1158 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@2
|
1159 |
*
|
williamr@2
|
1160 |
* @param aMessage SOAPEnvelope with the service specific message
|
williamr@2
|
1161 |
* without any framework wrapping
|
williamr@2
|
1162 |
* @param aResponseTo This is a ref-to-pointer where response
|
williamr@2
|
1163 |
* from the service will be allocated. If the
|
williamr@2
|
1164 |
* complete server messages mode is set to OFF,
|
williamr@2
|
1165 |
* then only <Body> element will be returned,
|
williamr@2
|
1166 |
* otherwise a complete SOAP envelope.
|
williamr@2
|
1167 |
* The ownership of aResponse is transfered to
|
williamr@2
|
1168 |
* the caller.
|
williamr@2
|
1169 |
* @return status/error code
|
williamr@2
|
1170 |
* Status codes:
|
williamr@2
|
1171 |
* KErrNone ok
|
williamr@2
|
1172 |
* Error codes:
|
williamr@2
|
1173 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@2
|
1174 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@2
|
1175 |
* request.
|
williamr@2
|
1176 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@2
|
1177 |
* cannot yet process commands.
|
williamr@2
|
1178 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@2
|
1179 |
* renewed.
|
williamr@2
|
1180 |
* KErrSubmitting An internal error has occurred.
|
williamr@2
|
1181 |
* KErrNoMemory Not enough memory to process the
|
williamr@2
|
1182 |
* message.
|
williamr@2
|
1183 |
* KErrSenInternal Internal state is invalid.
|
williamr@2
|
1184 |
* KErrNotSupported HTTP GET or HTTP DELETE is enabled
|
williamr@2
|
1185 |
* Other error codes are system-wide Symbian error codes.
|
williamr@2
|
1186 |
*/
|
williamr@2
|
1187 |
virtual TInt SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) = 0;
|
williamr@2
|
1188 |
|
williamr@2
|
1189 |
/**
|
williamr@2
|
1190 |
* Getter for currently active transaction (service response) that is
|
williamr@2
|
1191 |
* being handled by the service consumer.
|
williamr@2
|
1192 |
* @return a pointer to currently active transaction (service response).
|
williamr@2
|
1193 |
* It is guarenteed, that the method returns a pointer to
|
williamr@2
|
1194 |
* transaction only when called inside HandleMessageL or
|
williamr@2
|
1195 |
* HandleErrorL callback methods of MSenServiceConsumer,
|
williamr@2
|
1196 |
* otherwise it will return NULL.
|
williamr@2
|
1197 |
*/
|
williamr@2
|
1198 |
virtual MSenMessage* Response() = 0;
|
williamr@2
|
1199 |
|
williamr@2
|
1200 |
/**
|
williamr@2
|
1201 |
* Cancels any active request, if pending transaction
|
williamr@2
|
1202 |
* (txn) can be found with given txn ID.
|
williamr@2
|
1203 |
* @param aTransactionID is the transaction ID to be cancelled. This id has earlier been
|
williamr@2
|
1204 |
* acquired from a call to some of the asynchronous SendL variants.
|
williamr@2
|
1205 |
|
williamr@2
|
1206 |
* @return KErrNone on success
|
williamr@2
|
1207 |
* KErrNotFound, if there is no pending transaction (active request),
|
williamr@2
|
1208 |
* or some of the system-wide error codes otheriwise.
|
williamr@2
|
1209 |
*/
|
williamr@2
|
1210 |
virtual TInt CancelTransaction(TInt aTransactionID) = 0;
|
williamr@2
|
1211 |
|
williamr@2
|
1212 |
/**
|
williamr@2
|
1213 |
* Getter for the identity provider (XML) service description.
|
williamr@2
|
1214 |
* @param apIdentityProvider will point to a new IDP instance,
|
williamr@2
|
1215 |
* if such is associated with this connection (and this connection
|
williamr@2
|
1216 |
* was ready before calling this method), or NULL otherwise.
|
williamr@2
|
1217 |
* @return KErrNone if IDP description can be found, or some
|
williamr@2
|
1218 |
* of the system wide error code otherwise.
|
williamr@2
|
1219 |
*/
|
williamr@2
|
1220 |
virtual TInt IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) = 0;
|
williamr@2
|
1221 |
|
williamr@2
|
1222 |
/**
|
williamr@2
|
1223 |
* Getter for the identifier of this connection.
|
williamr@2
|
1224 |
* @return the identifier as integer.
|
williamr@2
|
1225 |
*/
|
williamr@2
|
1226 |
virtual TInt Identifier() = 0;
|
williamr@2
|
1227 |
|
williamr@2
|
1228 |
/**
|
williamr@2
|
1229 |
* Registers observer of BLOBs transfer progress.
|
williamr@2
|
1230 |
*
|
williamr@2
|
1231 |
* @param aFilesObserver Implementation of transfer progress observer.
|
williamr@2
|
1232 |
*/
|
williamr@2
|
1233 |
|
williamr@4
|
1234 |
virtual void DataTrafficDetails(TSenDataTrafficDetails& aDetails,
|
williamr@4
|
1235 |
TSenDataTrafficOperations& aOperations) = 0;
|
williamr@4
|
1236 |
|
williamr@4
|
1237 |
/**
|
williamr@4
|
1238 |
* Service Consumer can call this method to acquire a new interface,
|
williamr@4
|
1239 |
* which is identified by unique ID (UID).
|
williamr@4
|
1240 |
* @param aUID is the UID of the interface being requested
|
williamr@4
|
1241 |
* @return TAny* pointer to the interface, or if no interface to
|
williamr@4
|
1242 |
* given UID exists, function returns NULL. In typical cases, returned
|
williamr@4
|
1243 |
* pointer should be cast to some preknown M-class pointer (the actual
|
williamr@4
|
1244 |
* new interface).
|
williamr@4
|
1245 |
*
|
williamr@4
|
1246 |
* List of currently supported interfaces:
|
williamr@4
|
1247 |
* KSenInterfaceUidAlrServiceConnection => MSenAlrServiceConnection
|
williamr@4
|
1248 |
*/
|
williamr@4
|
1249 |
virtual TAny* InterfaceByUid( TUid aUID ) = 0;
|
williamr@4
|
1250 |
|
williamr@4
|
1251 |
/*
|
williamr@4
|
1252 |
* Sends a RFile Handle to the service.
|
williamr@4
|
1253 |
* the Identity Based Web Service Framework (which ID is "ID-WSF")
|
williamr@4
|
1254 |
* and the Basic Web Services Framework (which ID is "WS-I").
|
williamr@4
|
1255 |
* Please note, that ID-WSF does NOT support this method.
|
williamr@4
|
1256 |
* SendL(const TDesC8&).
|
williamr@4
|
1257 |
* So, currently this method is supported only in Basic Web Services framework.
|
williamr@4
|
1258 |
* @param aMessage The service specific message - a full SOAP envelope
|
williamr@4
|
1259 |
* @return Transaction ID (positive integer) or error code, if method fails.
|
williamr@4
|
1260 |
* Transaction ids:
|
williamr@4
|
1261 |
* Positive integers SendL returns transaction ID of the request,
|
williamr@4
|
1262 |
* which can be later on utilized inside
|
williamr@4
|
1263 |
* HandleMessageL and HandleErrorL methods,
|
williamr@4
|
1264 |
* in order to map request and its response
|
williamr@4
|
1265 |
* together.
|
williamr@4
|
1266 |
* Error codes:
|
williamr@4
|
1267 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@4
|
1268 |
* KErrArgument RFile handle is NULL ( Specified file doesnot exist)
|
williamr@4
|
1269 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@4
|
1270 |
* request.
|
williamr@4
|
1271 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@4
|
1272 |
* cannot yet process commands.
|
williamr@4
|
1273 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@4
|
1274 |
* renewed.
|
williamr@4
|
1275 |
* KErrSubmitting An internal error has occurred.
|
williamr@4
|
1276 |
* KErrNoMemory Not enough memory to process the
|
williamr@4
|
1277 |
* message.
|
williamr@4
|
1278 |
* Other error codes are system-wide Symbian error codes.
|
williamr@4
|
1279 |
*/
|
williamr@4
|
1280 |
virtual TInt SendL(RFile& aFileHandle) = 0;
|
williamr@4
|
1281 |
|
williamr@4
|
1282 |
/*
|
williamr@4
|
1283 |
* Submits a RFile Handle to the service. This is a synchronous call,
|
williamr@4
|
1284 |
* returning a SOAP envelope that was received from the service.
|
williamr@4
|
1285 |
* There are two default frameworks available:
|
williamr@4
|
1286 |
* @param aResponseTo This is a ref-to-pointer where response
|
williamr@4
|
1287 |
* from the service will be allocated. If the
|
williamr@4
|
1288 |
* complete server messages mode is set to OFF,
|
williamr@4
|
1289 |
* then only <Body> element will be returned,
|
williamr@4
|
1290 |
* otherwise a complete SOAP envelope.
|
williamr@4
|
1291 |
* The ownership of aResponse is transfered to
|
williamr@4
|
1292 |
* the caller.
|
williamr@4
|
1293 |
* @return status/error code
|
williamr@4
|
1294 |
* Status codes:
|
williamr@4
|
1295 |
* KErrNone ok
|
williamr@4
|
1296 |
* Error codes:
|
williamr@4
|
1297 |
* KErrSenNotInitialized Connection has not been initialized.
|
williamr@4
|
1298 |
* KErrSenServiceConnectionBusy Connection is already busy with another
|
williamr@4
|
1299 |
* request.
|
williamr@4
|
1300 |
* KErrConnectionInitializing Connection is still initializing and
|
williamr@4
|
1301 |
* cannot yet process commands.
|
williamr@4
|
1302 |
* KErrConnectionExpired Connection is expired and needs to be
|
williamr@4
|
1303 |
* renewed.
|
williamr@4
|
1304 |
* KErrSubmitting An internal error has occurred.
|
williamr@4
|
1305 |
* KErrNoMemory Not enough memory to process the
|
williamr@4
|
1306 |
* message.
|
williamr@4
|
1307 |
* KErrArgument RFile handle is NULL ( Specified file doesnot exist)
|
williamr@4
|
1308 |
* KErrSenInternal Internal state is invalid.
|
williamr@4
|
1309 |
* Other error codes are system-wide Symbian error codes.
|
williamr@4
|
1310 |
*/
|
williamr@4
|
1311 |
virtual TInt SubmitL(RFile& aFileHandle, HBufC8*& aResponseTo) = 0;
|
williamr@4
|
1312 |
|
williamr@2
|
1313 |
protected:
|
williamr@2
|
1314 |
|
williamr@2
|
1315 |
/**
|
williamr@2
|
1316 |
* C++ default constructor.
|
williamr@2
|
1317 |
*/
|
williamr@2
|
1318 |
CSenServiceConnection();
|
williamr@2
|
1319 |
|
williamr@2
|
1320 |
};
|
williamr@2
|
1321 |
|
williamr@2
|
1322 |
#endif //SEN_SERVICE_CONNECTION_H
|
williamr@2
|
1323 |
|
williamr@2
|
1324 |
// End of File
|
williamr@2
|
1325 |
|