我正在开发一个 iPad 应用程序,它将使用 WCF 服务 HTTPS(可能使用 SOAP )。
我在 iPad 上使用 NSURLConnection 连接到 HTTP Web 服务并且工作正常。但 WCF 服务将使用 HTTPS。 WCF 作为一些不同的配置(例如安全模式:Transport、Message 和 TransportWithMessageCredential)。
iPad 使用 HTTPS 使用 WCF 服务是否有任何限制?最好的方法是什么?
最佳答案
您可以使用 NSURLConnection 本身。如果您想在连接到服务器时处理安全凭证,则必须查看以下方法,
- (BOOL)connection:(NSURLConnection *)conn canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
- (void)connection:(NSURLConnection *)conn didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
以下 Apple 的示例项目将为您提供帮助,
http://developer.apple.com/library/ios/#samplecode/AdvancedURLConnections/Introduction/Intro.html
关于iOS 使用 HTTPS 使用 WCF 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8355832/