Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从.net使用java wsdl时内容类型不匹配_C#_.net_Web Services_Wsdl - Fatal编程技术网

C# 从.net使用java wsdl时内容类型不匹配

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

在我的c#项目中,有一个托管在远程服务器上的apache或jboss上的wsdl。我在visual studio中添加了一个服务引用,它自动为我生成了一个app.config文件,system.serviceModel部分如下所示

<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”来解决问题