简体   繁体   English

检查肥皂连接是否有效

[英]Check if soap connection working

Quick one, How would you go about checking if your connection to a soap server is actually connecting? 快速的一个,您将如何检查您与肥皂服务器的连接是否实际连接?

I have this code: 我有这个代码:

$m_wsdl = "https://m2mconnect.orange.co.uk/orange-soap/services/MessageServiceByCountry?wsdl";
    try {
        $client = new SoapClient($m_wsdl);

        $this->m_messages = $client->peekMessages('','',10,"");
    } catch (Exception $e) {

        echo "Exception: \n" . $e->getMessage() . "\n";
    }

    $this->do_parse_xml();

Obviously my username and password are in the peekmessages field where they should be, and they are both correct i am 100%. 显然,我的用户名和密码都在peekmessages字段中,它们应该是,并且它们都是正确的我是100%。

For some reason its not returning any data at all and i dont know how to check to see if the connection is actually working?? 由于某种原因,它根本没有返回任何数据,我不知道如何检查,看看连接是否真的有效?

Im getting no exceptions being echo'd 我没有得到回应的例外

Thanks for any help 谢谢你的帮助

Use isSoapFault() http://php.net/manual/en/function.is-soap-fault.php 使用isSoapFault() http://php.net/manual/en/function.is-soap-fault.php

Also, the peekMessages method would probably return false or a SoapFault . 此外, peekMessages方法可能会返回falseSoapFault

You can also set Exceptions to true on the SoapClient 您还可以在SoapClient上将Exceptions设置为true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM