Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/297.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#_Php_Wcf_Soap_Action - Fatal编程技术网

C# 对某些WCF方法的SOAP请求不起作用

C# 对某些WCF方法的SOAP请求不起作用,c#,php,wcf,soap,action,C#,Php,Wcf,Soap,Action,PHP客户端接受我的WCF服务的WSDL。例如,有两种方法-GetEntityTypeList和GetPermissions。。。。PHP客户端发送两个SOAP请求 对于GetEntityTypeList: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.mywork.com/BusinessEntity" xmlns:ns2="http:

PHP客户端接受我的WCF服务的WSDL。例如,有两种方法-GetEntityTypeList和GetPermissions。。。。PHP客户端发送两个SOAP请求

对于GetEntityTypeList:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.mywork.com/BusinessEntity" xmlns:ns2="http://www.mywork.com">
  <SOAP-ENV:Header>
    <ApplicationServer>
      <SessionId>25872680517</SessionId>
    </ApplicationServer>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:GetEntityTypeList/>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
对于GetPermissions…:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.mywork.com/BusinessEntity" xmlns:ns2="http://www.mywork.com">
  <SOAP-ENV:Header>
    <ApplicationServer>
      <SessionId>25872680517</SessionId>
    </ApplicationServer>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:GetPermissions>
      <ns1:type>1</ns1:type>
      <ns1:id>1</ns1:id>
    </ns1:GetPermissions>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
然后WCF服务器捕获第一个请求,如下所示:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.mywork.com/BusinessEntity" xmlns:ns2="http://www.mywork.com">
  <SOAP-ENV:Header>
    <ApplicationServer xmlns="http://www.mywork.com/">
      <SessionId>25872680517</SessionId>
    </ApplicationServer>
    <To SOAP-ENV:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://10.128.240.23:55564/BusinessEntityServer/IEntityType</To>
    <Action SOAP-ENV:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://www.mywork.com/BusinessEntity/IEntityType/GetEntityTypeList</Action>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:GetEntityTypeList />
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
正如您所看到的,还有两个额外的块到和操作。第一个请求很好。 但是第二个请求没有到达服务器。PHP客户端捕获异常:

由于EndpointDispatcher上的ContractFilter不匹配,无法在接收方处理带有操作的消息。这可能是因为发送方和接收方之间的契约不匹配操作或发送方和接收方之间的绑定/安全不匹配。检查发送方和接收方是否具有相同的合同和相同的绑定,包括安全要求,例如消息、传输、无

为什么?


如果需要,我将显示WSDL。

您在WCF服务上使用的是什么绑定?客户端在调用这两个操作时是否使用相同的绑定?我使用的是BasicHttpBinding。PHP正在使用SOAP1.1。我不知道PHP开发人员做了什么,但现在每个方法都可以正常工作。我认为这取决于PHP端缓存。