I am new to PHP, and don't know much about the web services, but I have written a code snippet in PHP, but it is not showing the output, can any body help please?
Here is the code:
<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>
I have some results with this:
$soap_client = new SoapClient("http://www.xmlme.com/WSShakespeare.asmx?WSDL");
$request = array('Request'=> 'To be, or not to be');
$quote = $soap_client->GetSpeech($request);
$speech = $quote->GetSpeechResult;
echo $speech;
I am new to this, but maybe the info helps you further.