So I am working on SOAP request using PHP cURL. I want to invoke operations but before that I want to test the authentication part. Below is my code:
$username = 'myusername';
$password = 'mypassword';
$host = 'http://xx.xx.xx.xx:xxxxx';
$process = curl_init($host);
curl_setopt($process, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($process, CURLOPT_HEADER, true);
curl_setopt($process, CURLOPT_HTTPHEADER, array(
'Content-Type: text/xml',
"Authorization: Basic " . base64_encode($username.":".$password)
));
curl_setopt($process,CURLOPT_USERAGENT,'xxxxx/x.x');
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_VERBOSE, 1);
curl_setopt($process, CURLOPT_FAILONERROR, false);
$return = curl_exec($process);
print_r($return);
curl_close($process);
I need to use base64 username/password. I found how to do this on some other question. But when I do print_r($return)
I received
HTTP/1.1 500 Internal Server Error Server: xxxxx/x.x Content-Type: text/xml; charset=utf-8 Content-Length: 883 Connection: close SOAP-ENV:Client HTTP GET method not implemented
I am not sure what this error means plus I could not found much questions on this kind of error. Perhaps somebody could explain me what is going on here? Thank you in advance.