Magento API无法与wsdl.exe一起使用,但可以与Soap UI一起使用

编程入门 行业动态 更新时间:2024-10-22 11:28:47
本文介绍了Magento API无法与wsdl.exe一起使用,但可以与Soap UI一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将Magento 1.7与C#应用程序集成.

当我尝试在Visual Studio中使用添加服务引用"功能时,它会找到服务和所有操作,但是当我单击确定"时,它不会生成任何内容.即Reference.cs文件几乎是空的(名称空间只有一行).

我尝试在命令提示符下使用 wsdl.exe 生成代理,但出现以下错误:

R2718:DESCRIPTION中的wsdl:binding必须与其所引用的wsdl:portType具有相同的wsdl:operations集.-来自名称空间'urn:Magento'的portType'Mage_Api_Model_Server_Wsi_HandlerPortType'上的操作'catalogProductAttributeRemove'没有匹配的绑定.

有关WS-I Basic Profile v1.1的更多详细信息,请参阅规范在.

您将需要修改您的Magento代码,以更正 app \ code \ core \ Mage \ Catalog \ etc \ wsi.xml 中符合WS-I的WSDL定义.

与其他.NET/Java工具相比,SOAP UI可能更能容忍WSDL中的错误.

I'm trying to integrate Magento 1.7 with a C# application.

When I tried to use the "Add Service Reference" function in Visual Studio, it finds the service and all the operations but when I click OK, it doesn't generate anything. i.e. the Reference.cs file is almost empty (only has one line with namespace).

I tried using wsdl.exe to generate the proxy in command prompt and I got the following error:

R2718: A wsdl:binding in a DESCRIPTION MUST have the same set of wsdl:operations as the wsdl:portType to which it refers. - Operation 'catalogProductAttributeRemove' on portType 'Mage_Api_Model_Server_Wsi_HandlerPortType' from namespace 'urn:Magento' has no matching binding.

For more details on the WS-I Basic Profile v1.1, see the specification at www.ws-i/Profiles/BasicProfile-1.1.html.

Error: Unable to import binding 'Mage_Api_Model_Server_Wsi_HandlerBinding' from namespace 'urn:Magento'. - The operation 'catalogProductAttributeRemove' on portType 'Mage_Api_Model_Server_Wsi_HandlerPortType' from namespace 'urn:Magento' had the following syntax error: The operation has no matching binding. Check if the operation, input and output names in the Binding section match with the corresponding names in the PortType section.

I then tried using Soap UI to load the same wsdl and it works fine. The proxy was generated and I can make calls without any problems.

The original wsdl file is here: gist.github/4514723 except I have replaced line 6297 with an example url.

So my questsion is why was Soap UI able to generate the proxies and making calls without any problems but Visual Studio can't? How can I fix it?

解决方案

See Generate a Web Service Client in WS-I compliance mode .

You will need to modify your Magento code to correct the WS-I compliant WSDL definition in app\code\core\Mage\Catalog\etc\wsi.xml.

The SOAP UI is probably more tolerant of mistakes in WSDLs compared to other .NET/Java tooling.

更多推荐

Magento API无法与wsdl.exe一起使用,但可以与Soap UI一起使用

本文发布于:2023-10-26 23:33:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531665.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:wsdl   API   Magento   UI   Soap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!