I solved my problem, scroll down to see the final result.

this is what i have written so far:

$host = 'localhost';
$uri = '/auto/response.xml';
$request_data = '<some><xml>data</xml></some>';

$header = "Host: $host\\r\\n";
$header .= "User-Agent: PHP Script\\r\\n";
$header .= "Content-Type: text/xml\\r\\n";
$header .= "Content-Length: ".strlen($request_data)."\\r\\n";
$header .= "Connection: close";
$fp = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
  if (!$fp) {
    echo "Error $errno: $errstr";
    exit();
  }
  fwrite($fp,$header);
  $reply = fgets($fp);
  fclose($fp);
  print_r($reply);

Number 1: It connects correctly and gets something back from the server.
Number 2: That something is nothing where it should be the auto/response.xml file.
Number 3: How do I send the request data?

OOOHHH I greatly appreciate you taking the time to look at my post...and LOVE you if you can reply!!!! 😃

    Wow, now there is gratitude for ya! 😃

    Check to see if you have curl. You can call it using exec and (if php is compiled with it) there are php functions at http://us3.php.net/manual/en/ref.curl.php.

    from the command shell you can type which curl to get the path to the executible from your server. Then try something like...

    exec( "/path/to/curl -d \"$request_data\" $host", $replyArray );

      I LOVE YOU SOOOO SUPER MUCH!!!!!!!!! :-:-!!!!!

      now i just have to figure out how to submit XML data :queasy:

        Thank you to bretticus for helping me get over my little jam!!! I HEART YOU!!!!!

        Now, here is the code you can use to submit an XML document ($xml) to a server via HTTPS:

        $url = "https://your_url_goes_here";
        $xml = '<?xml version="1.0" ?>
        <some>
          <random>XML Data</random>
        </some>';
        if (!$cn = curl_init($url)) {
          die("Conn error");
        }
        curl_setopt($cn, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
        # i was using my localhost and a certificate i signed...so the CURL library rejected the certificate.
        # if you configure CURL correctly, you can remove the following line.
        curl_setopt($cn, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($cn, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($cn, CURLOPT_POSTFIELDS, $xml);
        $response = curl_exec($cn);
        curl_close($cn);

          # i was using my localhost and a certificate i signed...so the CURL library rejected the certificate.

          if you configure CURL correctly, you can remove the following line.

          curl_setopt($cn, CURLOPT_SSL_VERIFYPEER, false);

          Good to know...thanks!

            23 days later

            I have used the example posted by hellboi64 to post to an API expecting XML and all I get is an error from the API which says "No XML Received".

            Any idea what might be happening? We can't see the code of the API so we are at the mercy of their support and I think there is like one guy that can't look at their code and he is out right now.

            Any help would be appreciated.. Thanks!

              It's entirely possible that your HTTP implementation is incorrect - for example, two newlines are required at the end of the headers.

              Consider using the fopen URL wrapper to achieve a HTTPS POST. This is fairly straightforward to achieve, you simply create a stream context, set the options necessary (with headers and post data), then use fopen to do the post (and read response).

              Look carefully at the documentation to see if anything has been missed.

              Pay close attention to any encoding requirements - do not send XML in one encoding when it says it's in the other. Remember that in the XML spec, any document which doesn't specify encoding is implicitly in UTF-8.

              Mark

                Oh yes, make sure you use the right request method, I don't know what curl's default is (probably GET), but GET is not the right method to use when sending XML. Typically you'd use POST or PUT instead (read the spec docs for what the other end is expecting).

                Mark

                  Write a Reply...