shah_ankitb Posted August 19, 2011 Share Posted August 19, 2011 I have following PHP CURL code for SOAP. <?php$url = 'http://www.abc.com';$content = '<?xml version="1.0" encoding="UTF-8"?><env:Envelopexmlns:env="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header> -----</env:Header><env:Body> -------</env:Body></env:Envelope>';$header = array( 'Content-type: text/xml;charset="utf-8"', 'SOAPAction: "run"', 'Content-length: ' . strlen($content),);$request = curl_init();curl_setopt($request, CURLOPT_URL, $url);curl_setopt($request, CURLOPT_RETURNTRANSFER, true );curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($request, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($request, CURLOPT_POST, true );curl_setopt($request, CURLOPT_POSTFIELDS, $content);curl_setopt($request, CURLOPT_HTTPHEADER, $header);$response = curl_exec($request);?> In response i get content in body but not in header.<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body> GET CONTENT</soapenv:Body></soapenv:Envelope>any idea missing something in$header = array( 'Content-type: text/xml;charset="utf-8"', 'SOAPAction: "run"', 'Content-length: ' . strlen($content),);?due to some security issue not able to provide right XML request & response. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.