首页 > 代码库 > PHP SOAP如何传入复杂对象

PHP SOAP如何传入复杂对象

Paymentexpress有一个SOAP服务方法Check3dsEnrollment(String username,String password, EnrolmentCheckRequest transaction).第三个参数是复杂参数,包括如下属性: acmout,cardNumber,dateExpiry,txnDescription,txnRef,currency

在php SOAP中使用数组来传入复杂参数,代码例如下:

    $soapClient = new SoapClient(‘https://www.paymentexpress.com/WSTest/PXWS.asmx?WSDL‘);    $transactionDetails = array(        ‘acmout‘=>‘12.35‘,        ‘cardNumber‘=>‘‘,        ‘dateExpiry‘=>‘1010‘,        ‘txnDescription‘=>‘Payment Test‘,        ‘txnRef‘=>‘PT937459‘,        ‘currency‘=>‘USD‘,    );    $param=array(        ‘postUsername‘       => ‘My_Dev‘,        ‘postPassword‘       => ‘My_Password‘,        ‘transactionDetails‘ => $transactionDetails,    );    $ret  = $soapClient->Check3dsEnrollment($param);    print_r($ret);

 

<script id="FoxLingoJs" type="text/javascript">// </script>