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