简体   繁体   English

如何使用非托管C ++消耗进程内WCF服务

[英]How to consume in-process WCF services from unmanaged C++

I have some WCF services running over HTTP and a C++ client using gSOAP to consume them. 我有一些通过HTTP运行的WCF服务,以及使用gSOAP消耗它们的C ++客户端。 This works, but we are considering running the service host in the same process as the client, to create a fully local stack. 这可行,但是我们正在考虑以与客户端相同的过程运行服务主机,以创建完全本地的堆栈。

What is the best way to allow the C++ client to consume these services? 允许C ++客户端使用这些服务的最佳方法是什么? Do we still need to use HTTP binding? 我们还需要使用HTTP绑定吗? Or will something like named pipes or NullTransport work? 还是像命名管道或NullTransport这样的东西可以工作? Preferably something that will work with gSOAP or something that we can replace gSOAP with. 最好是可以与gSOAP一起使用的东西,或者可以用gSOAP替换的东西。

if both are in the same process then have them "talk" to each other via direct means. 如果两者都在同一过程中,则可以通过直接方式使它们彼此“交谈”。 ie accessing objects directly. 即直接访问对象。 otherwise going over a comms layer is extremely expensive. 否则,通过通讯层将非常昂贵。 the same can be said for accessing files on your hard drive via a network share when really going file say c:\\foo\\something.txt is more productive. 当真正运行的文件说c:\\ foo \\ something.txt更具生产力时,通过网络共享访问硬盘驱动器上的文件也可以这么说。

c++ allows you to construct CLR types that are both native code but also CLR-aware. c ++允许您构造既是本机代码又是CLR感知的CLR类型。 using this technique allows your c++.NET type so to speak from .NET proper. 使用这种技术可以使您的c ++。NET类型从.NET本身可以说出来。 your .NET types will have no idea that they are invoking c++ or vice versa. 您的.NET类型不会知道它们正在调用c ++,反之亦然。

have a look in your c++ compiler settings for CLR 看一下CLR的c ++编译器设置

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

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