简体   繁体   中英

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":

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:

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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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