quarta-feira, 24 de fevereiro de 2016

Chamando um WebService SOAP com PHP



thiagovespa.com.br/blog/2012/05/31/chamando-um-webservice-soap-com-php/

Fonte de Estudos Acima

php.net/manual/en/soapclient.soapclient.php


 
$function = 'ConvertTemp';
 
$arguments= array('ConvertTemp' => array(
                        'Temperature'   => 31,
                        'FromUnit'      => 'degreeCelsius',
                        'ToUnit'        => 'degreeFahrenheit'
                ));
$options = array('location' => 'http://www.webservicex.net/ConvertTemperature.asmx');
 
$result = $client->__soapCall($function, $arguments, $options);
 
echo 'Response: ';
print_r($result);
?>

xml version="1.0" encoding="utf-8"?>
  <soap:Body>
    <ConvertTemp xmlns="http://www.webserviceX.NET/">
      <Temperature>double</Temperature>
      <FromUnit>degreeCelsius or degreeFahrenheit or degreeRankine or degreeReaumur or kelvin</FromUnit>
      <ToUnit>degreeCelsius or degreeFahrenheit or degreeRankine or degreeReaumur or kelvin</ToUnit>
    </ConvertTemp>
  </soap:Body>
</soap:Envelope>









Nenhum comentário:

Postar um comentário