Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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%.

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

like image 585
Tom Burman Avatar asked Jan 10 '13 22:01

Tom Burman


Video Answer


1 Answers

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

Also, the peekMessages method would probably return false or a SoapFault.

You can also set Exceptions to true on the SoapClient

like image 142
Owen Johnson Avatar answered Oct 11 '22 08:10

Owen Johnson