When I make a post to Magento in PHP with the following code:
<?php
$options = array(
'cache_wsdl' => 0,
'trace' => 1,
'stream_context' => stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
)));
try {
$client = new SoapClient("https://prevs.vinoseleccion.com/api/soap/?wsdl=1", $options);
$session = $client->login("******", "*****");
$filter = array(
"email" => "carlosbote+2@gmail.com"
);
$customers = $client->call($session, "customer.list", array($filter));
print_r($customers);
$client->endSession($session);
} catch (SoapFault $e) {
var_dump($e->getMessage());
}
?>
I get the XML:
="1.0"="UTF-8"
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:call>
<sessionId xsi:type="xsd:string">2ed9fd8688a6b4fb2c117b9175bf8fa6</sessionId>
<resourcePath xsi:type="xsd:string">customer.list</resourcePath>
<args SOAP-ENC:arrayType="ns2:Map[1]" xsi:type="SOAP-ENC:Array">
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">email</key>
<value xsi:type="xsd:string">carlosbote+2@gmail.com</value>
</item>
</item>
</args>
</ns1:call>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
What I have tried:
When I do something similar in C#:
filter= new string[] { "email", "SERGIOBERTOG@GMAIL.COM" };
var result = ObjMag.call(IdSesion, "customer.list", filer);
I get this broken XML:
="1.0"="UTF-8"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
\
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
\
<q1:call xmlns:q1="urn:Magento">
\
<sessionId xsi:type="xsd:string">5b8da695b73b814099750c409d49a2d1\</sessionId>
\
<resourcePath xsi:type="xsd:string">customer.list\</resourcePath>
\
<args href="#id1" />
\
</q1:call>
\
<q2:Array xmlns:q2="http://schemas.xmlsoap.org/soap/encoding/" id="id1" q2:arrayType="xsd:string[2]">
\
<Item>email\</Item>
\
<Item>SERGIOBERTOG@GMAIL.COM\</Item>
\
</q2:Array>
\
</s:Body>
\
</s:Envelope>