我是soapClient,可按如下方式访问Web服务。

$con = new SoapClient('wsdl url');
$array = array("apiRequestDetails" => array(
            "id" => "0000045399",
            "mobile" => "9843484142",
            "pin" => "b59c67bf196a4758191e42f76670ceba",
            "refNumber" => "222",
            "serviceCode" => "23",
            "trxnTraceId" => "1",
            "value" => "200.068879335"

    ));
$det = $con->__call('initiatePayment', $array);
    echo '<pre>';
    print_r($det);


我收到以下错误
致命错误:未捕获的SoapFault异常:D:\ xampp \ htdocs \ sharepoint \ connection.php:25中的[S:Server] java.lang.NullPointerException
堆栈跟踪:

0 D:\ xampp \ htdocs \ sharepoint \ connection.php(25):SoapClient-> __ call('initiatePayment',数组)

1 {main}

在第25行的D:\ xampp \ htdocs \ sharepoint \ connection.php中抛出
谁能告诉我这个错误是什么,我该如何解决。
提前致谢

最佳答案

这是一个未处理的异常。尝试将其包装在try / catch块中以找出错误。同时不建议使用__call(),您应该使用__soapCall()

try{
    $det = $con->__soapCall('initiatePayment', $array);
    print_r($det);
} catch(SoapFault $ex){
    echo $ex->getMessage();
}

10-05 22:01