Search code examples
php.netmagentoproxymagento-soap-api

Get AttributeOptions from Magento via SOAP-API V2


I'm trying to get a list of options for a particular product attribute via the SOAP API.

Using Magento 1.6.2.0 and WS-I compliant SOAP API V2 with .NET

The call is

client.catalogProductAttributeOptions(sessionId, attribute.attribute_id, storeView);

To get the attribute id i get the attribute with the attribute's code before. I pass the current sessionId the attributes attribute_id and the storeView.

The interesting thing is that on one magento installation it works fine and i get all the options. But on an other similar installation i get following FaultException:

Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MagentoService.Mage_Api_Model_Server_Wsi_HandlerPortType.catalogProductAttributeOptions(catalogProductAttributeOptionsRequest request)

EDIT:

One of the Installation i made by myself, this is where i created the .NET Proxy from. Here it works fine. The other installation is the same magento version but installed on an other machine. Additionally there are the Core API Extensions by NETZKOLLEKTIV installed. Each installation have different products and categories in its catalogs. Does that make the difference? Both are set to be WS-I compliant.

Would be great if anybody can give me some hints. Thanks


Solution

  • The mentioned FaultException simply says that the API connection to the Magento Web Server is getting timed out. It may happen due to a long list of Attribute Options for that particular attribute, in this Magento installation.

    Try increasing the "Client Session Timeout (sec.)" value in the Magento Admin Panel, from:-

    • System
    • Configuration
    • "Magento Core API" Group
    • "General Settings" tab

    Hope it helps.