×
Namespaces

Variants
Actions

Archived:Implementing Automatic Web Service Authentication using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.


Article Metadata
Tested with
Devices(s): Tested on Nokia N95
Compatibility
Platform(s): S60 3rd Edition FP1, S60 3rd Edition FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
Article
Keywords: CSenServiceManager
Created: User:TechnicalWriter2 (12 Jun 2009)
Last edited: hamishwillee (06 Sep 2012)

Overview

A web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically Web Services Description Language (WSDL)).

The S60 Web Services Framework (WSF) API abstracts the details of connecting to and communicating with a Web service. It also provides helper classes for sending requests and handling the responses of Web services.

Description

A Web Services Consumer (WSC) application can directly connect to a basic Web Service if it does not involve any authentication. However, if authentication is enabled, an authentication dialog is popped whenever the consumer application tries to establish a connection. The authentication dialog can be avoided by using the following code snippet before starting the connection.

Solution

Header Files: Senservicemanager.h, Senidentityprovider.h

Library: SenServMgr.lib, SenServDesc.lib

Required Capabilities: ReadUserData, WriteUserData, NetworkServices

Code:

 // Creating an instance of CSenServiceManager
CSenServiceManager* pManager = CSenServiceManager::NewLC();<br>
// Creating an instance of IdP and registering it. Notice, that endpoint is the<br>// endpoint to the actual Web Service Provider.
CSenIdentityProvider* pIdp = CSenIdentityProvider::NewLC(KWSPEndPoint());<br>
// Set BASIC-AUTH credentials
pIdp->SetUserInfo(KUser, KUser, KPass);<br>
// Set FrameworkID (constant declared in SenServiceConnection.h)
pIdp->SetFrameworkID(KDefaultBasicWebServicesFrameworkID);<br>
TInt error = pManager->RegisterIdentityProviderL(*pIdp);
CleanupStack::PopAndDestroy(2); // pManager, pIdp
This page was last modified on 6 September 2012, at 05:37.
44 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.

×