2010-02-09 65 views
4

我们是一个.Net商店,目前正在开发一个iPhone应用程序,要求应用程序调用WCF Web服务。我们的WCF服务使用x509证书进行安全认证。使用证书认证的iPhone Web服务调用WCF服务

我一直在寻找互联网的例子就如何做到以下几点:

  1. 部署有一个iPhone应用程序的证书。
  2. 在对WCF服务的Web服务调用中使用该证书。

任何有关如何完成这一任务的深入了解将不胜感激。

+0

重复:http://stackoverflow.com/questions/2244764/iphone-web -service通话到WCF的服务与证书认证 – Matthieu

回答

0

可以在异步模式下使用NSURLConnection API。您需要使用NSURLConnectionDelegate协议(http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate)来实现一个对象。

当服务器对证书提出质疑时,代理将收到关于方法connection:didReceiveAuthenticationChallenge:的调用。

请参阅网址加载系统(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)

苹果指南从包加载SSL证书看到这个StackOverflow answer