<?PHPHeader("Content-type:text/xml;");//XML Code Demo$xmlData=<?xml version= "1.0" encoding= "Utf-8"?> <soap:envelope xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance "xmlns:xsd=" Http://www.w3.org/2001/XMLSchema "xmlns:soap=" http://schemas.xmlsoap.org/soap/ envelope/"> <soap:Body> <execproc_string xmlns=" http://tempuri.org/"> <sql>bk_js kc</sql> <p></p> <my>[email protected]#.cn</my> </execproc_strin g> </soap:Body> </soap:Envelope>‘;$url= ' http://*.*.*.*:8867/service.asmx?op=execproc_string ';//files that receive XML data$header[] = "Content-type:text/xml";$ch= Curl_init ($url); curl_setopt ($ch, Curlopt_url,$url); curl_setopt ($ch, Curlopt_returntransfer,true); curl_setopt ($ch, Curlopt_httpheader,$header); curl_setopt ($ch, Curlopt_post, 1); curl_setopt ($ch, Curlopt_postfields,$xmlData);$response= Curl_exec ($ch);Echo $response;if(Curl_errno ($ch) {printcurl_error ($ch);} Curl_close ($ch);?>
PHP Post submission XML file