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

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

问题描述

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

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

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

host.Open();

我想在Objective C或C ++中编写Mac客户端。有没有任何现有的类,可以方便连接到我的WCF服务?如果没有,我的步骤&

解决方案

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





您对Mac的选择是使用 Mono 支持netTcpBinding。



在Mac上Objective-C / C ++的真正选项是创建可互操作的WCF服务,通过HTTP公开数据。如果您不是服务的所有者,则可以创建路由WCF服务,这将是桥接



还有一件事 - 如果服务使用的是可互操作的HTTP和netTCP。 netTcpBinding 使用默认配置,它使用Windows安全保护。我期望它可以是Mac上的另一个显示塞。


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();

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?

解决方案

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:

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

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.

Edit:

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天全站免登陆