Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8989613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:18:14+00:00 2026-06-15T22:18:14+00:00

I am calling some web services, using SoapClient . I am looking for a

  • 0

I am calling some web services, using SoapClient. I am looking for a mechanism which will help me to display some errors to user, whenever web services goes offline or down.

As I have to wait for some time(15 sec) before displaying any errors to user. I am adding connection_timeout in SoapClient like this, for timeout.

$this->client = new SoapClient($clienturl,array('trace' => 1,
'exceptions'=> 1,
'connection_timeout'=> 15));   //$clienturl is webservice url

Also in top section of page, I have added this line,

ini_set("default_socket_timeout", 15); // 15 seconds

After specific timeout interval I am getting different SOAP-ERROR like this,

SOAP-ERROR: Parsing WSDL: Couldn't load from $clienturl

So I am looking for an error handler which will handle these SOAP-ERROR so as to display those in human-readable format to user like “Server is down, Try again after some time.” Or Is there any way to handle timeout errors?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:18:15+00:00Added an answer on June 15, 2026 at 10:18 pm

    You can put it in a try/catch

    try {
        $time_start = microtime(true);
        $this->client = new SoapClient($clienturl,array('trace' => 1,
            'exceptions'=> 1,
            'connection_timeout'=> 15
        ));
    } catch (Exception $e) {
        $time_request = (microtime(true)-$time_start);
        if(ini_get('default_socket_timeout') < $time_request) {
            //Timeout error!
        } else {
            //other error
            //$error = $e->getMessage();
        }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've an application which has some controller's actions calling slow 3rd party web services.
I am calling a Java web service, which returns some data. When I look
I downloaded an example application for using some web services with an online system.
I am experimenting with calling a web-service using jQuery. For some reason the result
I have been trying to connect to some web services using WCF but I
I am calling a web service using jquery which sits on another domain. The
Besides using Web Services, or POX (or custom HTTP), are there some other techniques
I have some problem with calling web service from flex. I have service with
My app is calling a web service to retrieve some data, and I want
I need some help. I am calling the login function from another class, //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.