SoapClient :: SoapClient():参数无效

时间:2018-03-07 16:28:00

标签: php soap-client

我想用这些代码拨打肥皂:

      $fields = array(
    "Token_param" => array(
        "AMOUNT" => $this->getEncryptedAmount(),
        "CRN" => $this->getEncryptedTrancactionId(),
        "MID" => $this->getEncryptedMerchantId(),
        "REFERALADRESS" => $this->getEncryptedCallbackUrl(),
        "SIGNATURE" => $this->createSignature(),
        "TID" => $this->getEncryptedTerminalId()
    )
);

try {
    $ops = array ('soap' => array(
        'attempts' => 2 // Attempts if soap connection is fail
    ) );
    $soap = new SoapClient($this->serverUrl,$ops, array("stream_context" => stream_context_create(
        array(
            'ssl' => array(
                'verify_peer'       => false,
                'verify_peer_name'  => false,
            )
        )
    )));
    $response = $soap->reservation($fields);

} catch(\SoapFault $e) {
    $this->transactionFailed();
    $this->newLog('SoapFault', $e->getMessage());
    throw $e;
}

但我明白了: SoapClient :: SoapClient():参数无效

我认为肥皂客户端的第二个参数存在问题。

1 个答案:

答案 0 :(得分:0)

构造正确请求的最佳方法是使用WSDL到php sdk,它将指导您构建请求。此外,它还可以帮助您处理响应。

您应该查看PackageGenerator项目。