WCF传byte[]的方法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WCF传byte[]的方法相关的知识,希望对你有一定的参考价值。
如果想让WCF传输byte[]数组,那么需要使用Mtom。bingding可以是wsDualHttpBinding (这个用于双工,也就是需要回掉的情形)或 wsHttpBinding.
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="myBinding" messageEncoding="Mtom"/>
</wsDualHttpBinding>
</bindings>
<services>
<service name="WCFParkPacketServiceLibrary.SendParkPacketService" behaviorConfiguration="ParkPacketServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:3330/ParkService/packet/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="myBinding" contract="WCFParkPacketServiceLibrary.ISendParkPacketService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ParkPacketServiceBehavior">
<serviceMetadata httpGetEnabled="False"/>
<serviceDebug includeExceptionDetailInFaults="False"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
以上是关于WCF传byte[]的方法的主要内容,如果未能解决你的问题,请参考以下文章
无法以 GET 类型的方法将字典作为参数传递给 WCF REST 服务