<?php
$xmldata = '<?xml version="1.0" encoding="UTF-8"?>
<student>
<info>
<name>Rahul kumar</name>
<age>10</age>
<class>5th</class>
<rollno>25</rollno>
</info>
</student>';
$url = "https://www.website.com/ws";
$ch = curl_init();
if (!$ch) {
die("Couldn't initialize a cURL handle");
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmldata);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch); // execute
echo $result; //show response
curl_close($ch);
?>