Error in SOAP Request

0

I've been trying to connect to a WSDL, however, without success.

The web service provider passed me a xxx.wsdl file and gave me the credentials for the connection. I've been trying to do the following:

$client = new SoapClient('xxx.wsdl', $credentials); // Array com user e pass

Validate the available functions:

var_dump($client->__getFunctions());

Return me:

TipoDeRetorno minhaFuncao(TipoDeDado dado); 

When I try to execute the function / method it gives error:

$client->minhaFuncao(null); // Dá erro
$client->__call('minhaFuncao', [null]); // Dá erro
$client->__soapCall('minhaFuncao', [null]); // Dá erro

Returns the following error:

SoapFault in MinhaClasse.php line 80:
Server

Only the Server message as an error. Could you help me?

    
asked by anonymous 18.11.2016 / 14:42

1 answer

0
Assuming your code there is exactly as executed, you are passing the wrong data type to the function because minhaFuncao() requires a parameter of type TipoDeDado and will fail if you pass null or array or any another type.

try something like:

// Instancie primeiro um objeto do tipo TipoDeDado
$dados = new TipoDeDado($args);
$client->minhaFuncao($dados);
    
18.11.2016 / 16:41