source: trunk/data/module/SOAP/example/stockquote.php @ 18562

Revision 18562, 2.3 KB checked in by kajiwara, 14 years ago (diff)

EC-CUBE Ver2.4.3 分コミット。詳細はこちら( http://www.ec-cube.net/release/detail.php?release_id=210

Line 
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.7 2005/03/10 23:16:40 yunosh Exp $
22//
23// include soap client class
24include("SOAP/Client.php");
25
26print "<br>\n<strong>wsdl:</strong>";
27$wsdl = new SOAP_WSDL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
28$soapclient = $wsdl->getProxy();
29print_r($soapclient->getQuote("ibm"));
30print "\n\n";
31
32if (extension_loaded('overload')) {
33    print "\n<br><strong>overloaded:</strong>";
34    $ret = $soapclient->getQuote("ibm");
35    print_r($ret);
36    print "\n\n";
37}
38unset($soapclient);
39
40print "\n<br><strong>non wsdl:</strong>";
41$soapclient = new SOAP_Client("http://services.xmethods.net:80/soap");
42$namespace = "urn:xmethods-delayed-quotes";
43/**
44 * some soap servers require a Soapaction http header.  PEAR::SOAP does
45 * not use them in any way, other to send them if you supply them.
46 * soapaction is deprecated in later SOAP versions.
47 */
48$soapaction = "urn:xmethods-delayed-quotes#getQuote";
49$ret = $soapclient->call("getQuote",array("symbol"=>"ibm"),$namespace,$soapaction);
50print_r($ret);
51print "\n\n";
52unset($soapclient);
53
54?>
55</html></body>
Note: See TracBrowser for help on using the repository browser.