dousi1994 2013-12-12 02:07
浏览 430
已采纳

为什么Soap无法连接到HTTPS?

I am trying to connect to a HTTPS location. Currently I get Could not connect to host error. I am testing on two Ubuntu servers. This error occurs on one Ubuntu server which is off site. The other server which is on a development server on site works fine. I searched the server files and have yet to find any differences in the systems that would cause this kind of issue. I have yet to find someone with a similar issue and tried many different solutions related to the same error message (e.g. disabling wsdl caching, etc...).

  • HTTP works fine on both servers
  • HTTPS works on one server
  • php.ini files are the same
  • OpenSSL and Soap shows enabled in phpinfo(); (HTTP works, so I assume Soap is fine)
  • wget https://exampleurl.com/services/SessionService works fine on the server getting the error

What should I look at next?

What testing can I do?

How can I get addition info about the error?

$sessionService = new SessionService('/path/to/local/file/SessionService.wsdl', array(
          'location' => "https://exampleurl.com/services/SessionService"
      ));

try {
    // throws SoapFault error   
    $token = @Login($sessionService, $username, $password);
}
catch (SoapFault $sf) {
    //echo $sf->getMessage());
    //echo $sf;
}

SessionService class:

class SessionService extends SoapClient {

    private static $classmap = array(
        'login' => 'login',
        'loginResponse' => 'loginResponse',
        ...
    );

    public function SessionService($wsdl = "http://localhost:8080/services/SessionService?wsdl", $options = array()) {
        foreach (self::$classmap as $key => $value) {
            if (!isset($options['classmap'][$key])) {
                $options['classmap'][$key] = $value;
            }
        }
        parent::__construct($wsdl, $options);
    }


    //fails here
    public function login(login $parameters) {
        return $this->__soapCall('login', array($parameters), array(
            'uri' => 'http://example.url.com',
            'soapaction' => ''
            )
        );
    }

    //... other functions

}
  • 写回答

2条回答 默认 最新

  • doumu8911 2013-12-12 02:28
    关注

    WireShark, tcpdump or a similar tool may be your best bet here, to understand what's going wrong with the http request(s). You're not going to be able to debug the actual http request from the client code in PHP as that's all in the SOAP extension (written in C).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀