3

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?

2 Answers 2

11

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

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

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for response, now it doesn't show that error, but "Could not connect to host"...but it should be available.
Does the host require some sort of authentication scheme, like a username and password?
I had the same problem. Does anyone know the reason? Why does it work with __soapCall?
I changed this code: $response = call_user_func_array( array( $this->client, $action ), array( $request ) ); Into this code: $response = $this->client->__soapCall( $action, array( $request ) ); But it did not help, I still get the Notice. $request contains an object!
-2

You must send a simple array.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.