I am trying to send WSDL through curl. But I am getting the below response:
HTTP/1.0 200 Connection established
HTTP/1.1 100 Continue
HTTP/1.1 500 Internal Server Error
Date: Sat, 02 May 2015 05:58:05 GMT
Server: IBM_HTTP_Server
X-Powered-By: Servlet/3.0
$WSEP:
Content-Length: 85
Content-Type: text/html;charset=ISO-8859-1
Connection: close
Content-Language: en-US
Error 500: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
My code is below:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 50);
curl_setopt($ch, CURLOPT_TIMEOUT, 900);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, array("Content-type: text/xml;charset=\"utf-8\""));
// curl_setopt($ch, CURLOPT_HEADER, array("Content-Type: text/xml; charset=utf-8"));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$curl_scraped_page = curl_exec($ch);
if ($curl_scraped_page === false) {
return 'Curl error: ' . curl_error($ch);
curl_close($ch);
} else {
return $curl_scraped_page;
curl_close($ch);
}