Magento API无法与wsdl.exe一起使用,但可以与Soap UI一起使用 [英] Magento API not working with wsdl.exe but works with 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 http://www.ws-i.org/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: https://gist.github.com/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一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!