Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.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# WCF-服务引用登录失败,因为soap版本_C#_Web Services_Wcf_Soap - Fatal编程技术网

C# WCF-服务引用登录失败,因为soap版本

C# WCF-服务引用登录失败,因为soap版本,c#,web-services,wcf,soap,C#,Web Services,Wcf,Soap,当我尝试登录到WCF时,会收到错误消息: An exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll but was not handled in user code Additional information: The envelope version of the incoming message (Soap12 (http://www.w3.org/2003/05/

当我尝试登录到WCF时,会收到错误消息:

An exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll but was not handled in user code

Additional information: The envelope version of the incoming message (Soap12 (http://www.w3.org/2003/05/soap-envelope))
does not match that of the encoder (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)).
Make sure the binding is configured with the same version as the expected messages.
我试图按建议解决它

通过替换:

<basicHttpBinding>
    <binding name="LoginServiceSoap" />
</basicHttpBinding>

谢谢。

basicHttpBinding
是SOAP1.1。声明对于
EnveloperVersion
的此绑定,唯一有效的值是“Soap11”

wsHttpBinding
是SOAP 1.2。尝试使用它而不是
basicHttpBinding

<wsHttpBinding>
  <binding name="LoginServiceSoap" />
</wsHttpBinding>

basicHttpBinding
(即SOAP 1.1)切换到
wsHttpBinding
(即SOAP 1.2),或使用自定义绑定。
the "envelopeVersion"attribute is not allowed
<wsHttpBinding>
  <binding name="LoginServiceSoap" />
</wsHttpBinding>