Monday, 11 August 2014

Issue with a SOAP Call in PHP - Can't figure out the correct structure for the parameters



Hi I am trying to send a PHP SOAP call to create a customer in our customerdatabase (in Plentymarkets).


wsdl: http://ift.tt/1lOtaec


documentation of the fuction: http://ift.tt/1stIp3z


However I really can't figure out how to add the required parameters to the call. I used a simpler function ($soapclient->SearchOrders(array('OrderID' => '288064')); and it worked perfectly.


I tried the following but it failed:



$data = array(
'City' => 'Hamburg',
'CountryID' => '2',
'CustomerNumberCity' => '2145895',
'Email' => 'test@test.test',
'FirstName' => 'testing',
'HouseNo' => '15',
'Language' => 'german',
'Street' => 'teststr.',
'Surname' => 'tester',
'ZIP' => '12345',
);

$Customers = new stdClass();
$Customers->PlentySoapObject_AddCustomersCustomer = $data;

var_dump($soapclient->AddCustomers($Customers));


It returned:



object(stdClass)#6 (2) {
["Success"]=>
bool(false)
["ResponseMessages"]=>
object(stdClass)#7 (0) {
}
}


GetLastRequest returned the following body:



<SOAP-ENV:Body>
<ns1:AddCustomers>
<oAddCustomersRequest xsi:type="ns1:PlentySoapRequest_AddCustomers">
<Customers xsi:nil="true"/>
</oAddCustomersRequest>
</ns1:AddCustomers>
</SOAP-ENV:Body>

No comments:

Post a Comment