Hola topo_bionico, muchas gracias x responder, basandome en lo que me dices me ha quedado el siguiente codigo que tampoco me funciona pues no me devuelve nada pues cuando la variable llega al WS llega de forma de string y no logro hacer que llegue con el formato XML que es lo que necesito, agradecere muchisimo tu ayuda con esto, aqui esta el codigo:
ws-server.php
Código PHP:
Ver original<?php
require_once 'lib/nusoap.php';
$ns = "http://localhost/yandy/";
$server = new soap_server();
$server->configureWSDL('WmSocioRegistradoImportacion',$ns);
$server->wsdl->schemaTargetNamespace = $ns;
$server->register('ImportarDatos',array('xmlstr' => 'xsd:string'),array('return' => 'xsd:string'),$ns);
function ImportarDatos($xmlstr){
$salida = "";
foreach ($xml->mensaje as $mensaje)
$salida .= $mensaje->texto.' ';
return new soapval('return', 'xsd:string', $salida);
}
if (isset($HTTP_RAW_POST_DATA)) {
$input = $HTTP_RAW_POST_DATA;
}
else
{
}
$server->service($input);
?>
ws-cliente.php
Código PHP:
Ver original<?php
require_once 'lib/nusoap.php';
$wsdl = "http://localhost/yandy/ws-server.php?wsdl";
$cliente = new nusoap_client($wsdl, 'wsdl');
$xmlstr = <<<XML
<?xml version='1.0'?>
<mensajes>
<mensaje>
<asunto>Hola</asunto>
<texto>Hola, que tal?</texto>
</mensaje>
<mensaje>
<asunto>Re: Hola</asunto>
<texto>Bien, gracias.</texto>
</mensaje>
</mensajes>
XML;
$params = array('xmlstr' => $xmlstr); $response = $cliente->call('ImportarDatos', $params);
echo $response;
?>
muchas gracias desde ya
un saludo