zoukankan      html  css  js  c++  java
  • wcf messageEncoding="Mtom"

    Client端向远程wcf地址上传文件出现异常,异常内容:

    {"Content Type multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:8ef500df-a89a-4984-ac44-7500f85b0320+id=1";start-info="text/xml" was not supported by service http://10.38.25.87/ContentService.svc.  The client and service bindings may be mismatched."}

    解决办法:

    去掉messageEncoding="Mtom"属性

      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
    <binding name="BasicHttpBinding_ContentService" closeTimeout="00:10:00"
              openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
              textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true" >
                <!--messageEncoding="Mtom"-->
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://10.38.25.87/ContentService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ContentService" contract="ContentService.ContentService" name="BasicHttpBinding_ContentService" />
    
        </client>
      </system.serviceModel>

    参考

      MTOM以及在WCF中的应用

      WCF中使用MTOM消息传输优化机制

  • 相关阅读:
    2019.04.19 坦克大战
    2019.04.18 异常和模块
    2019.04.17 面向对象编程篇207
    fork操作时的copy-on-write策略
    Redis阻塞原因
    Redis持久化-fork操作
    Redis持久化-AOF重写
    Redis持久化-aof
    Redis持久化
    Shopify给左右两边布局的banner图加链接,链接失败
  • 原文地址:https://www.cnblogs.com/hofmann/p/14324995.html
Copyright © 2011-2022 走看看