简体   繁体   English

如何在 iOs 中消费 NetTcpBinding .NET webservice?

[英]How can consume NetTcpBinding .NET webservice in iOs?

I want to consume a webservice written in .NET from iPhone, it uses NetTcpBinding shows in wsdl.我想从 iPhone 使用用 .NET 编写的 Web 服务,它使用 wsdl 中的 NetTcpBinding 显示。 is it possible to consume webservice other than BasicHttpBinding from iphone?.是否可以从 iphone 使用 BasicHttpBinding 以外的 web 服务? If possible, How can i consume it?.如果可能的话,我该如何消费它?

You can consume service exposed by netTcpBinding only by WCF clients (= .net).您只能通过 WCF 客户端 (= .net) 使用netTcpBinding公开的服务。 Any other client needs enormous effort to make this work because you will have to reimplement WCF's communication protocol .任何其他客户端都需要付出巨大的努力才能完成这项工作,因为您必须重新实现 WCF 的通信协议

Even basicHttpBinding is not very good choice because iPhone has poor support for SOAP (check link provided by @Franchesca).即使basicHttpBinding也不是很好的选择,因为 iPhone 对 SOAP 的支持很差(查看@Franchesca 提供的链接)。 The best choice is using REST service exposing POX (simple XML) or JSON with webHttpBinding as mentioned by @Valery Pavlov.最佳选择是使用 REST 服务公开 POX(简单 XML)或 JSON 和@Valery Pavlov 提到的webHttpBinding

i think no.我想不是。 you can use only serialized data transfer methods for cross-platform system interaction with service.您只能使用序列化数据传输方法进行跨平台系统与服务的交互。 you need to use xml or json serialization for that, with wcf service based on webHttpBinding.您需要为此使用 xml 或 json 序列化,并使用基于 webHttpBinding 的 wcf 服务。

Best way to use ASP.NET Web API.使用ASP.NET Web API.

Reference link http://www.asp.net/web-api参考链接http://www.asp.net/web-api

With WCF, it is possible to create your own custom binding .使用 WCF,可以创建自己的自定义绑定 You will of course have to write code on the iPhone side that can deserialize the messages etc. Here is another question relating to this topic that might be helpful for you to read.您当然必须在 iPhone 端编写可以反序列化消息等的代码。 这是与此主题相关的另一个问题,可能对您阅读有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM