如何从 Wordpress 表单调用 SOAP Web 服务?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6585853/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to call a SOAP web service from a Wordpress form?
提问by Andy Smith
I have a Wordpress site that I am currently working on and have set up a form with the CformsII plugin but the client would like the form data submitted to a SOAP web service.
我有一个目前正在开发的 Wordpress 站点,并且已经使用 CformsII 插件设置了一个表单,但客户端希望将表单数据提交给 SOAP Web 服务。
I have the SOAP webservice URL and XML data but the CformsII plugin in Wordpress seems to use a standard HTML POST method which I have been told that the SOAP webservicewill not handle.
我有 SOAP 网络服务 URL 和 XML 数据,但 Wordpress 中的 CformsII 插件似乎使用标准的 HTML POST 方法,我被告知 SOAP 网络服务不会处理。
I have never used or had any experience with SOAP web services before so I am really in need of guidance as to how I can go about submitting form data from a Wordpress site (with or without the CformsII plugin) to a SOAP webservice.
我以前从未使用过 SOAP 网络服务或有任何使用 SOAP 网络服务的经验,所以我真的需要指导,了解如何将表单数据从 Wordpress 站点(有或没有 CformsII 插件)提交到 SOAP 网络服务。
Has anyone achieved this previously or know of any plugin that could help?
有没有人以前实现过这个或知道任何可以帮助的插件?
采纳答案by Jared Cobb
I wish I had a better answer for you, but I'm afraid it'll involve some coding and understanding on SOAP. (Because I couldn't find any WordPress plugins that implemented a generic SOAP client or more specifically a form submitter with SOAP support).
我希望我有一个更好的答案给你,但恐怕它会涉及一些关于 SOAP 的编码和理解。(因为我找不到任何实现通用 SOAP 客户端或更具体地说是支持 SOAP 的表单提交器的 WordPress 插件)。
This post author collected a nice group of links that should help get you started: https://wordpress.stackexchange.com/questions/14804/embedding-a-soap-client-into-a-wordpress-plugin
这篇文章作者收集了一组很好的链接,可以帮助您入门:https: //wordpress.stackexchange.com/questions/14804/embedding-a-soap-client-into-a-wordpress-plugin
Personally, I use GravityFormsfor all my projects (but it's a paid plugin). But they provide a nice API and there's a hook called gform_post_submissionthat I've personally used a lot. (I've "posted" to REST services using that hook).
就我个人而言,我的所有项目都使用GravityForms(但它是一个付费插件)。但是他们提供了一个很好的 API,并且有一个名为gform_post_submission的钩子,我个人经常使用它。(我已经使用该钩子“发布”到 REST 服务)。
回答by PHK Corporation
There is a soap plugin framework for wordpress that allows you to create/expose wordpress behavior as soap api. http://www.amazon.com/dp/B00D1AYIG8and http://github.com/patrickingle/wp-soap-services
wordpress 有一个soap 插件框架,它允许您将wordpress 行为创建/公开为soap api。http://www.amazon.com/dp/B00D1AYIG8和http://github.com/patrickingle/wp-soap-services