How to get all additional Magento Product attributes without explicitly specifying them

My goal is to get and display all additional attributes for a Magento product using the SOAP API. For example, gender, shirt size and color for t-shirts. But the program does not need to know the names of the attributes.

SOAP Call: catalogProductInfo has an additional attribute parameter, and it looks like I should explicitly specify additional attribute names.

I use Java and Apache Axis to connect to the Mangeto SOAP API, and the following code:

stub.catalogProductInfo(sessionId, "118", null, null); call declaration: public com.magentocommerce.api.CatalogProductReturnEntity catalogProductInfo(java.lang.String sessionId, java.lang.String productId, java.lang.String storeView, com.magentocommerce.api.CatalogProductRequestAttributes attributes) throws java.rmi.RemoteException { attributes parameter constructor declaration: public CatalogProductRequestAttributes( java.lang.String[] attributes, java.lang.String[] additional_attributes) { 

But I have to specify the last parameter to get all the additional attributes. Is this possible using the SOAP API?

Refresh : "*" because the attribute is not working

 CatalogProductRequestAttributes attrs = new CatalogProductRequestAttributes(); attrs.setAttributes(new String[] {"*"}); attrs.setAdditional_attributes(new String[] {"*"}); 

The resulting object is not populated with either standard attributes or additional attributes.

+4
source share
2 answers

I have not tried the API directly, but have you tried specifying * as the attribute name? This is how it is done in the structure itself.

+1
source

First you need to call the API for a list of optional attributes: catalogProductListOfAdditionalAttributes

Then navigate through the results and create a second query for a specific product.

0
source

All Articles