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>
参考