0

I am attempting to interface with the LendingClub API using SOAP. I've generated some classes using wsdl2php.

The wsdl file can be found here: https://www.lendingclub.com/ws/1.3?wsdl

I've successfully executed 4 of the 5 API methods, but the submit order method results in the following error:

Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: Violation of encoding rules

Code exert (integer IDs replaced by XXXXXX:

$order = new Order();
$order->loanId = XXXXXX;
$order->requestedAmount = 25.00;
$order->portfolioId = XXXXXX;

$order_instruct = new OrderInstruct();
$order_instruct->aid = XXXXXX;
$order_instruct->orders = $order;

$submit_order = new OrderSubmitOrders();
$submit_order->instructs = $order_instruct;
$submit_order_response = $lendingClub->OrderSubmitOrders($submit_order);
var_dump($submit_order_response);

Thanks in advance.

EboMike
  • 76,846
  • 14
  • 164
  • 167

1 Answers1

0
$my_order= new Order();
$my_order->loanId = $soapResponse->result->loans[0]->id;
$my_order->requestedAmount = 'xxx';
$my_order->portfolioId = 'xxxxxxxxx';


$instruct = new OrderInstruct();
$instruct->aid = "xxxxxxxxx";
$instruct->orders = array(my_order);

$orderSubmitObject = new OrderSubmitOrders();
$orderSubmitObject->instructs = $instructs;

$lendingClub->OrderSubmitOrders($orderSubmitObject);