Magento API 的 Web 服务响应
有人可以对以下问题提供一些说明吗?我相信以下问题很有争议,但我只想知道能够启发我和启发我的事实。当然还有很多其他人正在查看这个一般性问题帖子。
- 为什么 Magento API 生成 XML 格式的 Web 服务响应?不是 JSON 格式? 以 XML 格式生成响应应该有一些优势。我主要想知道这些优点。
- 在Magento术语中,提到了两个API版本 - “Normal API”(api/soap) 和“Normal API”(api/soap) ”。 “API v2 (api/v2_soap)”。这两个版本有什么区别(主要是优点),& WSDL 适用于哪里?
- 如果我要创建新的 Web 服务,我应该针对 SOAP v1 格式还是 SOAP v2 格式,还是这两种格式?
- Web 服务能否根据我的要求在 Magento 中创建 WSDL 的通用定义? 我想要的是我想知道“
wsdl.xml
”文件(驻留在Magento模块的“etc
”文件夹中)是否适用于任何特定的Magento API模块可以动态生成吗?如果我提供所需的 API 方法名称以及所有属性名称、类型以及响应数据类型,那么我将获得使用所有复杂类型动态生成的“wsdl.xml
”文件;正确提及的方法和消息?”
如果可能,请提供一些好的链接,从那里可以彻底清除 Magento Web 服务的蜘蛛网。 另外,请考虑我作为新手在 Web 服务这一领域的专业知识,以便根据任何有价值的输入,我可以重新构建问题。
帮助表示感谢&非常感谢大家。
我问这个问题的主要目的是我想制作新的自定义 API,可以由任何系统使用,无论是 ERP / CRM / SAP / Cloud / 任何一般系统。
PS
我尝试在程序员堆栈交换区域发布这个问题,但由于缺乏可用的必需标签(例如 magento、wsdl 和 soap ),我不得不把它贴在这里。如果可能的话&如有需要,请将本题转至合适的堆栈交换区。
Can some people offer some light on the following questions? I believe that the following questions are very much debatable, but I just want to know the mere facts which will enlighten me & of course many others viewing this general question post.
- Why does Magento API produces Web Service Responses in XML format & not in JSON format? There should be some advantages in producing the responses in XML format. I want to know those advantages mainly.
- In Magento terminology, there are two API versions mentioned - "Normal API" (api/soap) & "API v2 (api/v2_soap)". What's the difference (mainly the advantages) between these two versions, & where does WSDL fit in?
- If I'm to create a new Web Service, should I be targeting SOAP v1 format, or the SOAP v2 format, or both of these formats?
- Can the Web Service create a general definition of WSDL, based on my requirements, in Magento? What I want is that I want to know whether the "
wsdl.xml
" file (residing in the "etc
" folder of the Magento module) for any particular Magento API module can be generated dynamically? If I provide my required API method name, along with all the property names, types, and also the Response data types, then will I get the "wsdl.xml
file dynamically generated with all the Complex Types & Methods & Messages properly mentioned?"
If possible, please provide some good links, from where this spider-webs of Magento Web Services can be thoroughly cleared.
Also, please consider my expertise in this field of Web Service as a novice one, so that based on any valuable input, I can re-frame the question.
Help appreciated & thanks a lot to everybody.
My Main point of asking this question is that I want to make new custom APIs which can be used by any systems, whether it be ERP / CRM / SAP / Cloud / anything in general.
P.S.
I tried posting this question in the Programmers Stack Exchange area, but due to the lack of available required tags (like magento, wsdl & soap), I had to post it here. If possible & required, please transfer this question to proper stack exchange area.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
API 不是用于 ajax(前端),而是用于将 Magento(前端商店)与不同的 ERP、CRM、SAP(后端工具)系统集成 - 导入数据并获取报告。这就是为什么它使用 XML。
这不是 magento 的术语。这样做主要是为了遗留支持。所以你必须使用lates one - v2。
WSDL 的一般定义是什么意思? WSDL 描述已发布的功能 - 可用的调用/资源。如果您不需要它,则需要覆盖配置文件,以便不发布所有内容,只发布必要的内容,或者执行此表单管理区域。
您能更清楚、更技术性地告诉我们您需要使用 API 做什么?
API is not for ajax(frontend), but to integrate Magento (frontend shop) with different ERP, CRM, SAP (backend tools) systems - to import data and get reports. That's why it's using XML.
This is not magento's terminology. This is done mainly for legacy support. So you have to use lates one - v2.
What means general definition of WSDL? WSDL describes published functionality - available calls/resources. If you don't need it you need to overwrite configuration files to not publish everything but only necessary ones or do this form admin area.
Could you tell more clear and more technically what do you need to do with API?
该 API 非常适合您想要从 Magento 中获取某些内容的普通 PHP 编程。 “普通”API 可以与 PHP 配合良好,此外,与其他 API 生成的 XML 相比,生成的 XML 非常容易使用。
有人说 Magento API 很慢,事实确实如此。然而,如果您将相同的代码移动到 Magento 程序中,那么仍然需要很长时间,API 代码并不是太大的负担。
The API works great for normal PHP programming where you want to get something out of Magento. 'Normal' API works fine with PHP, furthermore, the resultant XML is very easy to work with in comparison to the XML that gets churned out by other APIs.
Some people have said that the Magento API is slow, which it is. However, if you move the same code into a Magento program then it still takes forever, the API code isn't much of a burden.