I'm working on a project where we need to extend Magento's SOAP Api--we want to add a method for an existing .NET application using WSI-compliance mode. I don't have access to this .NET application, so I'm trying to use PHP to make WSI-compliant calls into Magento, and I'm having some trouble with PHP's SoapClient
. I can't seem to get a populated filters
array through.
Specifically, I have a small test program that looks like this
$api = new SoapClient(
'http://magento.example.com/index.php/api/v2_soap?wsdl=1',
[
'soap_version'=>SOAP_1_2,
'trace'=>1
]
);
$result = $api->login([
'username'=>'apitest',
'apiKey'=>'apitest1'
]);
$session = $result->result;
$request = [
'sessionId' =>$session,
'filters' => [
'test'=>'foo'
]
];
$result = $api->salesOrderList($request);
var_dump($api->__getLastRequestHeaders());
var_dump($api->__getLastRequest());
var_dump($result);
The program is able to successfully fetch a session id from the server. It's also able to successfully make a salesOrderList
call into the server. However, the program is not able to successfully send a filters
array through. That is, the __getLastRequest
function above returns
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="urn:Magento">
<env:Body>
<ns1:salesOrderListRequestParam>
<sessionId>3590ffdb691bc65498dac32909d24da1</sessionId>
<filters />
</ns1:salesOrderListRequestParam>
</env:Body>
</env:Envelope>
Does anyone know
If it's possible, using the V2 SOAP Api with the WSI-Compliant WSDL, to get a
filters
array through in aSoapClient
call.If not, does anyone know the proper format for the
<filters/>
XML of a SOAP request so I can modify it in a__doRequest
method override.Alternately, is there a composer package that supports the more modern WSI-compliant WSDL? i.e. an alternate
SoapClient
.