Closed bajricsanel closed 10 years ago
I think we can start by altering the headers and the post body to send it as XML instead. Looking into it.
First step is to try the branch https://github.com/zaus/forms-3rdparty-integration/tree/soap-headers.
Then add the following hook to your functions.php
file (or wherever):
// bypass hook
add_filter('Forms3rdPartyIntegration_service_filter_args', array(&$this, 'limedb_send_soap'), 10, 3);
// the actual hook -- will send a soap request
function limedb_send_soap($args, $service, $form) {
// if you only want this to occur for a specific service and/or form, filter here and return $args
$result = array('request' => $args); // preserve the original request for debugging
try {
$client = new SoapClient($service['url']);
// might need further customization to the post body rather than just passing the mapped form post
$response = $client->ConsumeLead($args['body']);
// using special hook bypass value
$result['response_bypass'] =
// turn response back into expected remote_post format
array('body' => $response, 'response' => array('code'=>200));
} catch (Exception $e) {
$result['response_bypass'] = array(
'response' => array(
'code' => 500
, 'message' => $e->getMessage()
)
);
}
return $result;
}
And if it wasn't clear from the previous comment, you should hopefully only need to change the line:
$response = $client->ConsumeLead($args['body']);
Hello
I am really sorry but now i am totally confused. And lost.
Dana subota, 14. prosinca 2013., korisnik zausnotifications@github.com je napisao:
And if it wasn't clear from the previous comment, you should hopefully only need to change the line:
$response = $client->ConsumeLead($args['body']);
— Reply to this email directly or view it on GitHub.
The branch is now live, btw.
You'll need to:
1) update the plugin
2) write a hook to take advantage of the new ability to transform the post body and bypass the original form-post
3) the hook will instead generate a SOAP request, which you'll need to format per the LimeDB specs
4) since you're now performing the "post" in the hook, the hook will return the special array (response_bypass
) that tells my plugin to skip sending the form post as usual
We can follow up on LimeDB specifics via email.
To make this easier there's the Forms 3rdparty Xpost plugin mentioned here https://github.com/zaus/forms-3rdparty-integration#how-do-i-send-xmlsubmit-to-soap
Hello
First - great plugin. But...I am not so great, I am affraid ;(. PLease, can you help me with integration GF and LimeDB CRM using this plugin.
I really don't know what to do here. LimeDB support is horror! They sent me some kind documentation and some links but I dont get it, becouse I am not so familiar with SOAP and similar functionas.
Any help appreciate!