Hi All,

I have a page that receives third party data into my app, xml data via
https post. This works fine and I receive the data as expected. The
issue I am facing is around posting XML data back as a synchronous
response to the post I receive. I am using the following code:

function sendXMLConfirmation($data)
   * XML Sender/Client.
  // Get our XML. You can declare it here or even load a file.

  $xml_builder = '<?xml version="1.0" encoding="utf-8"?>
                                <Envelope version="01.00">
                                        <TransactInfo transactType="response">
                                                <TimeStamp>'.date("Y-m-d H:m 
<LongDescription>CANDIDATE Data transfer was a success</LongDescription>
  // We send XML via CURL using POST with a http header of text/xml.
        $ch = curl_init();

        $url = 'https://staging.somesite.com/Sprocessor/DispatchMessage.asmx';

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);   // for https
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 4);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_builder);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));

        //Execute the request and also time the transaction ( optional )

        $start = array_sum(explode(' ', microtime()));

        $result = curl_exec($ch);
        // Print CURL result.
        echo $ch_result;

The endpoint recipient says they are not receiving the data and I am
at a loss to figure out why. Any insight would be appreciated.




Cat, the other other white meat

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to