Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

SOAP API Problems - catalogProductInfo, catalogProductUpdate methods
 
MagentoDotNet
Jr. Member
 
Total Posts:  4
Joined:  2009-12-16
 

Hi,

Could anyone advise on what I might be doing wrong.

I am currently writing a c# class library to integration with v2 of the SOAP API on a vanilla install version 1.3.2 of Magento, it has the standard Main Website, English, French, German site views. I tried the NET C# Object Library for Magento’s XML-RPC API but as the products have a variable number of properties that isn’t known at runtime, and there doesn’t seem to to be a way to build up the product object at runtime I reverted to coding my own against the SOAP api. After some hacking of the WSDL I am able to create a web reference and proxy code to use in my class library.

I am able to create a product. In this example I create a catalogProductCreateEntity with a string sku = “1234”, visibility is Catalog and Search, status is enabled and it published to Main Website. I do this by passing the appropriate values and the catalogProductCreateEntity to the catalogProductCreate method of the SOAP API. This seems to work fine. I can see the product on the ‘Manage Catalog’ section of the website.

Now I need to do the ‘if product exists update, else create functionality’.

I first tried to use the catalogProductInfo method, passing sessionID, a string sku = “1234”, a string “default” for store view (I also tried different options here such as “English"/"French"/"German"/"Admin"/1/2/3) a catalogProductRequestAttributes object with one attribute name ="sku" (I also tried variations here as well), and a string “simple” for the product type. When I run this I recieve 101 error, “product not exists” ( shouldn’t this be “product does not exist").

So I then try the catalogProductList method, passing a filter with one entity having the key = “sku” and value = “1234”, along with sessionId and a string = “default” for store view. Calling this method successfully returns me an array of catalogProductEntity containing my product with sku = “1234”.

Strange, first method says “product not exists”, second method say “product does exists, here is your product”. However it lets me do what I need so I only have to do the last step, update the product if it exists.

For this I use the catalogProductUpdate method on the SOAP API. I pass sessionID, a string = “1234” for sku, the same catalogProductCreateEntity, a string = “simple” for product type and string = “default” for product type. What I get back is the same 101 error, “product not exists” that I got when calling the catalogProductInfo method. ARRRGGGGHHH!!! I know the product exists because magento gave it to me when I called catalogProductList.

I’m banging my head against the wall here. Things I consider I maybe doing wrong are that I don’t really understand what the catalogProductRequestAttributes is used for when calling the catalogProductInfo. I presume it constrains the data that is returned but maybe I’m wrong and I need to do something else with it. Also maybe there is something with store view that I don’t understand.

If anyone has similar experiences or can offer advice I would be grateful.

Thanks,

Richard.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagentoDotNet
Jr. Member
 
Total Posts:  4
Joined:  2009-12-16
 

So I have made some progress with this, I found a page describing a problem regarding types, product ids and sku’s here:

API product IDs vs SKUs

As I described in the first post, I am trying to do 3 things

1. Check if product exists.
2. If product exists, then update product.
3. If product doesn’t exist create new product.

By using test sku’s which contain a combination of characters and numbers I can now do 1 - using either the catalogProductInfo or the catalogProductList method. 3 seemed to work straight out of the box. The last thing is 2, updating the product if it already exists. Now, using either the SKU or product id, I call catalogProductUpdate as described above, and no longer recieve the 101 error, “product not exists”. However the changes in the product do not appear to be applied on Magento, the product stays the same.

Are any of the devs for Magento monitoring these forums?

If so please advise if there are known issues regarding updating products via the SOAP api and how to get around it.

There is a similar thread under Magento DataFlow here:

Webservice and productinfo missing values

 
Magento Community Magento Community
Magento Community
Magento Community
 
cfelder
Jr. Member
 
Total Posts:  6
Joined:  2010-06-20
 

Hi

I’m not sure if it helps, but I can provide some additional information.
The API works fine for me. I’m using Magento 1.4.1.0 with the patch 1.4.x-devel-71052 applied. Here is what my API request XML looks like this:

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><wsdl:catalogProductUpdate><product>010000126552</product><productData><price>100</price></productData><sessionId>121f09c27ec53bd6de0b29e6022c7bb6</sessionId></wsdl:catalogProductUpdate></env:Body></env:Envelope>

I am using the SKU, not the ID to identify the record. The thing I fell for is that you need to pass the attribute produt, not the attribute sku (as mentioned in the documentation).

 
Magento Community Magento Community
Magento Community
Magento Community
 
sexybitch
Jr. Member
 
Total Posts:  1
Joined:  2010-05-13
 

I’ve been working with the API quite a bit over the last month, and I’m hoping you’ve solved this problem already, but in case there are others like me still searching for the answer…

When adding information to an object in Magento through the api - category, product, attribute, etc. - you must call save() on the object or else your data will not be applied.

cheers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
thE_iNviNciblE
Sr. Member
 
Avatar
Total Posts:  220
Joined:  2008-01-09
Oldenburg
 

i’ve the same Problem unter .NET with catalogProductInfo()

Dim mc_filter As New catalogProductRequestAttributes
Dim str(0) As String
str(0) = “name”
mc_filter.attributes = str
mc_filter.additional_attributes = str
‘mc_filer.attributes
Dim objResource As catalogProductReturnEntity
objResource = magentoAPI.catalogProductInfo(gbl_strSession, sku, setStoreviewName, mc_filter, produktID)

has anybody one solution?
The Default Message “Product doesn’t exist”.....

 
Magento Community Magento Community
Magento Community
Magento Community
 
dstringvc
Jr. Member
 
Total Posts:  2
Joined:  2010-08-25
 

To: thE_iNviNciblE

If you are passing the product’s sku in the second parameter, you should set produktID = “sku”.

If you were passing the product_id in the second parameter, you should set produktID = “id”.

 
Magento Community Magento Community
Magento Community
Magento Community
 
thE_iNviNciblE
Sr. Member
 
Avatar
Total Posts:  220
Joined:  2008-01-09
Oldenburg
 

hello,

i found the solution, the last parameter must be set to nothing

objResource = magentoAPI.catalogProductInfo(gbl_strSession, productID, setStoreviewName, mc_filter, nothing)

 
Magento Community Magento Community
Magento Community
Magento Community
 
StoreYa
Jr. Member
 
Avatar
Total Posts:  19
Joined:  2011-08-22
 

Hi there,

You can try the below solution, it works for us.
The ame API function ("product.info" in this case) receives as a parameter both SKU and ID, there is a problem if your are looking for SKU’s which is numeric values.
You can avoid this problem, by adding space to the end of SKU before sending it to the API. For example, if your SKU is “123456” you should send “123456 “ to the API.

 
Magento Community Magento Community
Magento Community
Magento Community
 
omprakah
Jr. Member
 
Total Posts:  5
Joined:  2012-12-10
 

Hai Friends ,

I currently working on Integrating Compiere with Magento using Magento API ( SOAP v1 ) .  Having some doubt regards - catalog_product.info call . Please help me .

1.  Using catalog_product.list - I retrieved all existing product ( product_id ) . And when i try to make use of catalog_product.info ( it getting error as product not exist ) . But I am sure that , the product_id & SKU is valid ..  I have attached my Program code with output .

Please help me & i need to know what is wrong in my program .

Thanks & Regards

VINOTH.A

File Attachments
Product_Info Magento.txt  (File Size: 4KB - Downloads: 106)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top