[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

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

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.
0
sbornstein2
Asked:
sbornstein2
1 Solution
 
OCDanCommented:
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
0
 
sbornstein2Author Commented:
isn't there a way with like waitcallback or something to wait until the web service completes?
0

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now