PHP program to temperature conversion web service.
'100'); // 2. create an array
$wsdl="https://www.w3schools.com/xml/tempconvert.asmx?WSDL";
$soapClient = new nusoap_client($wsdl, true); // 3. create a soapClient object
print_r($request);
$result = $soapClient->call( // 4. use the call method from the soapClient object
'FahrenheitToCelsius', // 5. the method name from the shakespeare web service
$request, // 6. the Request tag parameter for the method defined above
'https://www.w3schools.com/xml/', // 7. the namespace
'https://www.w3schools.com/xml/FahrenheitToCelsius' // 8. the soapaction
);
echo 'Tempconvert 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 with 'htmlspecialchars'
echo 'Request
';
echo '' . htmlspecialchars($soapClient->request, ENT_QUOTES) . '
';
echo 'Response
';
echo '' . htmlspecialchars($soapClient->response, ENT_QUOTES) . '
';
?>