Re: Problemas con soapclient.

[email protected] (Carlos Medina)
Newsgroups php.general.es
Organization SimplyNetworks
Message-ID <[email protected]>
Hola Pablo,
Poniendo el error que te da seria muy bueno (no tan cortado). Pienso que
se debe a la forma en que llamas el metodo. Segun lo que he leido el
metodo _call esta "deprecated" por lo que puedes probar usando el nombre
del metodo en cuestion. Asegurate de mandar bien los parametros algo como:

$parametros = array( 'xxx', 'xxx', 'xxx'): // esto es sin los key

$client->sendData( $parametros);

Dime si te sirvio.
Ademas trata de colocarlo usando un try Catch para botar los resultados
de mejor manera.

Saludos

Carlos





Am 14.09.2011 10:06, schrieb Pablo Braulio:
> Hola a todos.
> 
> Tengo montado un webservice y estoy tratando de acceder a sus métodos con
> soapclient, y me encuentro con problemas. Espero me podáis ayudar.
> 
> Tengo la certeza de que el WS está funcionando correctamente, pues acceden a
> él desde otras ubicaciones y con otros lenguajes (creo que java).
> Por otro lado, veo que el método __getFunctions(), me devuelve un array con
> todos los métodos.
> 
> $client= new SoapClient('url/xxx.wsdl', array(
>             'trace'=>1,
>             'encoding'=>'UTF-8'
>         ));
>        var_dump($client->__getFunctions());
> 
> Salida:
> 
> array(5) { [0]=> string(71) "string getUserInfo(string $session, string
> $pswd, int $game, int $room)" [1]=> string(95) "string buyCredit(string
> $session, string $pswd, int $amount, int $game, int $gameId, int $room)"
> [2]=> string(121) "int setLog(string $session, string $pswd, int $game, int
> $amount, int $idSpin, int $idSpinMj, int $room, string $results)" [3]=>
> string(76) "int logout(string $session, string $pswd, int $game, int $room,
> int $gameId)" [4]=> string(61) "string sendData(string $table, string $pswd,
> string $xmlData)" }
> 
> Para acceder al método "sendData", pongo lo siguiente:
> 
> $opciones= array(
>             'table'=>xxx',
>             'pswd'=> 'xxxx',
>             'xmlData'=> 'xxxx'
>         );
> 
>         $client= new SoapClient('url/xx.wsdl', array(
>             'trace'=>1,
>             'encoding'=>'UTF-8'
>         ));
>         $client->__call("sendData", $opciones);
> 
> Siempre me devuelve este error.
> Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Internal Server
> Error in ....php:22 Stack trace: #0 ....php(22):
> SoapClient->__call('sendData', Array) #1
> 
> Este método funciona perfectamente, pues con SOAPUI (como plugin de
> netbeans), lo estoy llamando y se ejecuta bien.
> 
> También he probado poniendo $client->__soapCall("sendData", $opciones); y el
> error es el mismo.
> 
> ¿Alguien podría ayudarme con esto?.
> Muchas gracias.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.