You Are Here:

Community: Wiki

This page was last modified on 6 August 2009, at 07:57.

完成Web服务的自动认证

From Forum Nokia Wiki

TSS001387


  • 开发伙伴平台:

S60 3rd Edition FP1, S60 3rd Edition FP2


  • 详细描述

Web服务是一个软件系统,用来支持基于网络的机器内部交互操作。它有一个接口用来描述机器可以处理的哦格式(通常为Web Services Description Language - WSDL)

这里S60 Web服务框架(WSF)可以用来直接连接到一个无需认证的基础Web服务,但是如果需要认证,那么当客户端程序试图建立连接时就会弹出一个认证对话框。但我们可以通过在启动连接前执行下列代码避免认证对话框的出现。

  • 解决方案

头文件: Senservicemanager.h, Senidentityprovider.h

链接库: SenServMgr.lib, SenServDesc.lib

需要的能力: ReadUserData, WriteUserData, NetworkServices

// 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

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qfnZuserE5FtagQSx8613881336664X