SOAP 请求超过 PHP

SOAP Request Over PHP

我试图为 SOAP wsdl 创建请求,请求的请求和响应是:

SOAP 请求:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sub="http://subscriberprovisioning.ws.nvsmx.domain.com/">
<soap:Header/><soap:Body>
<sub:wsGetSubscriberProfileByID><subscriberID>123456789</subscriberID><alternateID></alternateID><parameter1></parameter1><parameter2></parameter2>
</sub:wsGetSubscriberProfileByID></soap:Body></soap:Envelope>

回应

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><ns2:wsGetSubscriberProfileByIDResponse xmlns:ns2="http://subscriberprovisioning.ws.nvsmx.domain.com/">
<return><responseCode>200</responseCode><responseMessage>SUCCESS</responseMessage><subscriberProfile>
<entry><key>SUBSCRIBER_IDENTITY</key><value>123456789</value></entry>
</subscriberProfile></return></ns2:wsGetSubscriberProfileByIDResponse></soap:Body></soap:Envelope>

我正在使用 php 创建请求,代码如下所示:

request.php

<?php

$client = new SoapClient("http://ipnumber:1988/services/Subscriber?wsdl"); 





$param = array('subscriberId' => '123456789');
$response = $client->wsGetSubscriberProfileByID    ($param);

var_dump($response);

在上面的代码中,'subscriberId' => '123456789' 没有传递给 wsdl,我得到了缺少的参数响应。我还使用 SOAP UI 进行了测试,它可以正常工作。对我的 php 代码的任何建议。

谢谢

最终它在这段代码中开始工作:

try{
$soapclient = new SoapClient('http://ipnumber:1988//services/Subscriber?wsdl');
$param=array('subscriberID'=>'123456789');
$response =$soapclient->wsGetSubscriberProfileByID($param);
var_dump($response);
echo '<br><br><br>';
$array = json_decode(json_encode($response), true);
print_r($array);
 echo '<br><br><br>';
      echo '<br><br><br>';
    foreach($array as $item) {
        echo '<pre>'; var_dump($item);
    }  
}catch(Exception $e){
    echo $e->getMessage();
}