2013-07-21 173 views
0

我試圖使用SOAP與LendingClub API接口。我已經使用wsdl2php生成了一些類。LendingClub API OrderSubmitOrders action

WSDL文件可以在這裏找到:https://www.lendingclub.com/ws/1.3?wsdl

我已經成功地執行的5種API方法4,但在下面的錯誤提交順序方法的結果:

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

代碼使出(整數ID由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); 

預先感謝

回答

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);