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消息传输优化机制

  • 相关阅读:
    周末复习所接触到的知识点
    新增一些需要记住的知识点和坑
    讨厌烦人的编码问题''
    dictionary 字典相关操作
    一些列表的基础知识和操作
    简单字符串语句
    一些简单的str语句
    c#学习之前言
    第六课时之HTML标题
    第五课时之HTML属性
  • 原文地址:https://www.cnblogs.com/hofmann/p/14324995.html
Copyright © 2011-2022 走看看