English 中文(简体)
HowTo: iPhone Web Service call to WCF Service with Certificate Authentication
原标题:

We are a .Net shop currently developing a iPhone app that requires the app to call a WCF web service. Our WCF Services are secured with a x509 certificate for authentication purposes.

I have been searching the internet for an example on how to do the following:

  1. Deploy a certificate with an iPhone app.
  2. Use that certificate in a web service call to a WCF Service.

Any insight on how this might be accomplished would be greatly appreciated.

问题回答

One could use the NSURLConnection API in asynchronous mode. You ll need to implement an object with the NSURLConnectionDelegate protocol (http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate).

The delegate will get a call on the method connection:didReceiveAuthenticationChallenge: when the server challenges for a certificate.

See the Apple guide for the URL loading system (http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)

For loading an SSL cert from the bundle see this StackOverflow answer:





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签