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

发布于 2024-12-10 11:14:16 字数 1069 浏览 1 评论 0 原文

我第一次执行 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):无法打开流:连接超时

任何可以帮助?

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

my first time doing a SOAP Request fails and fails again.
I have to send some Data via SOAP but i dont get a stable connection.

I use the SOAP Extension of PHP. My Code looks like the following.

$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());

Now my Problem is, that the SOAP Request always runs into a timeout.

I checked my php settings and SOAP and OpenSSL are activated.

I also tried it with a .pem instead of a .cer File. Same Problem.

This is what i get all the time:
Warning: SoapClient::SoapClient(https://data2.kroschke.net/service/MeinAutoUeberfuehrungen?WSDL): failed to open stream: Connection timed out in

Anyone who can help?

PS: Dont mind the fb() Function. Just a function to print everything into FireBug.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偏闹i 2024-12-17 11:14:16

只需尝试打开 https://data2.kroschke.nethttps://data2.kroschke.net/service/MeinAutoUeberfuehrungen?WSDL 在浏览器中:你也会得到一个超时。

最好的解决方案是与该肥皂服务器的提供商联系(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的提供商-服务器并询问为什么他们的方法采取这样的 很久。

有关详细信息,请查看 soapclient 及其选项

just try to open https://data2.kroschke.net or https://data2.kroschke.net/service/MeinAutoUeberfuehrungen?WSDL in you browser: you'll get a timeout, too.

the best solution would be to get in contact with the provider of that soap-server (kroschke.com/kroschke.de ?) and ask them why their server is down or seems to hang.

EDIT:
this doesn't seem to be the problem, so your only option is to set the timeout to a higher value. for this, just add connection_timeout (value in seconds) to your options:

$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
        );

if it still times out, set the value even higher - if it still times out then, try to test the soap-communication with a program like soapUI before implementing it with PHP - if you get problems with soapUI, too, contact the provider of that soap-server and ask why their methods take such a long time.

for more information, take a look at the soapclient and it's options.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文