-
- sanmic

-
Total Posts: 52
Joined: 2009-12-26
|
Hi,
I’ve have this problem to get a list of orders based from a list of order ids.
Getting just one order based on an orderid is not a problem, but when I have a list it doesn’t work.
Here is my sample code:
public MagentoService.salesOrderListEntity[] getOrdersFromOrderIdList(List<string> orderIdList) { string sessionId; sessionId = helper.GetSessionId();
int i; i = 0;
MagentoService.Mage_Api_Model_Server_V2_HandlerPortTypeClient mage = new MagentoService.Mage_Api_Model_Server_V2_HandlerPortTypeClient(); MagentoService.salesOrderEntity salesOrderEntity = new MagentoService.salesOrderEntity(); MagentoService.salesOrderListEntity[] salesOrderList;
MagentoService.associativeEntity[] ae = new MagentoService.associativeEntity[orderIdList.Count()]; MagentoService.filters filter = new MagentoService.filters(); MagentoService.complexFilter[] orderFilters = new MagentoService.complexFilter[orderIdList.Count()]; foreach (string item in orderIdList) { ae[i] = new MagentoService.associativeEntity(); orderFilters[i] = new MagentoService.complexFilter(); orderFilters[i].key = "increment_id"; ae[i].key = "eq"; ae[i].value = item; orderFilters[i].value = ae[i];
i++; }
filter.complex_filter = orderFilters; salesOrderList = mage.salesOrderList(sessionId, filter); return salesOrderList; }
In PHP it seems like you can put in a string array of orderids, but somehow this can’t be done via SOAP and C#.
|
| |
|
 |
 |
 |
|
|
-
- Opahle

-
Total Posts: 1
Joined: 2011-11-21
|
Hey There,
according to different sources and the poor documentation,
you should use “in” as the filter key instead of “eq” (equals).
then write your ids comma separeted in the value part of your AssociativeEntity.
You should retrieve an entity for every id in value.
Problem I have in C# is, that i only get an entity for the first id back.
Do not know why, yet. But i hope it helps you.
|
| |
-
- Posted: September 20 2012
-
| top
| # 1
-
|
 |
 |
 |
|
|
-
- sanmic

-
Total Posts: 52
Joined: 2009-12-26
|
Thank you, but I cannot get it to work.
Here is the latest test code:
string sessionId;
MagentoService.Mage_Api_Model_Server_V2_HandlerPortTypeClient mage = new MagentoService.Mage_Api_Model_Server_V2_HandlerPortTypeClient(); MagentoService.salesOrderEntity salesOrderEntity = new MagentoService.salesOrderEntity(); MagentoService.salesOrderListEntity[] salesOrderList;
MagentoService.associativeEntity ae; MagentoService.filters filter = new MagentoService.filters(); MagentoService.complexFilter[] orderFilters = new MagentoService.complexFilter[1]; ae = new MagentoService.associativeEntity();
orderFilters[0] = new MagentoService.complexFilter(); orderFilters[0].key = "increment_id"; ae.key = "in"; ae.value = "200001585,200001585,200001582"; orderFilters[0].value = ae; filter.complex_filter = orderFilters;
sessionId = helper.GetSessionId();
salesOrderList = mage.salesOrderList(sessionId, filter);
return salesOrderList;
|
| |
-
- Posted: September 21 2012
-
| top
| # 2
-
|
 |
 |
 |
|
|
-
- Joduk77

-
Total Posts: 3
Joined: 2012-12-07
|
I’m running into the same issue trying to filter salesOrderList
OrderListcFilter(1) = New MagentoService.complexFilter ‘ status
OrderListcFilter(1).key = “status”
OrderListcFilter(1).value = New associativeEntity With {.key = “in”, .value = “Pending, Exported"}
Were you able to confirm that the values are comma delimited in the associativeEntity value?
|
| |
-
- Posted: February 26 2013
-
| top
| # 3
-
|
 |
 |
 |
|
|
-
- sanmic

-
Total Posts: 52
Joined: 2009-12-26
|
I had to give up this piece of code.
Tried every possible combination, but nothing worked.
So, sorry I can’t help you out here.
|
| |
-
- Posted: February 27 2013
-
| top
| # 4
-
|
 |
 |
 |
|
|