开发者

PHP SOAP client and SOAP server errors

开发者 https://www.devze.com 2023-01-10 23:52 出处:网络
I have a web server which is acting as a SOAP client to comm开发者_高级运维unicate with a third party SOAP server. My client is implemented in PHP using php::soapclient.

I have a web server which is acting as a SOAP client to comm开发者_高级运维unicate with a third party SOAP server. My client is implemented in PHP using php::soapclient.

What is the best way to verify the SOAP server is functioning so I can provide the client browser with the site otherwise if if the SOAP server is down or not responding inform the user that the service is currently not available?

The system essentially provides a mashup of the third party services offered by using SOAP client/server communication to display data to the browser and let the users interact with the third party system.


well... once i worked with a php soap server and a php soap client. I think that when the client calls the service, it passes through the wsdl and if there's a problem during the conection (or even the execution) server side, the response of the client will be a SoapFault object.. id di something like

    $resp = $this->client->__soapCall($serviceName,$serviceParams);
    if (get_class($resp)=="SoapFault"){
         throw new Exception("Webservice error - Message: ".$resp->faultstring);
    }


You could call the http://server:1234/foo/bar?wsdl and if you do get the WSDL back, fire the actual SOAP request.

If the application is down, you probably won't get the WSDL and if it's only a part of the service that makes it hang, there is not much you can do to detect it beforehand anyway.

0

精彩评论

暂无评论...
验证码 换一张
取 消