0
我是PHP新手,对web服务不太了解,但是我已经在PHP中编写了代码片段,但它没有显示输出结果,可以请求任何帮助吗?Web服务不能正常工作
下面是代码:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>PHP NuSoap Shakespeare Client</title>
</head>
<body>
<h3>PHP program to access the Shakespeare web service.</h3>
<?php
require_once('lib/nusoap.php');
$request = array('Request'=> 'Winter of our discontent');
$wsdl="http://www.xmlme.com/WSShakespeare.asmx?wsdl";
$soapClient = new soapclient($wsdl, true);
$result = $soapClient->call
(
'Get Speech',
$request,
'http://xmlme.com/WebServices',
'http://xmlme.com.WebServices/GetSpeech');
echo '<h2>Shakespeare Web Service Response from a PHP Client</h2>';
echo '<h2>PHP Array Response</h2>';
print_r($result);
echo '<h2>Request</h2>';
echo '<pre>'.htmlspecialchars($soapClient->request, ENT_QUOTES).'</pre>';
echo '<h2>Response</h2>';
echo '<pre>'.htmlspecialchars($soapClient->response, ENT_QUOTES).'</pre>';
?>
</body>
</html>
* “这是不工作...” *:这句话每一个开发人员,网络管理员和支持高新技术绝对** **恨。我们可以请更多的细节?你会得到什么错误信息?它在哪一行失败? –
当你说它没有显示任何输出时,你的意思是什么print_r($结果)? –
尝试'var_dump($ result);'并向我们显示您的输出。 – evotopid