Receive xml:$ Xml = file_get_contents (php: // input );Send (post ):$ Xml_data = <xml>... </xml> ";
$ Url = http: // dest_url;
$ Header [] = "Content-type: text/xml"; // define content-type as xml
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ header );
Curl_setopt ($ ch, CURLOPT_POST, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ xml_data );
$ Response = curl_exec ($ ch );
If (curl_errno ($ ch ))
{
Print curl_error ($ ch );
}
Curl_close ($ ch); or: $ fp = fsockopen ($ server, 80 );
Fputs ($ fp, "POST $ path HTTP/1.0 ");
Fputs ($ fp, "Host: $ server ");
Fputs ($ fp, "Content-Type: text/xml ");
Fputs ($ fp, "Content-Length: $ contentLength ");
Fputs ($ fp, "Connection: close ");
Fputs ($ fp, ""); // all headers sent
Fputs ($ fp, $ xml_data );
$ Result =;
While (! Feof ($ fp )){
$ Result. = fgets ($ fp, 128 );
}
Return $ result;