stockquote.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <html><body>
  2. <?
  3. //
  4. // +----------------------------------------------------------------------+
  5. // | PHP Version 4 |
  6. // +----------------------------------------------------------------------+
  7. // | Copyright (c) 1997-2003 The PHP Group |
  8. // +----------------------------------------------------------------------+
  9. // | This source file is subject to version 2.02 of the PHP license, |
  10. // | that is bundled with this package in the file LICENSE, and is |
  11. // | available at through the world-wide-web at |
  12. // | http://www.php.net/license/2_02.txt. |
  13. // | If you did not receive a copy of the PHP license and are unable to |
  14. // | obtain it through the world-wide-web, please send a note to |
  15. // | license@php.net so we can mail you a copy immediately. |
  16. // +----------------------------------------------------------------------+
  17. // | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more |
  18. // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author |
  19. // +----------------------------------------------------------------------+
  20. //
  21. // $Id: stockquote.php,v 1.5 2003/01/04 11:56:21 mj Exp $
  22. //
  23. // include soap client class
  24. include("SOAP/Client.php");
  25. print "<br>\n<strong>wsdl:</strong>";
  26. $wsdl = new SOAP_WSDL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
  27. $soapclient = $wsdl->getProxy();
  28. print_r($soapclient->getQuote("ibm"));
  29. print "\n\n";
  30. if (extension_loaded('overload')) {
  31. print "\n<br><strong>overloaded:</strong>";
  32. $ret = $soapclient->getQuote("ibm");
  33. print_r($ret);
  34. print "\n\n";
  35. }
  36. unset($soapclient);
  37. print "\n<br><strong>non wsdl:</strong>";
  38. $soapclient = new SOAP_Client("http://services.xmethods.net:80/soap");
  39. $namespace = "urn:xmethods-delayed-quotes";
  40. /**
  41. * some soap servers require a Soapaction http header. PEAR::SOAP does
  42. * not use them in any way, other to send them if you supply them.
  43. * soapaction is deprecated in later SOAP versions.
  44. */
  45. $soapaction = "urn:xmethods-delayed-quotes#getQuote";
  46. $ret = $soapclient->call("getQuote",array("symbol"=>"ibm"),$namespace,$soapaction);
  47. print_r($ret);
  48. print "\n\n";
  49. unset($soapclient);
  50. ?>
  51. </html></body>