Tengo dos archivos
servicioweb.php
Código HTML:
<?php
require_once('lib/nusoap.php');
$server = new soap_server;
$ns="http://192.168.23.203:8888/soap/"; // espacio de nombres; Sitio donde estara alojado el web service
$server->configureWSDL('CanadaTaxCalculator',$ns); //nombre del web service
$server->wsdl->schematargetnamespace=$ns;
$server->register('CalculateOntarioTax',array('amount' => 'xsd:string' ),array('return' => 'xsd:string'),$ns);
/*METODO DEL WEB SERVICE*/
function CalculateOntarioTax($amount){
$taxcalc=$amount*0.15;
return new SoapVar('return','xsd:string',$taxcalc);
}
/******PROCESA LA SOLICITUD Y DEVUELVE LA RESPUESTA*******/
$server->service($HTTP_RAW_POST_DATA);
?>
Código HTML:
<?php require_once('lib/nusoap.php'); $wsdl="http://192.168.23.203:8888/soap/servicioweb.php?wsdl"; $client= new nusoap_client($wsdl,"wsdl"); $param=array("amount"=>'1'); $responde=$client->call('CalculateOntarioTax',$param); echo"<pre>"; print_r($responde); echo"</pre>"; ?>
Si alguien me puede ayudar.
Un saludo.