xml request over socket php

Im trying to send an xml request over php socket, remote server gets connection request but didn’t get my xml data request

any hint guys

$xml_data = ‘name1’;

$headers = array(
"Content-type: text/xml;charset=“utf-8"”,
“Accept: text/xml”,
“Cache-Control: no-cache”,
“Pragma: no-cache”,
“SOAPAction: “run””,
"Content-length: ".strlen($xml_data),
);

$URL = “IP:PORT”;

$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_MUTE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: text/xml’));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);

in other way if I telnet(manually) on IP:port and paste my xml lines there in session , I get respose without any issue

Sponsor our Newsletter | Privacy Policy | Terms of Service