通过https的SOAP请求每次都失败


SOAP Request over https fails everytime

我第一次做SOAP请求失败了,又失败了。我必须通过SOAP发送一些数据,但我没有得到一个稳定的连接。

我使用PHP的SOAP扩展。我的代码如下所示。

$certificate = file_get_contents(DATA_PATH.'/modules/va/misc/CKTC.cer');
$options = array(
                'uri'               => 'https://data2.kroschke.net/service/MeinAutoUeberfuehrungen',
                'allow_self_signed' => true,
                'verify_peer'       => true,
                'local_cert'        => $certificate,
                'trace'             => 1,
                'exceptions'        => true,
            );
$wsdl = 'https://data2.kroschke.net/service/MeinAutoUeberfuehrungen?WSDL';
$SOAPClient = new SoapClient($wsdl, $options);
fb($SOAPClient->__getFunctions());

现在我的问题是,SOAP请求总是遇到超时。

我检查了我的php设置和SOAP和OpenSSL是激活的。

我还尝试了一个。pem而不是。cer文件。同样的问题。

这是我得到的所有时间:警告:SoapClient::SoapClient(https://data2.kroschke.net/service/MeinAutoUeberfuehrungen?WSDL): failed to open stream: Connection timed out in

谁能帮忙?

PS:不要介意fb()函数。只是一个将所有内容打印到FireBug中的函数。

尝试在浏览器中打开https://data2.kroschke.net或https://data2.kroschke.net/service/MeinAutoUeberfuehrungen?WSDL:您也会得到超时。

最好的解决方案是与soap服务器的提供者取得联系(kroschke.com/kroschke.de ?)并询问他们为什么他们的服务器关闭或似乎挂起了。

编辑:


这似乎不是问题所在,因此您唯一的选择是将超时设置为更高的值。为此,只需在选项中添加connection_timeout(以秒为单位的值):

$options = array(
            'uri'               => 'https://data2.kroschke.net/service/MeinAutoUeberfuehrungen',
            'allow_self_signed' => true,
            'verify_peer'       => true,
            'local_cert'        => $certificate,
            'trace'             => 1,
            'exceptions'        => true,
            'connection_timeout'=> 30
        );

如果仍然超时,则设置更高的值—如果仍然超时,则尝试在使用PHP实现soapUI之前测试与soapUI等程序的soap通信—如果您也遇到soapUI的问题,请联系该soap服务器的提供者并询问为什么他们的方法需要这么长时间。

有关更多信息,请查看soapclient及其选项。