简体   繁体   English

Magento SOAP V2错误(catalogInventoryStockItemList)

[英]Magento SOAP V2 error (catalogInventoryStockItemList)

I have an array with some products SKU called "items_estoque", which I fill in a loop from a specific DataTable called "dt": 我有一个数组,其中包含一些产品SKU,称为“ items_estoque”,我从名为“ dt”的特定数据表中填充了一个循环:

Dim items_estoque(0) As String
For Each linha As DataRow In dt.Rows
   If Not IsDBNull(linha("codigo_magento")) Then
       i += 1
       ReDim Preserve items_estoque(i)
       items_estoque(i) = linha("codigo_magento")
   End If
Next

I then call the Magento API using the " catalogInventoryStockItemList " function: 然后,我使用“ catalogInventoryStockItemList ”函数调用Magento API:

Dim estoque = magentoV2_servico.catalogInventoryStockItemList(magentoV2_sessao, items_estoque)
For Each item As MagentoV2_Temp.catalogInventoryStockItemEntity In estoque
    'Do stuff
Next

And almost everytime I do this, I get an undefined error, independet of the SKU or array length. 几乎每次执行此操作时,都会得到一个不确定的错误,与SKU或数组长度无关。 This is an example of the array content. 这是数组内容的一个示例。

The weird thing is that, if I before trying to get those two specific products from the example, make a random call using " catalogProductList ", like ( Dim produtos = magentoV2_servico.catalogProductList(magentoV2_sessao, filters, "") ), I can then normaly go back to that same " catalogInventoryStockItemList " function and it will work. 奇怪的是,如果在尝试从示例中获取这两个特定产品之前,请使用“ catalogProductList ”进行随机调用,例如( Dim produtos = magentoV2_servico.catalogProductList(magentoV2_sessao, filters, "") ), 我可以通常返回到相同的“ catalogInventoryStockItemList ”函数,它将起作用。

Why does that happen and, please, how can I solve it? 为什么会发生这种情况,请如何解决?

Thanks 谢谢

Okay, forget about it, it turns out it was just a wrong variable in my login parameters (that took me one and a half days to find). 好的,算了吧,原来这只是我的登录参数中的一个错误变量(花了我半天的时间才找到)。 I'll leave the question here anyway because it's a little hard to find material about this API around 无论如何,我都会将问题留在这里,因为很难找到有关此API的资料

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM