×
Namespaces

Variants
Actions

Configuring the WSF to establish a network connection using a predefined IAP on Symbian

From Nokia Developer Wiki
Jump to: navigation, search



Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 2 (30 Nov 2006)
Last edited: hamishwillee (14 Jun 2012)

Overview

Configuring the WSF to establish a network connection using a predefined IAP

Description

How can I configure the Web Service Framework (WSF) to establish a network connection using a predefined Internet Access Point (IAP) instead of it prompting the user for a IAP selection?
There are two interfaces in the Web Services Framework that allow setting the IAP to be used by the consumer application:

  • MSenProviderPolicy (implemented by CSenXmlServiceDescription) defines a "provider policy" that is a WSF-wide setting, stored in WSF databases, and thus shared with all the actual Web Service Consumers (WSCs) accessing the same services. This policy defines the IAP and the Identity Providers that can be used when connecting to a [remote] provider.
  • MSenConsumerPolicy (implemented by CSenServicePattern) defines a "consumer policy" that is similar in content and intent with the "provider policy" described above but it only applies to the current connection, it is not stored or shared with other applications that might be using the same Web service at the same time.
    The SDK documentation does not mention that the provider policies are currently not fully implemented and as such they are not functional. In order to define the IAP to be used by the framework you must define a consumer policy through a CSenServicePattern object.
    To apply this to the S60Ex\AddressBook example published with the S60 3rd Edition SDK [FP1], the following changes are needed:
    ...
    TUint32 iMyIap; // predefined IAP selection
    ...
    void CAddressBookEngine::ConnectL()
    {
         /**
          * Original code - unchanged
          */
         _LIT (KConnectL, "CAddressBookEngine::ConnectL()");
         LOG( KConnectL);
         RegisterIdentityProviderL();
         /**
          * Original code, for reference
          *
          * CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();
          * pattern->SetContractL(KPpContract());
          */
         /**
          * Provider policy - not working
          *
          * CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();
          * pattern->SetContractL(KPpContract());
          * pattern->SetIapIdL(iMyIap);
          */
         /**
          * Consumer policy - working solution
          */
         CSenServicePattern* pattern =  CSenServicePattern::NewLC();
         pattern->SetContractL(KPpContract());
         pattern->SetConsumerIapIdL(iMyIap);

         /**
          * Original code - unchanged
          */
         delete iConnection;
         iConnection = NULL;
         iConnection = CSenServiceConnection::NewL(*this, *pattern);
         CleanupStack::PopAndDestroy(pattern);
    }
    Note: On the Series 80 2nd Edition SDK this example is located in Series80Ex\PhonebookEx.
This page was last modified on 14 June 2012, at 07:17.
45 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×