Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Integrating Gravity Forms , Wordpress and SOAP WordPress


I am using a Gravity Form to gather information from our website.

I need to then post this to a third party site using a SOAP API call.

Gravity Forms has a GForm after submission call:

1 <?php
2 add_action("gform_after_submission_5", "after_submission", 10, 2);
3 ?>

As I understand it this would submit only form #5

This is an example from Gravity forms for a third party submission

01 <?php
02 add_action('gform_after_submission', 'post_to_third_party', 10, 2);
03 function post_to_third_party($entry, $form) {
05 $post_url = '';
06 $body = array(
07 'first_name' => $entry['1.3'],
08 'last_name' => $entry['1.6'],
09 'message' => $entry['3']
10 );
12 $request = new WP_Http();
13 $response = $request->post($post_url, array('body' => $body));
15 }
16 ?>

Here is the actual soap code that I need to use to update the third party site....

( The data in this example is hard coded. Of course, I would need to pull the entry information as above.

<soapenv:Envelope xmlns:soapenv="" xmlns:tem="">
<tem:Email>[email protected]</tem:Email>

This needs to be posted against


I need to know the specific code that needs to be inserted into the specific file to get it to work. I can create and post the form if that helps.



Answers (3)


Jurre Hanema answers:

You should really use the PHP 5 built-in [[LINK href=""]]SoapClient[[/LINK]]. I am guessing the URL you gave, https://**URL**/**company**/api/**filename**.asmx?WSDL, points to a WSDL service description? If so, using the PHP SoapClient to call the service is pretty easy and goes like this:

$client = new SoapClient(
'soap_version' => SOAP_1_2

'Account_Id' => '**accountid**',
'UserName' => '**username**',
// etc etc

I think you already know how to get the values from the GravityForm using the $entry-array and insert them in place of my hardcoded strings.

If there are any problems when calling the service, it can be helpful to test it in an application like SoapUI first.

Good luck!


Arnav Joy answers:

see this article


Martin Pham answers:

please see this
[[LINK href=""]][[/LINK]]

Martin Pham comments:

readmore article
[[LINK href=""]][[/LINK]]

or question [[LINK href=""]][[/LINK]]