我尝试使用此API获取orderl列表:salesOrderList (SOAP V2),我使用此代码:
env = new SoapSerializationEnvelope(SoapEnvelope.VER11);
env.dotNet = false;
env.xsd = SoapSerializationEnvelope.XSD;
env.enc = SoapSerializationEnvelope.ENC;
SoapObject request = new SoapObject(NAMESPACE,
"salesOrderList");
request.addProperty("sessionId", sessionId);
//request.addProperty("customerId", id.toString());
env.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
androidHttpTransport.call("", env);
result = env.getResponse();
Log.d("order result", result.toString());
和结果:
increment_id=100000001;
store_id=1;
created_at=2013-12-12 07:36:52;
updated_at=2013-12-12 07:36:57;
tax_amount=0.0000;
shipping_amount=0.0000;
discount_amount=0.0000;
subtotal=246.0000;
grand_total=246.0000;
total_qty_ordered=2.0000;
base_tax_amount=0.0000;
base_shipping_amount=0.0000;
base_discount_amount=0.0000;
base_subtotal=246.0000;
base_grand_total=246.0000;
billing_address_id=1;
billing_firstname=?????;
billing_lastname=????;
billing_name=????? ????;
store_to_base_rate=1.0000;
store_to_order_rate=1.0000;
base_to_global_rate=1.0000;
base_to_order_rate=1.0000;
weight=0.0000;
store_name=Main Website
我有很大的问答!结果中没有“customer_id”!如何获得订单客户ID的订单列表?
答案 0 :(得分:1)
当我按照以下方式使用php访问销售订单时
<?php
$client = new SoapClient('http://localhost/magento/index.php/api/v2_soap/index?wsdl=1');
$session = $client->login('testuser','testuser');
$result = $client->salesOrderList($session);
echo "<pre>";
print_r($result);
echo "<pre>";
?>
您将获得以下信息,您可以获得客户ID。
Array
(
[0] => stdClass Object
(
[increment_id] => 100000001
[store_id] => 1
[created_at] => 2013-11-13 18:39:27
[updated_at] => 2013-11-13 18:39:31
[customer_id] => 1
-----
-----
[customer_email] => xyz@example.com