我正在尝试使用 PHP 使用 WCF 服务,但它没有 return 我想要的结果 我哪里出错了

Im trying to consume a WCF service with PHP but it does not return the result i want where do i go wrong

PHP代码如下

$soap = new SoapClient
("http://www.eservices.gov.bw/TolisExternalService/TolisPostService.svc
?singleWsdl",
array('soap_version' => 'SOAP_1_2',
     'location'=>'http://www.eservices.gov.bw/TolisExternalService/TolisPostService.svc'));

 $params = array(
    'licenceNo' => '2018/TEL/E/003'
    );   


$response= $soap->UpdateLevyPayment('$params');
$values = $response->GetAnnualFeeDueDetailsResult;;
var_dump($values);

WCF 代码

link 对于 WCF 服务:http://www.eservices.gov.bw/TolisExternalService/TolisPostService.svc

你可以试试这个:

<?php
// SOAP
$soap = new SoapClient(
    "http://www.eservices.gov.bw/TolisExternalService/TolisPostService.svc?singleWsdl",
    array(
        'soap_version' => 'SOAP_1_2',
        'location'=>'http://www.eservices.gov.bw/TolisExternalService/TolisPostService.svc')
    );


// List functions
echo 'Functions: '.'</br>';
$functions = $soap->__getFunctions();
foreach($functions as $item) {
    echo $item.'</br>';
}
echo '</br>';

// List types
echo 'Types: '.'</br>';
$types = $soap->__getTypes();
foreach($types as $item) {
    echo $item.'</br>';
}
echo '</br>';

// Consume SOAP
$params = array(
    'licenceNo' => '2018/TEL/E/003'
);   
$values = $soap->GetAnnualFeeDueDetails($params);
print_r($values);
?>

注意:使用 PHP 7.1

测试