[英]SOAP Authentication Through cURL PHP Returns “HTTP GET method not implemented” 500 error
所以我正在使用PHP cURL處理SOAP請求。 我想調用操作,但是在此之前,我想測試身份驗證部分。 下面是我的代碼:
$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);
我需要使用base64用戶名/密碼。 我在其他問題上找到了解決方法。 但是當我執行print_r($return)
我收到了
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
我不確定此錯誤意味着什么,而且我找不到關於此類錯誤的太多問題。 也許有人可以解釋一下這是怎么回事? 先感謝您。
該錯誤表明您嘗試訪問的服務未實現HTTPGET功能。 如果不知道要嘗試到達的內容以及要嘗試到達的api文檔或對要執行的操作的描述,就無法解決該錯誤。
通常,錯誤500是內部服務器錯誤,而不是您收到的未實現錯誤。 下面或響應代碼標准的描述。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.