Linux 软件免费装

Forms: 3rd-Party Xml Post

开发者 zaus
leadlogic
更新时间 2018年7月17日 12:02
捐献地址: 去捐款
PHP版本: 3.0 及以上
WordPress版本: 4.6.1
版权: GPLv2 or later

标签

form contact form xml gravity forms contact form 7 json mapping services CRM CF7 soap nested fields 3rd-party service remote request GF xml webservice soap webservice json webservice xpost

下载

0.1 0.4.3 0.5 1.0 1.3 1.4 0.2

详情介绍:

Converts external submission from Forms: 3rdparty Integration plugin to an XML or JSON post; optionally can add custom headers (to allow SOAP submissions) or transform/combine separate fields into nested values. This plugin can turn the 3rdparty mappings into XML elements, so that each form post will be the value (or attribute) of an XML element.

安装:

  1. Unzip, upload plugin folder to your plugins directory (/wp-content/plugins/)
  2. Make sure Contact Form 7 or Gravity Forms is installed
  3. Make sure Forms: 3rdparty Integration is installed
  4. Activate plugin
  5. Go to new admin subpage "3rdparty Services" under the CF7 "Contact" menu or Gravity Forms "Forms" menu and configure services + field mapping.
  6. Configure the new "Xml Post" section to choose which services send as xml and/or determine special headers (given as a url querystring).
  7. Nest fields by separating nodes with /, and indicate attributes with @. Numeric indexes by themselves will result in repetition of the parent element (ex. item/%i/sub could make <item><sub /></item><item><sub /></item>).

升级注意事项:

1.3.2
  • fixed a bug in root parsing for already xml, please let me know if it breaks your usage
1.3
  • no longer prefixes standalone numerical indexes with n
  • instead will repeat the 'parent' element -- so a mapping of item/%i/sub%i could make <item><sub1 /></item><item><sub2 /></item>
1.2
  • no longer requires that you escape backslashes in the wrapper if providing XML (i.e. it starts with <) -- breaks backwards compatibility

常见问题:

I need help

Submit an issue to the GitHub issue tracker in addition to / instead of the WP Support Forums.

How do I add / configure a service?

See "base plugin" Forms: 3rdparty Integration.

How do I set headers

Provide the list of headers as though they were a URL querystring, so that

Content-Type: something X-Special-Header: something-else
would be given as
Content-Type=something&X-Special-Header=something-else
You may also use shortcodes such as base64 in the header.

How do I nest elements?

Separate element names within the same 3rdparty field mapping using /, so that in order to make: xyz abc you would use credentials/@type, credentials/user and credentials/pass, respectively. Note: You may nest and wrap elements even if not transforming into XML; they will be submitted as multi-dimensional arrays like: credentials[@type]=123&credentials[user]=xyz&credentials[pass]=abc

How do I repeat elements?

As of v1.3, if there is a standalone numerical index it will cause repetition of the "parent" element. ex) If the post is: item => array ( 0 => value1, 1 => value2, 2 => value3 ) it will result in value1 value2 value3 You can accomplish this with the Forms-3rdparty separator [%] to place your index appropriately.

How do I set xml prolog attributes?

Just enter the entire root xml in the field, a la http://stackoverflow.com/questions/5992268/simplexml-how-to-correctly-set-encoding-and-xmins

How do I autoclose/not autoclose empty values?

To produce <SomeTag />, make sure the "Autoclose" option is enabled. To produce <SomeTag></SomeTag>, make sure the "Autoclose" option is unchecked.

How do I completely customize the xml/wrappers/transform?

Use the 'Mask' format, which allows you to specify the result exactly as you want via string replacement (sprintf), or the 'Replace' format which will replace string tokens ({{3rdparty}}). Useful for complex XML. The 'Root Element' field will now be treated as a string-replacement mask (a la sprintf for "Mask" or str_replace for "Replace"), so make sure to include the post body with the appropriate placeholder(s) (%s for "Mask", {{3rdparty_Fields}} for "Replace"). For 'Mask' format, each '3rd-Party Field' will also be treated the same, using %s to indicate where the submission value should go. For 'Replace' format, repeating fields are not handled -- it essentially looks for instances of each "3rd-Party Field" column and replaces it with the corresponding input value.

更新日志:

1.4 1.3.3 1.3.2 1.3 1.2 1.0 0.5 0.4.2 Can post body as json instead 0.4 Fixed GitHub issue #3 https://github.com/zaus/forms-3rdparty-xpost/issues/3: 0.3 Can nest regular post fields even when not submitting XML. 0.2 0.1 Base version - xml and header transformation