Link against: SenServConn.LIB SenUtils.LIB
NetworkServices ReadUserData WriteUserData
#include <SenServiceConnection.h>
Inherits MSenFragment.
The class offers asynchronous construction of a service connection. Further, there are asynchronous and synchronous interaction methods for e.g. sending and receiving data from (possibly remote) service.
WSF offers two default frameworks:
1. Identity Based Web Services Framework (ID-WSF). The framework ID for this is KDefaultIdWsfFrameworkID ("ID-WSF").
2. Basic Web Services Framework. Framework ID is KDefaultBasicWebServicesFrameworkID ("WS-I").
The most typical use of CSenServiceConnection is to interact with a service of certain type through some invocable framework and submitting and receiving messages.
In case of WebServices, the actual service is remote and submitted messages are SOAP envelopes. However, CSenServiceConnection supports accessing any ServiceInvocationFramework which ECOM plug-in implementation is present. These plug-ins may further communicate with some service, including local services.
The link between CSenServiceConnection and any plug-in implementation interacting with some service is the framework ID, which is a property of ServiceDescription (SD) and accessible via MSenServiceDescription interface, which each SD class must implement.
When creating a connection, one offers predefined SD as an argument for asynchronous constructor. Or, optionally only a Liberty Alliance ID-WSF specific contract string
The WSF further uses the offered framework ID while looking up any matching framework plug-in implementation. As a result the SD might be offered to several plug-ins.
Public Member Functions | |
virtual TInt | SendL (const TDesC8 &aRequest)=0 |
Send an ASYNCHRONOUS request to a service. | |
virtual TInt | SubmitL (const TDesC8 &aRequest, HBufC8 *&aResponse)=0 |
Submit a synchronous request to a service (in ID-WSF, the SOAP message Body) and receive a response as XML. | |
virtual TInt | IsReady (TBool &aReady)=0 |
Consumer application can use this method to check that service connection is in ready state. | |
virtual TInt | HasFacetL (const TDesC8 &aURI, TBool &aHasFacet)=0 |
Check if the underlying service connection has a certain characteristic called a facet. | |
virtual TInt | CompleteServerMessagesOnOff (const TBool &aCompleteOnOff)=0 |
Consumer application can use this method to set flag which defines whether or not the consumer wishes to receive complete SOAP envelope from the service. | |
virtual TInt | SendL (CSenSoapEnvelope &aMessage)=0 |
virtual TInt | SubmitL (CSenSoapEnvelope &aMessage, HBufC8 *&aResponseTo)=0 |
virtual TInt | ServiceDescriptionL (HBufC8 *&aServiceDescription)=0 |
Gets service description of current connection. | |
virtual TInt | StartTransaction ()=0 |
Starts an application level transaction. | |
virtual TInt | TransactionCompleted ()=0 |
Stops application level transaction by resetting the "refToMessageId". | |
virtual TInt | TxnId ()=0 |
virtual TInt | SetTransportPropertiesL (const TDesC8 &aProperties)=0 |
Sets transport specific properties which apply as long as this connection is alive (session). | |
virtual TInt | TransportPropertiesL (HBufC8 *&aProperties)=0 |
virtual TInt | SendL (const TDesC8 &aRequest, const TDesC8 &aProperties)=0 |
Send an ASYNCHRONOUS request to a service. | |
virtual TInt | SubmitL (const TDesC8 &aRequest, const TDesC8 &aProperties, HBufC8 *&aResponse)=0 |
Submit a request via SYNCHRONOUS call to a service (in ID-WSF, the SOAP message Body) and receive a response as XML. | |
virtual TInt | SendL (CSenSoapEnvelope &aMessage, const TDesC8 &aProperties)=0 |
virtual TInt | SubmitL (CSenSoapEnvelope &aMessage, const TDesC8 &aProperties, HBufC8 *&aResponseTo)=0 |
virtual TInt | SendL (MSenMessage &aMessage)=0 |
virtual TInt | SubmitL (MSenMessage &aMessage, CSenSoapEnvelope2 *&aResponseTo)=0 |
virtual MSenMessage * | Response ()=0 |
Getter for currently active transaction (service response) that is being handled by the service consumer. | |
virtual TInt | CancelTransaction (TInt aTransactionID)=0 |
Cancels any active request, if pending transaction (txn) can be found with given txn ID. | |
virtual TInt | IdentityProviderL (CSenIdentityProvider *&apIdentityProvider)=0 |
Getter for the identity provider (XML) service description. | |
virtual TInt | Identifier ()=0 |
Getter for the identifier of this connection. | |
Static Public Member Functions | |
static IMPORT_C CSenServiceConnection * | NewL (MSenServiceConsumer &aConsumer, const TDesC8 &aContract) |
Two-phased constructor intended for Identity based service consumers (like ID-WSF). | |
static IMPORT_C CSenServiceConnection * | NewLC (MSenServiceConsumer &aObserver, const TDesC8 &aContract) |
Two-phased constructor intended for Identity based service consumers (like ID-WSF). | |
static IMPORT_C CSenServiceConnection * | NewL (MSenServiceConsumer &aObserver, MSenServiceDescription &aServiceDescription) |
Two-phased constructor using a service description. | |
static IMPORT_C CSenServiceConnection * | NewLC (MSenServiceConsumer &aObserver, MSenServiceDescription &aServiceDescription) |
Two-phased constructor using a service description. | |
static IMPORT_C CSenServiceConnection * | NewL (MSenServiceConsumer &aObserver, CSenServicePattern &aServicePattern) |
static IMPORT_C CSenServiceConnection * | NewLC (MSenServiceConsumer &aObserver, CSenServicePattern &aServicePattern) |
static IMPORT_C CSenServiceConnection * | NewL (MSenServiceConsumer &aConsumer, const TDesC8 &aContract, MSenExtendedConsumerInterface &aExtendedConsumer) |
Two-phased constructor intended for Identity based service consumers (like ID-WSF). | |
static IMPORT_C CSenServiceConnection * | NewLC (MSenServiceConsumer &aConsumer, const TDesC8 &aContract, MSenExtendedConsumerInterface &aExtendedConsumer) |
Two-phased constructor intended for Identity based service consumers (like ID-WSF). | |
static IMPORT_C CSenServiceConnection * | NewL (MSenServiceConsumer &aConsumer, MSenServiceDescription &aServiceDescription, MSenExtendedConsumerInterface &aExtendedConsumer) |
Two-phased constructor using a service description. | |
static IMPORT_C CSenServiceConnection * | NewLC (MSenServiceConsumer &aConsumer, MSenServiceDescription &aServiceDescription, MSenExtendedConsumerInterface &aExtendedConsumer) |
Two-phased constructor using a service description. | |
static IMPORT_C CSenServiceConnection * | NewL (MSenServiceConsumer &aConsumer, CSenServicePattern &aServicePattern, MSenExtendedConsumerInterface &aExtendedConsumer) |
static IMPORT_C CSenServiceConnection * | NewLC (MSenServiceConsumer &aConsumer, CSenServicePattern &aServicePattern, MSenExtendedConsumerInterface &aExtendedConsumer) |
Protected Member Functions | |
CSenServiceConnection () | |
C++ default constructor. |
|
C++ default constructor. |
|
Cancels any active request, if pending transaction (txn) can be found with given txn ID.
|
|
Consumer application can use this method to set flag which defines whether or not the consumer wishes to receive complete SOAP envelope from the service. If complete server messages mode is off, then only the <Body> element is received from the SOAP envelope, otherwise full SOAP envelope. Note: Calling this function must not be done before connection is initialized (the observer's SetStatus() has been called with value KSenConnectionStatusReady). Calling this function should be done before sending or submitting anything.
|
|
Check if the underlying service connection has a certain characteristic called a facet. Currently, only ID-WSF framework supports facets. For example, if consumer application is interested to resolve if initialized service connection has a facet indicating that service is free of charge (for e.g. "urn:framework.com.free:cost"), the method used to check this would be: _LIT8(KFacetOfFreeService, "urn:some.service.free:cost"); int err = HasFacetL(KFacetOfFreeService, hasFacet); In the service session of initialed connection, this would be the form of the facet element: <Facet name="urn:framework.com.free:cost"> If there is no facet in the service connection then the element is not present.
|
|
Getter for the identifier of this connection.
|
|
Getter for the identity provider (XML) service description.
|
|
Consumer application can use this method to check that service connection is in ready state. In ID-WSF, this means that WSF interprets that credentials for the service connection are valid (not expired).
|
|
|
Two-phased constructor using a service description. This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() and HandleErrorL() functions. If service is found, the SetStatus() call-back is executed with a status value KSenConnectionStatusReady (1) For ID-WSF connections, the authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with the contract found in the SD. At minimum, the contract of the service (typically some URN) has to provided in the SD. Basic Web Service consumers instantiate a SD where an endpoint and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
|
Two-phased constructor intended for Identity based service consumers (like ID-WSF). The pointer is left on the cleanup stack. This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, the SetStatus() call-back is performed with a status value KSenConnectionStatusReady (1). Contract of the service (typically some URN) is provided. Authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with this contract (typically an URN). This constructor is ASYNCHRONOUS and the actual state of newly created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, a SetStatus call-back with value KSenConnectionStatusReady (1) is executed. If some error occurs, HandleErrorL() will be called to inform the creator of this connection (service consumer application) For example, if service is not found, a system wide error code of -1 is deliver via HandleErrorL() to WSC. Second example: server response HTTP 501 means, that this error code. 501 will be delivered via HandleErrorL() to WSC. This can happen in ID-WSF connection being initialized, if either Authentication Service (AS) or Discovery Service (DS) cannot be reached.
|
|
|
Two-phased constructor using a service description. This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() and HandleErrorL() functions. If service is found, the SetStatus() call-back is executed with a status value KSenConnectionStatusReady (1) For ID-WSF connections, the authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with the contract found in the SD. At minimum, the contract of the service (typically some URN) has to provided in the SD. Basic Web Service consumers instantiate a SD where an endpoint and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
|
Two-phased constructor intended for Identity based service consumers (like ID-WSF). The pointer is left on the cleanup stack. This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, the SetStatus() call-back is performed with a status value KSenConnectionStatusReady (1). Contract of the service (typically some URN) is provided. Authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with this contract (typically an URN). This constructor is ASYNCHRONOUS and the actual state of newly created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, a SetStatus call-back with value KSenConnectionStatusReady (1) is executed. If some error occurs, HandleErrorL() will be called to inform the creator of this connection (service consumer application) For example, if service is not found, a system wide error code of -1 is deliver via HandleErrorL() to WSC. Second example: server response HTTP 501 means, that this error code. 501 will be delivered via HandleErrorL() to WSC. This can happen in ID-WSF connection being initialized, if either Authentication Service (AS) or Discovery Service (DS) cannot be reached.
|
|
|
Two-phased constructor using a service description. The pointer is left on the cleanup stack. This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, the SetStatus() call-back is executed with a status value KSenConnectionStatusReady (1) For ID-WSF connections, the authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with the contract found in the SD. At minimum, the contract of the service (typically some URN) has to provided in the SD. Basic Web Service consumers instantiate a SD where an endpoint and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
|
Two-phased constructor intended for Identity based service consumers (like ID-WSF). This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() and HandleErrorL() functions. If service is found, the SetStatus() call-back is performed with a status value KSenConnectionStatusReady (1). Contract of the service (typically some URN) is provided. Authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with this contract (typically an URN). This constructor is ASYNCHRONOUS and the actual state of newly created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, a SetStatus call-back with value KSenConnectionStatusReady (1) is executed. If some error occurs, HandleErrorL() will be called to inform the creator of this connection (service consumer application) For example, if service is not found, a system wide error code of -1 is deliver via HandleErrorL() to WSC. Second example: server response HTTP 501 means, that this error code. 501 will be delivered via HandleErrorL() to WSC. This can happen in ID-WSF connection being initialized, if either Authentication Service (AS) or Discovery Service (DS) cannot be reached.
|
|
|
Two-phased constructor using a service description. The pointer is left on the cleanup stack. This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, the SetStatus() call-back is executed with a status value KSenConnectionStatusReady (1) For ID-WSF connections, the authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with the contract found in the SD. At minimum, the contract of the service (typically some URN) has to provided in the SD. Basic Web Service consumers instantiate a SD where an endpoint and framework ID KDefaultBasicWebServicesFrameworkID are defined.
|
|
Two-phased constructor intended for Identity based service consumers (like ID-WSF). This constructor is ASYNCHRONOUS and the actual state of created connection has to be observed from SetStatus() and HandleErrorL() functions. If service is found, the SetStatus() call-back is performed with a status value KSenConnectionStatusReady (1). Contract of the service (typically some URN) is provided. Authentication for the Web Service Provider (WSP) connection is resolved using one of the identity providers which have been associated with this contract (typically an URN). This constructor is ASYNCHRONOUS and the actual state of newly created connection has to be observed from SetStatus() AND HandleErrorL() functions. If service is found, a SetStatus call-back with value KSenConnectionStatusReady (1) is executed. If some error occurs, HandleErrorL() will be called to inform the creator of this connection (service consumer application) For example, if service is not found, a system wide error code of -1 is deliver via HandleErrorL() to WSC. Second example: server response HTTP 501 means, that this error code. 501 will be delivered via HandleErrorL() to WSC. This can happen in ID-WSF connection being initialized, if either Authentication Service (AS) or Discovery Service (DS) cannot be reached.
|
|
Getter for currently active transaction (service response) that is being handled by the service consumer.
|
|
|
|
Send an ASYNCHRONOUS request to a service. In ID-WSF, the request data is a SOAP Body. Response message is received either via HandleMessageL() or HandleErrorL() callback. There are two default frameworks available - the Identity Based Web Service Framework (which ID is "ID-WSF") and the Basic Web Services Framework (which ID is "WS-I"). Please note, that Basic Web Services framework does NOT support this method. Instead, one should send complete SOAP envelopes using SendL(CSenSoapEnvelope&). So, currently this method is supported only in ID-WSF.
|
|
|
Send an ASYNCHRONOUS request to a service. In ID-WSF, the request data is a SOAP Body. Response message is received either via HandleMessageL() or HandleErrorL() callback. There are two default frameworks available - the Identity Based Web Service Framework (which ID is "ID-WSF") and the Basic Web Services Framework (which ID is "WS-I"). Please note, that Basic Web Services framework does NOT support this method. Instead, one should send complete SOAP envelopes using SendL(CSenSoapEnvelope&). So, currently this method is supported only in ID-WSF.
|
|
Gets service description of current connection.
|
|
Sets transport specific properties which apply as long as this connection is alive (session). Furthermore, the properties are effective for this session in cumulative manner: each property has unique key (name) which is associated to the actual value of that property. When SetTransportPropertiesL method is called multiple times - in sequence - the last value for each key overrides any previous definitions. If any latter call introduces new keys (property names), they are appended to the list of currently effective properties. Also note, that it is also possible to set message specific properties when making a SendL/SubmitL call. If such transport properties for message are provided, and those include updates to some properties, the new ones are effective only for that certain message, i.e. those are transaction specific. For any following message, that is sent over a service connection, the session specific properties apply, assuming that the new message does not (again) override some of the property values.
|
|
Starts an application level transaction. The consumer may now start to communicate with some service withing a chain of correlated messages. When responding to a certain SOAP message inside a transaction, the last received message ID is used as "refToMessageId". From default frameworks, only ID-WSF supports transactions.
|
|
|
|
Submit a request via SYNCHRONOUS call to a service (in ID-WSF, the SOAP message Body) and receive a response as XML. There are two default frameworks available - the Identity Based Web Service Framework (which ID is "ID-WSF") and the Basic Web Services Framework (which ID is "WS-I"). Please note, that Basic Web Services framework does NOT support this method. Instead, one must send complete SOAP envelopes using SubmitL(CSenSoapEnvelope&). So, currently this method is supported only in ID-WSF.
|
|
|
Submit a synchronous request to a service (in ID-WSF, the SOAP message Body) and receive a response as XML. There are two default frameworks available - the Identity Based Web Service Framework (which ID is "ID-WSF") and the Basic Web Services Framework (which ID is "WS-I"). Please note, that Basic Web Services framework does NOT support this method. Instead, one must send complete SOAP envelopes using SubmitL(CSenSoapEnvelope&). So, currently this method is supported only in ID-WSF.
|
|
Stops application level transaction by resetting the "refToMessageId". After stopping a transaction the next message will have no "refToMessageId"
|
|
|