source: branches/version-2_11-dev/data/module/SOAP/example/stockquote.php @ 21299

Revision 21299, 1.8 KB checked in by Seasoft, 12 years ago (diff)

#1521 (PEAR::SOAP 配布と異なる部分がある)

  • 新しいバージョンの配布ファイルを上書きすることで解決

#1522 (PEAR::SOAP をバージョンアップ)

  • 0.11.0 -> 0.12.0
  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<html><body>
2<?
3/**
4 * Stockquote client.
5 *
6 * PHP versions 4 and 5
7 *
8 * LICENSE: This source file is subject to version 2.02 of the PHP license,
9 * that is bundled with this package in the file LICENSE, and is available at
10 * through the world-wide-web at http://www.php.net/license/2_02.txt.  If you
11 * did not receive a copy of the PHP license and are unable to obtain it
12 * through the world-wide-web, please send a note to license@php.net so we can
13 * mail you a copy immediately.
14 *
15 * @category   Web Services
16 * @package    SOAP
17 * @author     Shane Caraveo <Shane@Caraveo.com>   Port to PEAR and more
18 * @author     Jan Schneider <jan@horde.org>       Maintenance
19 * @copyright  2003-2007 The PHP Group
20 * @license    http://www.php.net/license/2_02.txt  PHP License 2.02
21 * @link       http://pear.php.net/package/SOAP
22 */
23
24/* Include SOAP_Client class. */
25require_once 'SOAP/Client.php';
26
27echo '<br><strong>wsdl:</strong>';
28$wsdl = new SOAP_WSDL('http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl');
29$soapclient = $wsdl->getProxy();
30$ret = $soapclient->call('getQuote', array('symbol' => 'ibm'));
31print_r($ret);
32
33if (extension_loaded('overload')) {
34    echo '<br><strong>overloaded:</strong>';
35    $ret = $soapclient->getQuote('ibm');
36    print_r($ret);
37}
38
39echo '<br><strong>non wsdl:</strong>';
40$soapclient = new SOAP_Client('http://services.xmethods.net:80/soap');
41$namespace = 'urn:xmethods-delayed-quotes';
42/* Some SOAP servers require a Soapaction HTTP header.  PEAR::SOAP does not
43 * use them in any way, other to send them if you supply them.  soapaction is
44 * deprecated in later SOAP versions. */
45$soapaction = 'urn:xmethods-delayed-quotes#getQuote';
46$ret = $soapclient->call('getQuote',
47                         array('symbol' => 'ibm'),
48                         $namespace,
49                         $soapaction);
50print_r($ret);
51
52?>
53</html></body>
Note: See TracBrowser for help on using the repository browser.