MTOM Encoding and Custom binding

大兔子大兔子 提交于 2019-12-22 05:38:50

问题


How do I configure custom binding and MTOM encoding? I have a custom binding like given below,

 <customBinding>
        <binding name="stsBinding">
          <security authenticationMode="UserNameOverTransport" 
                    requireDerivedKeys="false"
                    keyEntropyMode="ServerEntropy" 
                    requireSecurityContextCancellation="false"
                    requireSignatureConfirmation="false">
          </security>
          <httpsTransport />
        </binding>
      </customBinding>

And my MTOM binding is like below,

 <basicHttpBinding>
    <binding name="HttpStreaming"
             maxReceivedMessageSize="2147483647"
             messageEncoding="Mtom"
             transferMode="Streamed"/>
  </basicHttpBinding>   

How do I combine this?


回答1:


You have to add message encoding element:

  <customBinding> 
    <binding name="stsBinding"> 
      <security authenticationMode="UserNameOverTransport"  
                requireDerivedKeys="false" 
                keyEntropyMode="ServerEntropy"  
                requireSecurityContextCancellation="false" 
                requireSignatureConfirmation="false"> 
      </security> 
      <mtomMessageEncoding />
      <httpsTransport /> 
    </binding> 
  </customBinding> 



回答2:


This online tool can help convert normal bindings to custom bindings.

Remove any limits like maxBufferSize from the binding, because many of those are not supported by the tool. You can add it after.



来源:https://stackoverflow.com/questions/3638552/mtom-encoding-and-custom-binding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!