Zend Soap:SoapFault:本地主机上的错误请求

时间:2018-08-28 10:00:48

标签: php soap yii2 wsdl zend-soap

我正在尝试在本地计算机上创建和测试SOAP服务。

我有以下wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://api.eliqaat.local/api" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Eliqaat" targetNamespace="http://api.eliqaat.local/api">
   <types>
      <xsd:schema targetNamespace="http://api.eliqaat.local/api">
         <xsd:element name="eventCreate">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="params" type="xsd:anyType" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:schema>
   </types>
   <portType name="EliqaatPort">
      <operation name="eventCreate">
         <documentation>eventCreate</documentation>
         <input message="tns:eventCreateIn" />
      </operation>
   </portType>
   <binding name="EliqaatBinding" type="tns:EliqaatPort">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      <operation name="eventCreate">
         <soap:operation soapAction="http://api.eliqaat.local/api#eventCreate" />
         <input>
            <soap:body use="literal" />
         </input>
      </operation>
   </binding>
   <service name="EliqaatService">
      <port name="EliqaatPort" binding="tns:EliqaatBinding">
         <soap:address location="http://api.eliqaat.local/api" />
      </port>
   </service>
   <message name="eventCreateIn">
      <part name="parameters" element="tns:eventCreate" />
   </message>
</definitions>

我还使用Zend Soap设置了一个客户端,但是即使编码和参数似乎都很好,客户端也会抛出“ Bad Request”错误。服务器日志中也没有任何内容。这是我正在与客户尝试的事情:

$client = new Client(Yii::$app->urlManager- 
>createAbsoluteUrl('api').'?wsdl',['soap_version'=>SOAP_1_2, 
'cache_wsdl'=>false]);

$result = $client->eventCreate(array('params'=>['yes'=>'no']));

echo $result->eventCreateResult;

运行客户端时会得到什么:

  

0-文件/home/rizwan/Projects/eliqaat.local/vendor/zendframework/zend-soap/src/Client.php中第1038行的错误请求

怎么了?

0 个答案:

没有答案