Web Service Method Call - How to wait for completion then return?

Posted on 2012-09-07
Last Modified: 2012-09-13
Hello all,

I am running a web service method sync as I don't want to run it async and it seems to start the processing but the call goes right through to my return; line in a console app I have.  I have a try catch and I want to make sure I catch any returned errors from it.  How do I wait for the service to complete like wait for callback or something?   Please provide a simple example if you could calling the method and wait.
Question by:sbornstein2
    LVL 9

    Accepted Solution

    Without knowing which WebServices you are connecting to and what there responses are like, it is hard to tell you exactly. But usually replies from WebServices have an Error/Warning element in their reply.

    So within your try catch block evaluate the response, if Error/Warning field is not empty then raise an exception

    This might help:
    WebServices Exception Handling

    Author Comment

    isn't there a way with like waitcallback or something to wait until the web service completes?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    This video is a brief demonstration on how to use security groups and Network Access Control Lists (ACLs) in Amazon Web Services.  Security groups and Network ACLs are mechanisms you can use in AWS to control network traffic.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now