views:

102

answers:

1

My goal is to get and display all additional attributes for the Magento product using SOAP API. For example Gender, Shirt Size and Color for T-Shirt product. But the program shouldn't know the attribute names.

In the SOAP Call: catalogProductInfo there is additional attributes parameter and it looks like I have to explicitly specify additional attribute names.

I am using Java and Apache Axis to connect to Mangeto SOAP API and the code is following:

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 last parameter somehow to get all additional attributes. Is it possible to do through SOAP API?

Update: "*" as attribute doesn't work

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

Resulted object is not filled neither with standard attributes nor with additional attributes.

+1  A: 

I haven't tried through the API specifically, but have you tried specifying * as the attribute name? That's how it's done in the framework itself.

Joseph Mastey
@Joseph Thanks for this idea. But I tried it doesn't work from API.
Vladimir