【发布时间】:2011-07-07 07:00:25
【问题描述】:
我想从 iPhone 使用 .NET 编写的 web 服务,它使用 wsdl 中的 NetTcpBinding 显示。是否可以从 iphone 使用 BasicHttpBinding 以外的 web 服务?如果可能的话,我该如何消费它?
【问题讨论】:
标签: iphone ios wcf web-services nettcpbinding
我想从 iPhone 使用 .NET 编写的 web 服务,它使用 wsdl 中的 NetTcpBinding 显示。是否可以从 iphone 使用 BasicHttpBinding 以外的 web 服务?如果可能的话,我该如何消费它?
【问题讨论】:
标签: iphone ios wcf web-services nettcpbinding
您只能由 WCF 客户端 (= .net) 使用 netTcpBinding 公开的服务。任何其他客户都需要付出巨大的努力才能完成这项工作,因为您必须reimplement WCF's communication protocol。
即使basicHttpBinding 也不是很好的选择,因为iPhone 对SOAP 的支持很差(查看@Franchesca 提供的链接)。最好的选择是使用 REST 服务公开 POX(简单 XML)或带有webHttpBinding 的 JSON,如 @Valery Pavlov 所述。
【讨论】:
我认为没有。您只能使用序列化的数据传输方法进行跨平台系统与服务的交互。您需要为此使用xml或json序列化,以及基于webHttpBinding的wcf服务。
【讨论】:
使用 WCF,可以创建自己的 custom binding。您当然必须在 iPhone 端编写可以反序列化消息等的代码。Here is another question 与此主题相关,可能对您阅读有所帮助。
【讨论】:
使用ASP.NET Web API.的最佳方式
【讨论】: