laravel-soap icon indicating copy to clipboard operation
laravel-soap copied to clipboard

Pass '0' as a string

Open stremshs opened this issue 6 years ago • 1 comments

Hi ! When I'm calling the WS with the param 'gestions'=>'8', it returns results. But when calling it with 'gestions'=>'0' or '1', it returns NO results.

I've tried launching it from SOAP-UI, and it returned many results.

I'm thus suspecting a boolean conversion that messes up everything. How to force my param to be taken as a string ?

I bumped on http://php.net/manual/fr/soapvar.soapvar.php :

$parm = array();
$parm[] = new SoapVar('123', XSD_STRING, null, null, 'customerNo' );
$resp = $client->getStuff( new SoapVar($parm, SOAP_ENC_OBJECT) );

But I can't call SoapVar : it doesn't know the class...

Thanks for your help !

stremshs avatar Feb 22 '19 15:02 stremshs

Have you tried to cast your number into string this way ==> $number = (string) 1; ?

For the fact he doesn't know the class, have you tried to add a backslash before SoapVar ? ==> new \SoapVar()

toto33331 avatar May 11 '21 07:05 toto33331