Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/07/2007, 09:52
Avatar de mveraa
mveraa
 
Fecha de Ingreso: diciembre-2002
Ubicación: santiago-chilito
Mensajes: 1.931
Antigüedad: 21 años, 3 meses
Puntos: 2
Re: Webservice PHP & NuSOAP.

hola maestros yo tambien estoy investigando para hacer algo con webservice, al ejecutar cliente.php me sale la pantalla en blanco(solucione algunos errores que mostraba). ahi puse el codigo como lo uso yo .

¿alguien me orienta en que me equivoco?
saludos,.

nota uso php4(easyphp).


cliente.php
<?php
ini_set('soap.wsdl_cache_enabled', '0');
require_once('nusoap.php');

$oSoap = new soapclient('http://localhost/webservice/prueba2/HolaMundo.php?wdsl');
//$oSoap->setHTTPProxy('10.10.1.2',8080,'cdiaz','cdiaz');
$err = $oSoap->getError();
if ($err)
{
// Display the error
echo '<p><b>Constructor error: ' . $err . '</b></p>';
// At this point, you know the call that follows will fail
}

$dato = $oSoap->call('HolaMundo',array('nombre' => 'Hollman'),'http://localhost/webservice/prueba2/HolaMundo');

if ($oSoap->fault)
{
echo "Error al llamar el metodo<br/>".$oSoap->getError();
}
else
{
echo $dato;
}
?>




holamundo.php
<?php
require_once('nusoap.php');


function HolaMundo ($nombre)
{

return "Hola ".$nombre;
}

$server = new soap_server();
$ns="http://localhost/webservice/prueba2/HolaMundo.php";
$server->configurewsdl('ApplicationServices',$ns);
$server->wsdl->schematargetnamespace=$ns;
$server->register('HolaMundo',array('nombre' => 'xsd:string'),array('return' => 'xsd:string'),$ns);

if (isset($HTTP_RAW_POST_DATA))
{
$input = $HTTP_RAW_POST_DATA;
}
else
{
$input = implode("\r\n", file('php://input'));
}
$server->service($input);
exit;
?>
__________________
"Cuando se adelanta un oponente, enfréntalo y salúdalo; si intenta retroceder, déjalo seguir su camino"