SoapFault exception: Could not connect to host

后端 未结 27 1514
-上瘾入骨i
-上瘾入骨i 2020-12-01 07:47

Sometimes fail to call the web service.

This problem happens all the time.

What could be the problem?

Error:
    SoapFault exception: [HTTP]          


        
相关标签:
27条回答
  • 2020-12-01 08:08

    I had a bad php.ini configuration. Verify the path and the certificate validity...

    [openssl]
    openssl.cafile = "C:/good/phpath/ca-bundle.crt"
    

    Because my new \SoapClient($wsdl) was https !

    0 讨论(0)
  • 2020-12-01 08:10

    If you have a firewall on your server, make sure to open the port used by SOAP.

    In my case, I had to open the port 1664.

    iptables -t filter -A INPUT -p tcp --dport 1664 -j ACCEPT
    iptables -t filter -A OUTPUT -p tcp --dport 1664 -j ACCEPT
    
    0 讨论(0)
  • 2020-12-01 08:10

    Just to help other people who encounter this error, the url in <soap:address location="https://some.url"/> had an invalid certificate and caused the error.

    0 讨论(0)
  • 2020-12-01 08:12

    In my case it worked after the connection to the wsdl, use the function __setLocation() to define the location again because the call fails with the error:

    Could not connect to the host

    This happens if the WSDL is different to the one specified in SoapClient::SoapClient.

    0 讨论(0)
  • 2020-12-01 08:19

    I hit this issue myself and after much digging I eventually found this bug for ubuntu:

    https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371

    specifically

    https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/965371/comments/62

    openssl s_client -connect site.tld:443 failed however openssl s_client -tls1 -connect site.tld:443 gave success. In my particular case part of the output included New, TLSv1/SSLv3, Cipher is RC4-MD5 so I set the php context ssl/cipher value appropriately.

    0 讨论(0)
  • 2020-12-01 08:20

    For me it was a DNS issue. My VPS's nameservers crapped out, so I switched to Google's by editing my /etc/resolv.conf to be: nameserver 8.8.8.8 nameserver 8.8.4.4

    0 讨论(0)
提交回复
热议问题