Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Array to string conversion error when making soap request

Tags:

php

soap

wsdl

I'm doing a simple request like this

        $wsdl = "http://.../wsdl/FileArchive";
        $client = new SoapClient($wsdl);


        $parameters= array(
                        "FileName" => "file.jpg"
                       );

        $values = $client->GetFileInfo($parameters);

I'm getting "Array to string conversion" where the GetFileInfo method is being called.

The method is defined in wsdl like this :

<message name="GetFileInfo0Request">
<part name="FileName" type="xs:string"/>
</message>

I've searched for it, and found out it could occur when there is some complex type, but here is just a string. What could be the problem?

like image 257
DropDropped Avatar asked Feb 21 '26 06:02

DropDropped


1 Answers

Rather than this $values = $client->GetFileInfo($parameters);

Try this instead: $values = $client->__soapCall('GetFileInfo', $parameters);

like image 67
NaijaProgrammer Avatar answered Feb 23 '26 09:02

NaijaProgrammer