function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
veenaveena 

Accessing outbound message using php

Hi All,

I want to create a outbound message notification server in php, which will inturn invoke a custom php function.
Please tell me how to access outbound message using php.

Regards,
Veena.
colingcoling
I have had success with the following:

<?php
header("Content-Type: text/xml\r\n");
...
// Get raw post data
$data = fopen('php://input', 'rb');
$content = fread($data,5000);
...

?>

You will probably want to parse the xml received, etc.


Good luck.

Colin Goldberg


colingcoling

Oops! I forgot.

You will need to respond to the sender.

Something like:

function respond($tf) {

         print '<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                 <soapenv:Body>
                   <notifications xmlns="http://soap.sforce.com/2005/09/outbound">
                      <Ack>' . $tf . '</Ack>
                   </notifications>
                  </soapenv:Body>
                </soapenv:Envelope>';
}

if (<some condition>) {
   respond('true');
}else{
   respond('false');
}

veenaveena
Thanks for the help its working :smileyhappy:.

Message Edited by veena on 04-29-2008 10:33 PM