通过SOAP-API V2从Magento获取AttributeOptions


Get AttributeOptions from Magento via SOAP-API V2

我正试图通过SOAP API获取特定产品属性的选项列表。

使用Magento 1.6.2.0和符合WS-I的SOAP API V2和.NET

呼叫是

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

为了获得属性id,我使用之前的属性代码获得了属性。我传递当前会话id属性attribute_id和storeView。

有趣的是,在一个magento安装上,它工作得很好,我得到了所有的选择。但在另一个类似的安装中,我得到了以下FaultException:

服务器堆栈跟踪:位于System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime操作,ProxyRpc&rpc)System.ServiceModel.Channels.ServiceChannel.Call(字符串操作,布尔单向,ProxyOperationRuntime操作,Object[]ins,Object[]out,TimeSpan超时)System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessagemethodCall,ProxyOperationRuntime操作)System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage消息)

在[0]处重新引发异常:在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessagereqMsg、IMessage retMsg)System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)MagentoService.Mage_Api_Model_Server_WsiHandlerPortType.catalogProductAttributeOptions(catalogProductAttributeOptionsRequest请求)

编辑:

其中一个安装是我自己做的,这是我创建.NET代理的地方。在这里它工作得很好。另一个安装是相同的magento版本,但安装在另一台机器上。此外,还安装了NETZKOLLEKTIV的核心API扩展。每个安装在其目录中都有不同的产品和类别。这有区别吗?两者都设置为符合WS-I。

如果有人能给我一些提示就太好了。感谢

所提到的FaultException只是表示API与Magento Web服务器的连接超时。这可能是因为在这个Magento安装中,该特定属性的属性选项列表很长。

尝试增加Magento管理面板中的"Client Session Timeout (sec.)"值,从:-

  • 系统
  • 配置
  • "Magento Core API"集团
  • "常规设置"选项卡

希望能有所帮助。