繁体   English   中英

在Soap调用中将参数传递给php中的wsdl的问题

[英]Issue in passing parameters in soap call to wsdl in php

我有一个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请求中发送数据建议我。

在xml中看不到您的“参数”。 您既不使用通知,也不使用NotificationList

array ( 'notification' => array ( 'notificationList'  => array ( 'phone' => 1111, 'userId' => 999 ) ) )

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM