SenServiceConnection.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : SenServiceConnection.h
00004 *  Part of     : Web Services Connection
00005 *  Interface   : 
00006 *  Description : CSenServiceConnection offers public API for
00007 *                service consumers to access invocable services, 
00008 *                as a part of the Web Services Framework (WSF).
00009 *  Version     : 
00010 *
00011 *  Copyright © 2002-2005 Nokia. All rights reserved.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia. All rights are reserved. Copying, including 
00015 *  reproducing, storing, adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia.
00020 * ==============================================================================
00021 */
00022 
00023 
00024 #ifndef SEN_SERVICE_CONNECTION_H
00025 #define SEN_SERVICE_CONNECTION_H
00026 
00027 //  INCLUDES
00028 #include <e32base.h> // for CActive
00029 #include <MSenServiceConsumer.h>
00030 #include <MSenServiceDescription.h>
00031 
00032 #include <MSenAuthenticationProvider.h>
00033 
00034 #include <SenSoapMessage.h>
00035 #include <SenSoapMessage2.h>
00036 //#include <SenAtomEntry.h>
00037 
00038 
00039 #include <MSenMessage.h>
00040 
00041 // CONSTANTS
00042 const TInt KErrSenNotInitialized                    =   -30291;
00043 const TInt KErrSenServiceConnectionBusy             =   -30292;
00044 const TInt KErrConnectionInitializing               =   -30293;
00045 const TInt KErrConnectionExpired                    =   -30294;
00046 const TInt KErrSubmitting                           =   -30295;
00047 const TInt KErrSenSoapFault                         =   -30296; 
00048 const TInt KErrSenInternal                          =   -30297;
00049 const TInt KErrSenNoEndpoint                        =   -30298;
00050 const TInt KErrSenNoContract                        =   -30299;
00051 
00052 const TInt KErrSenProviderIdInUseByAnotherEndpoint  =   -30305;
00053 const TInt KErrSenNoContractNoEndPoint              =   -30306;
00054 
00055 const TInt KErrSenBrokenSoapEnvelope                =   -30307;
00056 const TInt KErrSenBrokenSoapFault                   =   -30308;
00057 const TInt KErrSenCancelled                         =   -30309;
00058 
00059 
00060 // HTTP transport error codes:
00061 const TInt KErrSenNoHttpResponseBody                =   -30310;
00062 const TInt KErrSenNoHttpContentType                 =   -30311;
00063 const TInt KErrSenHttpRedirectRequiresConfirmation  =   -30312;
00064 
00065 // SOAP message verification error codes:
00066 const TInt KErrSenNoSoapBody                        =   -30313;
00067 const TInt KErrSenNoSoapHeader                      =   -30314;
00068 const TInt KErrSenNoPermission                      =   -30315; 
00069 
00070 const TInt KErrSenHostNotAvailable                  =   -30318;
00071 
00072 const TInt KErrSenAuthenticationFault               =   -30319;
00073 const TInt KErrSenNoEndUserPermission               =   -30321;
00074 
00075 
00076 const TInt KSenConnectionStatusCreateFailed         =  -1; // post-state
00077 const TInt KSenConnectionStatusNew                  =   0; // post-state
00078 const TInt KSenConnectionStatusReady                =   1; // post-state
00079 const TInt KSenConnectionStatusExpired              =   2; // post-state
00080 const TInt KSenConnectionStatusAuthentication       =   3; // pre-state
00081 const TInt KSenConnectionStatusDiscovery            =   4; // pre-state
00082 const TInt KSenConnectionStatusMetadataExchange     =   5; // pre-state
00083 
00084 _LIT8(KDefaultBasicWebServicesFrameworkID,          "WS-I");
00085 _LIT8(KDefaultIdWsfFrameworkID,                     "ID-WSF"); 
00086 _LIT8(KDefaultRestServicesFrameworkID,              "REST");
00087 _LIT8(KDefaultWSStarFrameworkID,                    "WS-STAR");
00088 _LIT8(KDefaultAtomPubFrameworkID,                   "ATOM-PUB");
00089 _LIT8(KDefaultOviFrameworkID,                       "OVI");
00090 
00091 const TInt KSenTransportStatusCodeOffsetBaseHttp = 1000;
00092 const TInt KSenTransportStatusCodeOffsetBaseVtcp = 2000;
00093 
00094 const TInt KSenTransportStatusCodeVtcpInit =        2001; // KSenTransportStatusCodeOffsetBaseVtcp +1 
00095 const TInt KSenTransportStatusCodeVtcpActive =      2002; // KSenTransportStatusCodeOffsetBaseVtcp +2 
00096 const TInt KSenTransportStatusCodeVtcpSuspended =   2003; // KSenTransportStatusCodeOffsetBaseVtcp +3 
00097 const TInt KSenTransportStatusCodeVtcpInactive =    2004; // KSenTransportStatusCodeOffsetBaseVtcp +4
00098 const TInt KSenTransportStatusCodeVtcpUnavailable = 2005; // KSenTransportStatusCodeOffsetBaseVtcp +5
00099 
00100 // FORWARD DECLARATIONS
00101 class CSenServicePattern;
00102 class CSenIdentityProvider;
00103 
00104 // CLASS DECLARATION
00105 
00159 class CSenServiceConnection : public CActive, public MSenFragment
00160     {
00161     public: // Constructors and destructor
00162 
00198         IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
00199                                                     const TDesC8& aContract);
00200 
00235         IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
00236                                                      const TDesC8& aContract);
00237 
00257         IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aObserver,
00258                                                     MSenServiceDescription& aServiceDescription);
00259 
00281         IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
00282                                                      MSenServiceDescription& aServiceDescription);
00283 
00284         /*
00285         * The ServicePattern version of two phased constructor. 
00286         * Note, that this method is intended to be used by service consumers
00287         * wishing to initialize connection in specific context called
00288         * consumer policy. In consumer policy, certain properties 
00289         * can be set to further define what kind of connection is acceptable
00290         * and how the connection interacts with transport (for example, which
00291         * Internet Access Point (IAP) will be used).
00292         * However, any ConsumerPolicy feature is applicable in 
00293         * one-policy-per-client scope and not used as a common policy.
00294         * To set permanent information about known WSP, please use the
00295         * CSenXmlServiceDescription, which implements MSenProviderPolicy
00296         * interface.
00297         * This constructor is ASYNCHRONOUS and the actual state of
00298         * created connection has to be observed from SetStatus() and
00299         * HandleErrorL() functions.
00300         * If service is found, the SetStatus() call-back is executed
00301         * with a status value KSenConnectionStatusReady (1)
00302         * For ID-WSF connections, the authentication for the Web Service
00303         * Provider (WSP) connection is resolved using one of the identity 
00304         * providers which have been associated with the contract found in 
00305         * the SD. At minimum, the contract of the service (typically some URN)
00306         * has to provided in the SD.
00307         * Basic Web Service consumers instantiate a SD where an endpoint
00308         * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
00309         * @param    aObserver connection observer.
00310         * @param    aServiceDescription is the description used to
00311         *               obtain a service connection. 
00312         * @return   a pointer to a CSenServiceConnection instance.
00313         */
00314         IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aObserver,
00315                                                     CSenServicePattern& aServicePattern);
00316     
00317         /*
00318         * The ServicePattern version of two phased constructor. 
00319         * Note, that this method is intended to be used by service consumers
00320         * wishing to initialize connection in specific context called
00321         * consumer policy. In consumer policy, certain properties 
00322         * can be set to further define what kind of connection is acceptable
00323         * and how the connection interacts with transport (for example, which
00324         * Internet Access Point (IAP) will be used).
00325         * However, any ConsumerPolicy feature is applicable in 
00326         * one-policy-per-client scope and not used as a common policy.
00327         * To set permanent information about known WSP, please use the
00328         * CSenXmlServiceDescription, which implements MSenProviderPolicy
00329         * interface.
00330         * This constructor is ASYNCHRONOUS and the actual state of
00331         * created connection has to be observed from SetStatus() and
00332         * HandleErrorL() functions.
00333         * If service is found, the SetStatus() call-back is executed
00334         * with a status value KSenConnectionStatusReady (1)
00335         * For ID-WSF connections, the authentication for the Web Service
00336         * Provider (WSP) connection is resolved using one of the identity 
00337         * providers which have been associated with the contract found in 
00338         * the SD. At minimum, the contract of the service (typically some URN)
00339         * has to provided in the SD.
00340         * Basic Web Service consumers instantiate a SD where an endpoint
00341         * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
00342         * @param    aObserver connection observer.
00343         * @param    aServiceDescription is the description used to
00344         *               obtain a service connection. 
00345         * @return   a pointer to a CSenServiceConnection instance.
00346         *               The pointer is left on the cleanup stack.
00347         */
00348         IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aObserver,
00349                                                      CSenServicePattern& aServicePattern);
00350         
00386         IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
00387                                                     const TDesC8& aContract,
00388                                                     MSenExtendedConsumerInterface& aExtendedConsumer);
00424         IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
00425                                                      const TDesC8& aContract,
00426                                                      MSenExtendedConsumerInterface& aExtendedConsumer);
00427     
00448         IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
00449                                                     MSenServiceDescription& aServiceDescription,
00450                                                     MSenExtendedConsumerInterface& aExtendedConsumer);
00451     
00474         IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
00475                                                      MSenServiceDescription& aServiceDescription,
00476                                                      MSenExtendedConsumerInterface& aExtendedConsumer);
00477     
00478         /*
00479         * The ServicePattern version of two phased constructor. 
00480         * Note, that this method is intended to be used by service consumers
00481         * wishing to initialize connection in specific context called
00482         * consumer policy. In consumer policy, certain properties 
00483         * can be set to further define what kind of connection is acceptable
00484         * and how the connection interacts with transport (for example, which
00485         * Internet Access Point (IAP) will be used).
00486         * However, any ConsumerPolicy feature is applicable in 
00487         * one-policy-per-client scope and not used as a common policy.
00488         * To set permanent information about known WSP, please use the
00489         * CSenXmlServiceDescription, which implements MSenProviderPolicy
00490         * interface.
00491         * This constructor is ASYNCHRONOUS and the actual state of
00492         * created connection has to be observed from SetStatus() and
00493         * HandleErrorL() functions.
00494         * If service is found, the SetStatus() call-back is executed
00495         * with a status value KSenConnectionStatusReady (1)
00496         * For ID-WSF connections, the authentication for the Web Service
00497         * Provider (WSP) connection is resolved using one of the identity 
00498         * providers which have been associated with the contract found in 
00499         * the SD. At minimum, the contract of the service (typically some URN)
00500         * has to provided in the SD.
00501         * Basic Web Service consumers instantiate a SD where an endpoint
00502         * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
00503         * @param    aConsumer connection observer.
00504         * @param    aServiceDescription is the description used to
00505         *               obtain a service connection.
00506         * @param        aAuthProvider      Authentication Provider                                 
00507         * @return   a pointer to a CSenServiceConnection instance.
00508         */    
00509         IMPORT_C static CSenServiceConnection* NewL(MSenServiceConsumer& aConsumer,
00510                                                     CSenServicePattern& aServicePattern,
00511                                                     MSenExtendedConsumerInterface& aExtendedConsumer);
00512 
00513         /*
00514         * The ServicePattern version of two phased constructor. 
00515         * Note, that this method is intended to be used by service consumers
00516         * wishing to initialize connection in specific context called
00517         * consumer policy. In consumer policy, certain properties 
00518         * can be set to further define what kind of connection is acceptable
00519         * and how the connection interacts with transport (for example, which
00520         * Internet Access Point (IAP) will be used).
00521         * However, any ConsumerPolicy feature is applicable in 
00522         * one-policy-per-client scope and not used as a common policy.
00523         * To set permanent information about known WSP, please use the
00524         * CSenXmlServiceDescription, which implements MSenProviderPolicy
00525         * interface.
00526         * This constructor is ASYNCHRONOUS and the actual state of
00527         * created connection has to be observed from SetStatus() and
00528         * HandleErrorL() functions.
00529         * If service is found, the SetStatus() call-back is executed
00530         * with a status value KSenConnectionStatusReady (1)
00531         * For ID-WSF connections, the authentication for the Web Service
00532         * Provider (WSP) connection is resolved using one of the identity 
00533         * providers which have been associated with the contract found in 
00534         * the SD. At minimum, the contract of the service (typically some URN)
00535         * has to provided in the SD.
00536         * Basic Web Service consumers instantiate a SD where an endpoint
00537         * and framework ID KDefaultBasicWebServicesFrameworkID are defined.
00538         * @param    aConsumer connection observer.
00539         * @param    aServiceDescription is the description used to
00540         *               obtain a service connection.
00541         * @param        aAuthProvider      Authentication Provider                                          
00542         * @return   a pointer to a CSenServiceConnection instance.
00543         *               The pointer is left on the cleanup stack.
00544         */
00545         IMPORT_C static CSenServiceConnection* NewLC(MSenServiceConsumer& aConsumer,
00546                                                      CSenServicePattern& aServicePattern,
00547                                                      MSenExtendedConsumerInterface& aExtendedConsumer);
00548 
00549         // New functions
00550 
00584         virtual TInt SendL(const TDesC8& aRequest) = 0;
00585 
00586 
00619         virtual TInt SubmitL(const TDesC8& aRequest, HBufC8*& aResponse) = 0;
00620 
00621         
00633         virtual TInt IsReady(TBool& aReady) = 0;
00634 
00635 
00669         virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet) = 0;
00670 
00671 
00702         virtual TInt CompleteServerMessagesOnOff(const TBool& aCompleteOnOff) = 0;
00703 
00704 
00705         /*
00706         * Sends a SOAP message to the service. The SOAP envelope may contain
00707         * proprietary headers. The system will augment the message with the
00708         * appropriate headers specified in the service invocation framework,
00709         * so a client application should add only non-standard headers; and
00710         * if it doesn't need to set such headers it is strongly recommended
00711         * to use SendL(TDesC8&), which is meant for that.
00712         * This is an asynchronous function, that returns immediately.
00713         * When the service responds, the SOAP envelope content will
00714         * be received via HandleMessageL() callback. In case of an
00715         * error - like a SOAP fault - HandleErrorL() will be called
00716         * with appropriate error code.
00717         * There are two default frameworks available -
00718         * the Identity Based Web Service Framework (which ID is "ID-WSF") 
00719         * and the Basic Web Services Framework (which ID is "WS-I"). 
00720         * Please note, that ID-WSF does NOT support this method. 
00721         * Instead, one should send SOAP envelope Bodies using 
00722         * SendL(const TDesC8&).
00723         * So, currently this method is supported only in Basic Web Services framework.
00724         * @param aMessage  The service specific message - a full SOAP envelope 
00725         * @return Transaction ID (positive integer) or error code, if method fails.
00726         * Transaction ids:
00727         * Positive integers                 SendL returns transaction ID of the request,
00728         *                                   which can be later on utilized inside
00729         *                                   HandleMessageL and HandleErrorL methods,
00730         *                                   in order to map request and its response
00731         *                                   together.
00732         * Error codes:
00733         * KErrSenNotInitialized             Connection has not been initialized.
00734         * KErrSenServiceConnectionBusy      Connection is already busy with another
00735         *                                   request.
00736         * KErrConnectionInitializing        Connection is still initializing and
00737         *                                   cannot yet process commands.
00738         * KErrConnectionExpired             Connection is expired and needs to be
00739         *                                   renewed.
00740         * KErrSubmitting                    An internal error has occurred.
00741         * KErrNoMemory                      Not enough memory to process the 
00742         *                                   message.
00743         * Other error codes are system-wide Symbian error codes.
00744         */
00745         virtual TInt SendL(CSenSoapEnvelope& aMessage) = 0;
00746 
00747 
00748         /*
00749         * Submits a SOAP message to the service. This is a synchronous call,
00750         * returning  a SOAP envelope that was received from the service.
00751         * There are two default frameworks available:
00752         * the Identity Based Web Service Framework (which ID is "ID-WSF") 
00753         * and the Basic Web Services Framework (which ID is "WS-I"). 
00754         * Please note, that ID-WSF does NOT support this method. 
00755         * Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
00756         * So, currently this method is supported only in Basic Web Services framework.
00757         * @param    aMessage SOAPEnvelope with the service specific message
00758         *                    without any framework wrapping
00759         * @param    aResponseTo  This is a ref-to-pointer where response 
00760         *                        from the service will be allocated. If the
00761         *                        complete server messages mode is set to OFF,
00762         *                        then only <Body> element will be returned, 
00763         *                        otherwise a complete SOAP envelope.
00764         *                        The ownership of aResponse is transfered to 
00765         *                        the caller.
00766         * @return status/error code
00767         * Status codes:
00768         * KErrNone                          ok
00769         * Error codes:
00770         * KErrSenNotInitialized             Connection has not been initialized.
00771         * KErrSenServiceConnectionBusy      Connection is already busy with another
00772         *                                   request.
00773         * KErrConnectionInitializing        Connection is still initializing and
00774         *                                   cannot yet process commands.
00775         * KErrConnectionExpired             Connection is expired and needs to be
00776         *                                   renewed.
00777         * KErrSubmitting                    An internal error has occurred.
00778         * KErrNoMemory                      Not enough memory to process the 
00779         *                                   message.
00780         * KErrSenInternal                   Internal state is invalid.
00781         * Other error codes are system-wide Symbian error codes.
00782         */
00783         virtual TInt SubmitL(CSenSoapEnvelope& aMessage, HBufC8*& aResponseTo) = 0;
00784 
00785 
00805         virtual TInt ServiceDescriptionL(HBufC8*& aServiceDescription) = 0;
00806 
00807 
00817         virtual TInt StartTransaction() = 0;
00818 
00819 
00827         virtual TInt TransactionCompleted() = 0;
00828 
00829 
00830         /*
00831         * Returns the transasction ID of this message or error. Id is guaranteed
00832         * to return unique ID  when called from inside HandleMessageL() or 
00833         * HandleErrorL callback. This transasction ID may be used to map the 
00834         * response with the preceedeing SendL() call (a request).
00835         * @return TInt transaction ID, or KErrNotFound, if no transaction is
00836         * on-going.
00837         */
00838         virtual TInt TxnId() = 0;
00839 
00840 
00859         virtual TInt SetTransportPropertiesL(const TDesC8& aProperties) = 0;
00860 
00861 
00862         /*
00863         * Method returns currently effective transport properties as a serialized
00864         * descriptor. With HTTP, one may utilize CSenHttpProperities class in
00865         * order to read this data into properties object. Note that returned 
00866         * list of properties also includes properties, which are defined as default
00867         * for certain transport in the webservice framework.
00868         */
00869         virtual TInt TransportPropertiesL(HBufC8*& aProperties) = 0;
00870 
00871 
00908         virtual TInt SendL(const TDesC8& aRequest, const TDesC8& aProperties) = 0;
00909 
00910         
00946         virtual TInt SubmitL(const TDesC8& aRequest, const TDesC8& aProperties, HBufC8*& aResponse) = 0;
00947 
00948 
00949         /*
00950         * Sends a SOAP message to the service. The SOAP envelope may contain
00951         * proprietary headers. The system will augment the message with the
00952         * appropriate headers specified in the service invocation framework,
00953         * so a client application should add only non-standard headers; and
00954         * if it doesn't need to set such headers it is strongly recommended
00955         * to use SendL(TDesC8&), which is meant for this.
00956         * This is an asynchronous function, that returns immediately.
00957         * When the service responds, the SOAP envelope content will
00958         * be received via HandleMessageL() callback. In case of an
00959         * error - like a SOAP fault - HandleErrorL() will be called
00960         * with appropriate error code.
00961         * There are two default frameworks available -
00962         * the Identity Based Web Service Framework (which ID is "ID-WSF") 
00963         * and the Basic Web Services Framework (which ID is "WS-I"). 
00964         * Please note, that ID-WSF does NOT support this method. 
00965         * Instead, one should send SOAP envelope Bodies using 
00966         * SendL(const TDesC8&).
00967         * So, currently this method is supported only in Basic Web Services framework.
00968         *
00969         * NOTE:
00970         * Message is send as serialized XML or Soap message to SendL 
00971         * aProperties could be "HTTP GET" or "HTTP DELETE"  
00972         * HTTP GET or HTTP DELETE transport property has been enabled via CSenHttpTransportProperties. 
00973         * This scenario is not supported  
00974         *
00975         * @param aMessage  The service specific message - a full SOAP envelope 
00976         * @param aProperties contains transport spesific properties, serialized
00977         * into descriptor. With HTTP, one can create this by utilizing specialized
00978         * CSenHttpProperties class.
00979         * @return Transaction ID (positive integer) or error code, if method fails.
00980         * Transaction ids:
00981         * Positive integers                 SendL returns transaction ID of the request,
00982         *                                   which can be later on utilized inside
00983         *                                   HandleMessageL and HandleErrorL methods,
00984         *                                   in order to map request and its response
00985         *                                   together.
00986         * Error codes:
00987         * KErrSenNotInitialized             Connection has not been initialized.
00988         * KErrSenServiceConnectionBusy      Connection is already busy with another
00989         *                                   request.
00990         * KErrConnectionInitializing        Connection is still initializing and
00991         *                                   cannot yet process commands.
00992         * KErrConnectionExpired             Connection is expired and needs to be
00993         *                                   renewed.
00994         * KErrSubmitting                    An internal error has occurred.
00995         * KErrNoMemory                      Not enough memory to process the 
00996         *                                   message.
00997         * KErrNotSupported                                      HTTP GET or HTTP DELETE is enabled        
00998         * Other error codes are system-wide Symbian error codes.
00999         */
01000         virtual TInt SendL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties) = 0;
01001 
01002         /*
01003         * Submits a SOAP message to the service. This is a synchronous call,
01004         * returning  a SOAP envelope that was received from the service.
01005         * There are two default frameworks available:
01006         * the Identity Based Web Service Framework (which ID is "ID-WSF") 
01007         * and the Basic Web Services Framework (which ID is "WS-I"). 
01008         * Please note, that ID-WSF does NOT support this method. 
01009         * Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
01010         * So, currently this method is supported only in Basic Web Services framework.
01011         *
01012         * NOTE:
01013         * Message is send as serialized XML or Soap message to SubmitL 
01014         * aProperties could be "HTTP GET" or "HTTP DELETE"  
01015         * HTTP GET or HTTP DELETE transport property has been enabled via CSenHttpTransportProperties. 
01016         * This scenario is not supported
01017         *
01018         * @param aMessage SOAPEnvelope with the service specific message
01019         * without any framework wrapping
01020         * @param aProperties contains transport spesific properties, serialized
01021         * into descriptor. With HTTP, one can create this by utilizing specialized
01022         * CSenHttpProperties class.
01023         * @param    aResponseTo  This is a ref-to-pointer where response 
01024         *                        from the service will be allocated. If the
01025         *                        complete server messages mode is set to OFF,
01026         *                        then only <Body> element will be returned, 
01027         *                        otherwise a complete SOAP envelope.
01028         *                        The ownership of aResponse is transfered to 
01029         *                        the caller.
01030         * @return status/error code
01031         * Status codes:
01032         * KErrNone                          ok
01033         * Error codes:
01034         * KErrSenNotInitialized             Connection has not been initialized.
01035         * KErrSenServiceConnectionBusy      Connection is already busy with another
01036         *                                   request.
01037         * KErrConnectionInitializing        Connection is still initializing and
01038         *                                   cannot yet process commands.
01039         * KErrConnectionExpired             Connection is expired and needs to be
01040         *                                   renewed.
01041         * KErrSubmitting                    An internal error has occurred.
01042         * KErrNoMemory                      Not enough memory to process the 
01043         *                                   message.
01044         * KErrSenInternal                   Internal state is invalid.
01045         * KErrNotSupported                                      HTTP GET or HTTP DELETE is enabled        
01046         * Other error codes are system-wide Symbian error codes.
01047         */
01048         virtual TInt SubmitL(CSenSoapEnvelope& aMessage, const TDesC8& aProperties, HBufC8*& aResponseTo) = 0;
01049 
01050         /*
01051         * Sends a SOAP message to the service. The SOAP envelope may contain
01052         * proprietary headers. The system will augment the message with the
01053         * appropriate headers specified in the service invocation framework,
01054         * so a client application should add only non-standard headers.
01055         * This is an asynchronous function, that returns immediately.
01056         * When the service responds, the SOAP envelope content will
01057         * be received via HandleMessageL() callback. In case of an
01058         * error - like a SOAP fault - HandleErrorL() will be called
01059         * with appropriate error code.
01060         * There are two default frameworks available -
01061         * the Identity Based Web Service Framework (which ID is "ID-WSF") 
01062         * and the Basic Web Services Framework (which ID is "WS-I"). 
01063         * Please note, that ID-WSF does NOT support this method. 
01064         * Instead, one should send SOAP envelope Bodies using 
01065         * SendL(const TDesC8&).
01066         * So, currently this method is supported only in Basic Web Services framework.
01067         *
01068         * @param aMessage  The service specific message - a full SOAP envelope 
01069         * @return Transaction ID (positive integer) or error code, if method fails.
01070         * Transaction ids:
01071         * Positive integers                 SendL returns transaction ID of the request,
01072         *                                   which can be later on utilized inside
01073         *                                   HandleMessageL and HandleErrorL methods,
01074         *                                   in order to map request and its response
01075         *                                   together.
01076         * Error codes:
01077         * KErrSenNotInitialized             Connection has not been initialized.
01078         * KErrSenServiceConnectionBusy      Connection is already busy with another
01079         *                                   request.
01080         * KErrConnectionInitializing        Connection is still initializing and
01081         *                                   cannot yet process commands.
01082         * KErrConnectionExpired             Connection is expired and needs to be
01083         *                                   renewed.
01084         * KErrSubmitting                    An internal error has occurred.
01085         * KErrNoMemory                      Not enough memory to process the 
01086         *                                   message.
01087         * KErrNotSupported                                      HTTP GET or HTTP DELETE is enabled
01088         * Other error codes are system-wide Symbian error codes.
01089         */
01090         virtual TInt SendL(MSenMessage& aMessage) = 0;
01091 
01092         /*
01093         * Submits a SOAP message to the service. This is a synchronous call,
01094         * returning  a SOAP envelope that was received from the service.
01095         * There are two default frameworks available:
01096         * the Identity Based Web Service Framework (which ID is "ID-WSF") 
01097         * and the Basic Web Services Framework (which ID is "WS-I"). 
01098         * Please note, that ID-WSF does NOT support this method. 
01099         * Instead, one should send SOAP envelope Bodies using SendL(const TDesC8&).
01100         * So, currently this method is supported only in Basic Web Services framework.
01101         *
01102         * @param aMessage SOAPEnvelope with the service specific message
01103         * without any framework wrapping
01104         * @param    aResponseTo  This is a ref-to-pointer where response 
01105         *                        from the service will be allocated. If the
01106         *                        complete server messages mode is set to OFF,
01107         *                        then only <Body> element will be returned, 
01108         *                        otherwise a complete SOAP envelope.
01109         *                        The ownership of aResponse is transfered to 
01110         *                        the caller.
01111         * @return status/error code
01112         * Status codes:
01113         * KErrNone                          ok
01114         * Error codes:
01115         * KErrSenNotInitialized             Connection has not been initialized.
01116         * KErrSenServiceConnectionBusy      Connection is already busy with another
01117         *                                   request.
01118         * KErrConnectionInitializing        Connection is still initializing and
01119         *                                   cannot yet process commands.
01120         * KErrConnectionExpired             Connection is expired and needs to be
01121         *                                   renewed.
01122         * KErrSubmitting                    An internal error has occurred.
01123         * KErrNoMemory                      Not enough memory to process the 
01124         *                                   message.
01125         * KErrSenInternal                   Internal state is invalid.
01126         * KErrNotSupported                                      HTTP GET or HTTP DELETE is enabled
01127         * Other error codes are system-wide Symbian error codes.
01128         */
01129         virtual TInt SubmitL(MSenMessage& aMessage, CSenSoapEnvelope2*& aResponseTo) = 0;
01130         
01140         virtual MSenMessage* Response() = 0;
01141         
01152         virtual TInt CancelTransaction(TInt aTransactionID) = 0;
01153         
01162         virtual TInt IdentityProviderL(CSenIdentityProvider*& apIdentityProvider) = 0;
01163 
01168         virtual TInt Identifier() = 0;
01169         
01176     protected:
01177         
01181         CSenServiceConnection();
01182     
01183     };
01184 
01185 #endif //SEN_SERVICE_CONNECTION_H
01186 
01187 // End of File
01188 

Copyright © Nokia Corporation 2001-2007
Back to top