Web Service Proxy Generator
Re: passing array with proxy generator
You can use the ComArray class to create and manipulate arrays:
http://www.west-wind.com/wsdlgenerator/docs?page=_3m90jxxxm.htm
+++ Rick ---
I'm trying to convert this sample php code into VFP code for a Magento soap request:
$client = new SoapClient('http://example.com/api/soap/?wsdl'); $params = array(array( 'giftvoucher_id'=>array('lt'=>39), 'status'=>array('eq'=>'2')), 'balance'=>array('gteq'=>11.12), 'gift_code'=>array('like'=>'GIFT%') ); $session = $client->login('apiUser', 'apiKey'); $result = $client->call($session, 'giftcard.list', $params); $client->endSession($session);
key for above:
'lt' = '<'
'eq' = '='
'gteq' = '>='
Then the request returns this:
array(2) { [0] => array(22) { ["giftvoucher_id"] => string(2) "36"["gift_code"] => string(2) "ee"["balance"] => string(7) "12.0000"["currency"] => string(3) "USD"["status"] => string(1) "2"["expired_at"] => NULL["customer_id"] => string(1) "0"["customer_name"] => string(0) ""["customer_email"] => string(0) ""["recipient_name"] => string(0) ""["recipient_email"] => string(0) ""["recipient_address"] => NULL["message"] => NULL["store_id"] => string(1) "0"["conditions_serialized"] => string(168) "a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}"["day_to_send"] => NULL["is_sent"] => string(1) "0"["shipped_to_customer"] => string(1) "0"["created_form"] => NULL["template_id"] => string(1) "1"["description"] => NULL["giftvoucher_comments"] => NULL } [1] => array(22) { ["giftvoucher_id"] => string(2) "38"["gift_code"] => string(16) "GIFT-MEOA-DBGHW6"["balance"] => string(7) "12.0000"["currency"] => string(3) "USD"["status"] => string(1) "2"["expired_at"] => NULL["customer_id"] => string(1) "0"["customer_name"] => string(0) ""["customer_email"] => string(0) ""["recipient_name"] => string(0) ""["recipient_email"] => string(0) ""["recipient_address"] => NULL["message"] => NULL["store_id"] => string(1) "0"["conditions_serialized"] => string(168) "a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}"["day_to_send"] => NULL["is_sent"] => string(1) "0"["shipped_to_customer"] => string(1) "0"["created_form"] => NULL["template_id"] => string(1) "1"["description"] => NULL["giftvoucher_comments"] => NULL } }
I've gotten only to the point of creating a session id, but I'm not sure how to pass the parameters need above into an array within the call:
loProxy.call(lSID,"giftcard.list", ???) && how do I create the last arg parameter?
Can you please help me with the correct code to send this call, and to loop through the result returned?
Thanks,
Al
Rick Strahl
West Wind Technologies
Making waves on the Web
West Wind Technologies
from Maui, Hawaii
Making waves on the Web