Php 使用Guzzle SOAP请求,但不断接收未设置为对象实例的对象引用

Php 使用Guzzle SOAP请求,但不断接收未设置为对象实例的对象引用,php,laravel,soap,soap-client,guzzle,Php,Laravel,Soap,Soap Client,Guzzle,这是我的函数,供我的guzzle代码在soap API上请求。我一直收到错误“对象引用未设置为对象的实例”。但响应为200。我需要生成QuotationNo 我需要将这些数据发布到外部API数据库 当数据成功发布到数据库时,将创建QuotationNo public function getQuotation() { $factory = new Factory(); $client = $factory->create(new Client(), 'http://som

这是我的函数,供我的guzzle代码在soap API上请求。我一直收到错误“对象引用未设置为对象的实例”。但响应为200。我需要生成QuotationNo

我需要将这些数据发布到外部API数据库

当数据成功发布到数据库时,将创建QuotationNo

public function getQuotation()
{

    $factory = new Factory();
    $client = $factory->create(new Client(), 'http://something.com/GetQuotation/GetQuotation.asmx?WSDL', 
        [
          'stream' => true,
          'stream_context' => [
              'ssl' => [
                  'allow_self_signed' => true
              ],
              'socket' => [
                  'bindto' => 'serveripaddress'
              ]
          ]
        ]
    );
    $data = [
        'param' => [
            'TokenId' => '1pBt8l93-aTX1-E7J6-A6Qx-cWb3Abc84Eg6', 
            'AgentCode' => '30144-36-C', 
            'AgentID' => 'hqrebate', 
            'SumInsured' => 98005, 
            'BasicPrem' => 23006, 
            'ClassCode' => '2-01', 
            'SubClassCode' => '01', 
            'CarRegistrationNo' => 'PGS3881', 
            'InsuredName' => 'Testing Insured', 
            'InsuredIC' => '830711075133', 
            'InsuredEmail' => 'testing@hotmail.com', 
            'InsuredContactNo' => '60123450005', 
            'InsuredAddress1' => '153,', 
            'InsuredAddress2' => 'Jln Persiaran Meranti,', 
            'InsuredAddress3' => 'Bandar Seri Damansara', 
            'InsuredPostcode' => '55220'
        ]  
    ];

    $result = $client->call('GenerateQuotation', $data);

    var_dump($result);
    exit;
}
这是wsdl格式

<wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
        <s:element name="GenerateQuotation">
            <s:complexType>
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="param" type="tns:QuotationReq"/>
                </s:sequence>
            </s:complexType>
        </s:element>
        <s:complexType name="QuotationReq">
            <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="TokenId" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="AgentCode" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="AgentID" type="s:string"/>
                <s:element minOccurs="1" maxOccurs="1" name="SumInsured" type="s:double"/>
                <s:element minOccurs="1" maxOccurs="1" name="BasicPrem" type="s:double"/>
                <s:element minOccurs="0" maxOccurs="1" name="ClassCode" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="SubClassCode" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="CarRegistrationNo" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredName" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredIC" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredEmail" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredContactNo" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredAddress1" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredAddress2" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredAddress3" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="InsuredPostcode" type="s:string"/>
            </s:sequence>
        </s:complexType>
        <s:element name="GenerateQuotationResponse">
            <s:complexType>
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="GenerateQuotationResult" type="tns:QuotationResp"/>
                </s:sequence>
            </s:complexType>
        </s:element>
        <s:complexType name="QuotationResp">
            <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="QuotationNo" type="s:string"/>
                <s:element minOccurs="0" maxOccurs="1" name="ErrorDesc" type="s:string"/>
            </s:sequence>
        </s:complexType>
    </s:schema>
</wsdl:types>

对于那些能够帮助我的人,我非常感谢,因为我已经有一段时间遇到了这个问题。

我只是修改了以下内容: $result=$client->call('GenerateQuotation',$data)

为此: $result=$client->call('GenerateQuotation',[$data])

工作完成了