添加服务引用后,MagentoService不可用

时间:2018-04-26 19:48:01

标签: c# soap magento-1.9

我使用this example让SOAP接口在我的Magento 1.9商店上运行。这一切似乎都运行正常,我可以添加服务引用,并添加了MagentoSOAP.com.example.myshop命名空间。 (MagentoSOAP是我项目的命名空间。)

但是,根据给出的示例,我应该在该命名空间中有MagentoService,但它不存在。我可以看到MagentoSOAP.com.example.myshop命名空间中的所有类,但没有服务。

我知道SOAP API有效,因为在PHP中我得到了响应。

我正在使用Visual Studio 2015。

1 个答案:

答案 0 :(得分:0)

您想要的课程不是MagentoService,而是PortTypeClient

using MyNamespace.com.example.shop;

...

PortTypeClient client = new PortTypeClient();
string sessionId = client.login("user", "api key");

// example call
var result = client.catalogInventoryStockItemList(sessionId, new string[] { "SKU" });
相关问题