标签:wcf mtom byte[] wsdualhttpbinding wshttpbinding
如果想让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 mtom byte[] wsdualhttpbinding wshttpbinding
原文地址:http://11225176.blog.51cto.com/11215176/1750294