C# 从.net使用java wsdl时内容类型不匹配
在我的c#项目中,有一个托管在远程服务器上的apache或jboss上的wsdl。我在visual studio中添加了一个服务引用,它自动为我生成了一个app.config文件,system.serviceModel部分如下所示C# 从.net使用java wsdl时内容类型不匹配,c#,.net,web-services,wsdl,C#,.net,Web Services,Wsdl,在我的c#项目中,有一个托管在远程服务器上的apache或jboss上的wsdl。我在visual studio中添加了一个服务引用,它自动为我生成了一个app.config文件,system.serviceModel部分如下所示 <system.serviceModel> <bindings> <basicHttpBinding> <binding name="ArtesiaWebServicesHttp
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ArtesiaWebServicesHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="655360" maxBufferPoolSize="524288" maxReceivedMessageSize="655360"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://serverpath/ArtesiaWebServices"
binding="basicHttpBinding" bindingConfiguration="ArtesiaWebServicesHttpBinding"
contract="DAMService.ArtesiaWebServicesInterface" name="ArtesiaWebServicesHttpPort" />
</client>
</system.serviceModel>
在运行时,在方法调用期间,我得到以下错误:
内容类型多部分/相关;type=“application/xop+xml”;start=“”;start info=“text/xml”;响应消息的boundary=“---=\u Part\u 386\u 1206794365.1374255761229”与绑定的内容类型不匹配(text/xml;charset=utf-8)。如果使用自定义编码器,请确保正确实现IsContentTypeSupported方法
可能是什么问题?通过将绑定的messageEncoding属性更改为“Mtom”而不是“Text”来解决问题