我有一个类似于以下结构的wsdl文件
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:not="http://notification.ws.api.com/">
<soapenv:Header/>
<soapenv:Body>
<not:getNotificationWS>
<!--Optional:-->
<notification>
<!--Zero or more repetitions:-->
<notificationList>
<!--Optional:-->
<email>?</email>
<!--Optional:-->
<phone>?</phone>
<userId>?</userId>
</notificationList>
</notification>
</not:getNotificationWS>
</soapenv:Body>
</soapenv:Envelope>
我在我的php中通过soap调用上面的wsdl,下面是我试图调用上面的wsdl的soapcall。
$response = new SoapClient("http://127.0.0.1:8080/API/ws/TESTWS?wsdl");
try{
$soapstr = $response->__soapCall("getNotificationWS",array("parameters" => array( 'email' => "google@gmail.com",
'phone' => "1111111",
'userId' => "100"
)));
echo print_r($soapstr);
}catch (Exception $e){
echo $e->getMessage();
}
我没有收到任何输出或错误。我打印我的最后一个请求它返回下面的xml
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://notification.ws.api.easymed.com/">
<SOAP-ENV:Body>
<ns1:getNotificationWS />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
如何在php中的soap请求中发送数据建议我。
答案 0 :(得分:0)
无法在xml中看到您的'参数'。您不使用notificationList
的通知array ( 'notification' => array ( 'notificationList' => array ( 'phone' => 1111, 'userId' => 999 ) ) )