Código:
Me regresa un valor Arrayrequire_once("../lib/nusoap.php"); $ns='http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]; $server = new Soap_Server(); $server->configureWSDL('misServicios',$ns); $server->wsdl->schemaTargetNamespace=$ns; $server->register('ejecutaPrueba', array('sCadenaDePrueba' => 'xsd:string'), array('return' => 'xsd:string'), $ns, $ns."#ejecutaPrueba", 'document', 'literal', 'Devuelve una cadena de respuesta'); function ejecutaPrueba($sCadenaDePrueba) { $sRes = "Hola mundo"; return $sRes; }
Código:
imprime Array y si imprimo $wsdl = "http://localhost/ws/misServicios.php?wsdl"; $client = new soapclient($wsdl, 'wsdl'); $param = array('sCadenaDePrueba' => 'una cadena de texto'); echo $client->call('ejecutaPrueba', $param);
Código:
me imprime 1sizeof($client->call('ejecutaPrueba', $param))
Sin embargo si hago referencia al elemento 0 me arroja error
por ejemplo:
Código:
me responde:$wsdl = "http://localhost/ws/misServicios.php?wsdl"; $client = new soapclient($wsdl, 'wsdl'); $param = array('sCadenaDePrueba' => 'una cadena de texto'); $arrRes = $client->call('ejecutaPrueba', $param); echo ($arrRes[0]);
Notice: Undefined offset: 0 ....
Estaba manejando el estilo 'rpc' con 'encoded' sin embargo cuando lo pretendo utilizar con un cliente de Java (con IDE netbeans) me dice:'rpc encoding not supported', lo cambie a 'document' y con 'literal' lo leyo sin problemas, sin embargo en el cliente de PHP me arroja ke es un array pero no hallo como leerlo.
Por favor, alguien ke me explike, ya ke me super-urge.
¿Que debo hacer para solucionar este asunto?
Saludos y de antemano GRACIAS