php soap 调用获取返回信息

php soap 调用获取返回信息,trace soap message,获取 soap返回信息,代码如下:

  1. <?php
  2. $ws = "http://www.phpfensi.com/sd/2001/temperatureservice.wsdl";
  3. $zipcode = "23590";
  4. $client = new soapclient($ws,array('trace' => 1));
  5. $temperature = $client->gettemp($zipcode);
  6. echo htmlspecialchars($client->__getlastrequest());
  7. ?>

得到函数原型从wsd,代码如下:

  1. <?php
  2. $ws = "http://www.www.phpfensi.com/sd/2001/temperatureservice.wsdl";
  3. $client = new soapclient($ws);
  4. var_dump($client->__getfunctions());
  5. ?>
  6. <?php
  7. $ws = "http://www.phpfensi.com/sd/2001/temperatureservice.wsdl";
  8. $zipcode = "12312";
  9. $client = new soapclient($ws,array('trace' => 1));
  10. $temperature = $client->gettemp($zipcode);
  11. echo htmlspecialchars($client->__getlastresponse());
  12. ?>