Mac(或 c++)连接到二进制 WCF [英] Mac (or c++) connection to binary WCF

查看:39
本文介绍了Mac(或 c++)连接到二进制 WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 TCP/IP (netTcpBinding) 托管的 WCF 服务:

I've got a WCF service being hosted using TCP/IP (netTcpBinding):

var baseWcfAddress = getWcfBaseUri();
host = new ServiceHost(wcfSingleton, baseWcfAddress);

var throttlingBehavior = new System.ServiceModel.Description.ServiceThrottlingBehavior();
throttlingBehavior.MaxConcurrentCalls = Int32.MaxValue;
throttlingBehavior.MaxConcurrentInstances = Int32.MaxValue;
throttlingBehavior.MaxConcurrentSessions = Int32.MaxValue;
host.Description.Behaviors.Add(throttlingBehavior);

host.Open();

我想用 Objective C 或 C++ 编写一个 Mac 客户端.是否有任何现有的类可以促进与我的 WCF 服务的连接?如果没有,我的步骤是什么?实现它的选项?

I'd like to write a Mac client in Objective C or C++. Are there any existing classes that can facilitate the connection to my WCF service? If not, what are my steps & options to making it happen?

推荐答案

每个以 net 开头的绑定都被认为是不可互操作的.即使没有 WCF 的纯 .NET 客户端也无法通过重新实现整个二进制协议和编码而无需付出巨大努力来与服务通信.您可能应该从以下内容开始:

Every binding starting with net is considered as not interoperable. Even pure .NET client without WCF is not able to communicate with the service without enormous effort by reimplementing whole binary protocol and encoding. You should probably start with:

Mac 的选项是使用 Mono,它应该支持 netTcpBinding.

Your option for Mac is using Mono which should have support for netTcpBinding.

在 Mac 上使用 Objective-C/C++ 的真正选择是创建可互操作的 WCF 服务,通过 HTTP 公开数据.如果您不是该服务的所有者,您可以创建路由 WCF 服务,该服务将是 bridge 在可互操作的 HTTP 和 netTCP 之间.

Your real option for Objective-C / C++ on Mac is creating interoperable WCF service exposing data over HTTP. If you are not the owner of the service you can create routing WCF service which will be bridge between interoperable HTTP and netTCP.

还有一件事 - 如果服务使用带有默认配置的 netTcpBinding,它会受到 Windows 安全性的保护.我希望它可以成为 Mac 上的另一个亮点.

One more thing - if the service uses netTcpBinding with default configuration it is secured with windows security. I expect that it can be another show stopper on Mac.

这篇关于Mac(或 c++)连接到二进制 WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆