This is the result of the my var_dump functions:
echo "<pre>"; var_dump($client->__getFunctions()); echo "</pre>";
array(10) {
[0]=>
string(34) "Read_Result Read(Read $parameters)"
[1]=>
string(55) "ReadByRecId_Result ReadByRecId(ReadByRecId $parameters)"
[2]=>
string(58) "ReadMultiple_Result ReadMultiple(ReadMultiple $parameters)"
[3]=>
string(49) "IsUpdated_Result IsUpdated(IsUpdated $parameters)"
[4]=>
string(67) "GetRecIdFromKey_Result GetRecIdFromKey(GetRecIdFromKey $parameters)"
[5]=>
string(40) "Create_Result Create(Create $parameters)"
[6]=>
string(64) "CreateMultiple_Result CreateMultiple(CreateMultiple $parameters)"
[7]=>
string(40) "Update_Result Update(Update $parameters)"
[8]=>
string(64) "UpdateMultiple_Result UpdateMultiple(UpdateMultiple $parameters)"
[9]=>
string(40) "Delete_Result Delete(Delete $parameters)"
}
I tried to call the read methods, like this:
$client->__soapCall("Read" , array('No'=>'142JC242'));
Actually I don't understand what is "Read_Result" ? and Read(Read $parameters) ?. and how do I used them ? thx
Now I'm getting this : Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in...
You have methods:
Each method accepts $parameters
and returns METHODNAME_Result
value. That’s it. To call method you might try smth like:
$client->__soapCall("ReadMultiple", array());
At this point we have no clue what parameters are expected by the methods. Where do you get this endpoint from? Was there kinda documentation?
If you want to understand the WSDL file, I would recommend spending some time familiarising yourself with XML Schemas. You can see from the <definitions>
tag that this is a WSDL 1 file:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" ... >
The WSDL 1.2 specification can be obtained here:
http://www.w3.org/TR/2003/WD-wsdl12-20030303/
When you instantiate a SoapClient
, you can either use it in WSDL or non-WSDL mode. In this case, since you have a WSDL file, you can use it in WSDL mode.
The WSDL file provides a specification of the methods that the service provides. You can directly call the function names as methods of the SoapClient, so for example:
$client->Read($params);
will call the Read operation.
If you look at this section of the WSDL:
<operation name="Read">
<input name="Read" message="tns:Read"/>
<output name="Read_Result" message="tns:Read_Result"/>
</operation>
You'll see that that the Read operation expects an incoming parameter defined by Read
and will return a response defined by Read_Result
.
My response is not intended to be comprehensive, but I hope you have enough information to get going.