那你为什么客户端不用WCF呢,会简单很多。WCF支持下列binding Name Transport Encoding Interoperable BasicHttpBinding HTTP/HTTPS Text, MTOM Yes NetTcpBinding TCP Binary No NetPeerTcpBinding P2P Binary No NetNamedPipeBinding IPC Binary No WSHttpBinding HTTP/HTTPS Text, MTOM Yes WSFederationHttpBinding HTTP/HTTPS Text, MTOM Yes WSDualHttpBinding HTTP Text, MTOM Yes NetMsmqBinding MSMQ Binary No MsmqIntegrationBinding MSMQ Binary Yes看起来NetTcpBinding最符合你的需要,可是 Having a text-based encoding enables a WCF service (or client) to communicate over HTTP with any other service (or client) regardless of its technology. Binary encoding over TCP or IPC yields the best performance but at the expense of interoperability, by mandating WCF-to-WCF communication.binary只支持WCF-to-WCF,除非你自己用C++实现一个WCF
You'll basically need to create the request exactly as the server would expect, and parse the response afterwards. There's some information here: http://blogs.msdn.com/carlosfigueira/archive/2008/01/13/writing-custom-requests-to-simple-wcf-services.aspx
C++发送多少个字节,WCF服务端能接收多少个字节,只要这个功能就可以了。
Name Transport Encoding Interoperable
BasicHttpBinding HTTP/HTTPS Text, MTOM Yes
NetTcpBinding TCP Binary No
NetPeerTcpBinding P2P Binary No
NetNamedPipeBinding IPC Binary No
WSHttpBinding HTTP/HTTPS Text, MTOM Yes
WSFederationHttpBinding HTTP/HTTPS Text, MTOM Yes
WSDualHttpBinding HTTP Text, MTOM Yes
NetMsmqBinding MSMQ Binary No
MsmqIntegrationBinding MSMQ Binary Yes看起来NetTcpBinding最符合你的需要,可是
Having a text-based encoding enables a WCF service (or client) to communicate over HTTP with any other service (or client) regardless of its technology. Binary encoding over TCP or IPC yields the best performance but at the expense of interoperability, by mandating WCF-to-WCF communication.binary只支持WCF-to-WCF,除非你自己用C++实现一个WCF
牛人解答啊