码迷,mamicode.com
首页 > 其他好文 > 详细

WCF传byte[]的方法

时间:2016-03-12 23:12:58      阅读:304      评论:0      收藏:0      [点我收藏+]

标签: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传byte[]的方法

标签:wcf   mtom   byte[]   wsdualhttpbinding   wshttpbinding   

原文地址:http://11225176.blog.51cto.com/11215176/1750294

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!