1
I’ve been trying to connect in a WSDL, however, unsuccessfully.
The web service provider gave me a file xxx.wsdl
and passed me the credentials for the connection. I have been trying to do the following:
$client = new SoapClient('xxx.wsdl', $credentials); // Array com user e pass
Validating the available functions:
var_dump($client->__getFunctions());
Call me back:
TipoDeRetorno minhaFuncao(TipoDeDado dado);
When I try to execute the function/method 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 message Server
as mistake. Could help me?
According to the manual: http://php.net/manual/en/class.soapfault.php. and also the documentation https://www.tutorialspoint.com/soap/soap_fault.htm This element is an envelope, try to give a print_r or a
__toString()
– KhaosDoctor
Thank you for commenting @Khaosdoctor, in this case the message
Server
comes in the form of Exception, not as a wsdl message.– Ewerton Melo
minhaFuncao()
demandsTipoDeDado
and you’re passingnull
. That’s right?– Ricardo Moraleida
Placed
null
in the example, but even if you pass an array with the required fields, it gives error!– Ewerton Melo
Contact the WSDL provider to see if the service is actually working properly as it may be some error on the part of the SERVER.
– Rafael Sobreira Braga
To call correctly you have to pass an object instance
TipoDeDado
, not an array.– Ricardo Moraleida