Magento API not working with wsdl.exe but works with Soap UI

巧了我就是萌 提交于 2019-12-11 12:45:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/14288247/magento-api-not-working-with-wsdl-exe-but-works-with-soap-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!