這是一個非常有用的庫,進入該頁面並下載: http://sourceforge.net/projects/nusoap/files/
這裏是由開發商提供的一個例子:
require_once('lib/nusoap.php');
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$client = new soapclient('http://www.xignite.com/xquotes.asmx?WSDL', true,
$proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
// Doc/lit parameters get wrapped
$param = array('Symbol' => 'IBM');
$result = $client->call('GetQuickQuotes', array('parameters' => $param), '', '', false, true);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
含有「緊急問題!!!!! One !! 11',PLZ GIMME TEH CODEZ儘快在StackOverflow上被認爲是非建設性的。 – 2012-08-17 06:18:32
http://whathaveyoutried.com/ – pduersteler 2012-08-17 06:19:28
這很有趣。我搜索了谷歌,這是我的第一個結果:http://php.net/manual/en/soapclient.getlastresponse.php – Phil 2012-08-17 06:22:26