doujingxi3356 2015-03-17 07:01
浏览 175

通过cURL PHP进行SOAP身份验证返回“未实现HTTP GET方法”500错误

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.

  • 写回答

1条回答 默认 最新

  • dsceme82487 2015-03-17 07:44
    关注

    The error is stating that the service you are trying to reach does not have the HTTPGET functionality implemented. Without knowing what you are trying to reach and documentation of the api you are trying to reach or description of what you are trying to do there is no way to help with the error.

    Normally an error 500 is for an internal server error and not for a not implemented error that you are receiving. Below or descriptions of response code standards.

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler