PHP program to access the Shakespeare web service.

'Winter of our discontent '); // 2. create an array $wsdl="http://www.xmlme.com/WSShakespeare.asmx?wsdl"; $soapClient = new nusoap_client($wsdl, true); // 3. create a soapClient object $result = $soapClient->call( // 4. use the call method from the soapClient object 'GetSpeech', // 5. the method name from the shakespeare web service $request, // 6. the Request tag parameter for the method defined above 'http://xmlme.com/WebServices', // 7. the namespace 'http://xmlme.com/WebServices/GetSpeech' // 8. the soapaction ); echo '

Shakespeare Web Service Response from a PHP Client

'; echo '

PHP Array Response

'; print_r($result); // 9. php function that displays an array variable // 10. Display the request and response soap without 'htmlspecialchars' echo '

Request

'; echo '
' . $soapClient->request . '
'; echo '

Response

'; echo '
' . $soapClient->response . '
'; ?>