473,472 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.net 2.0 asynchronous call did not work.

Someone help me please.

I've tried to write an asynchronous method, but it didn't call my web
service, do I need to do something in my webservice project to make it
work?

or if there is something wrong with the code that I have below.
Thanks..

The following are my two methods where one is calling web service and
second one is the delegate for callback method when asynchronous call
completed.

what I found is that it never went to the second sub that I created
when asynchornous finishes. weird... :(

sub CallWS()
Dim service As New CLWebService.service
service.Url = "http://localhost:2751/ws/Service.asmx"

'Add our callback function to the event handler
AddHandler service.GetConsultantsCompleted, AddressOf
GetConsultantsCallBack

'Call the Web service asynchronously
service.GetConsultantsAsync(#1/1/2005#, #1/5/2005#)

End Sub

Private Sub GetConsultantsCallBack(ByVal sender As Object, ByVal args
As CLWebService.GetConsultantsCompletedEventArgs)
Dim consultants() As CLWebService.Consultant = args.Result

Dim i As Integer = 1
For Each con As CLWebService.Consultant In consultants
Console.WriteLine(i.ToString & ". " & con.Name.Trim & " "
& con.Email.Trim)
i = i + 1
Next

End sub

Jul 15 '06 #1
1 1915

kkao77 a écrit :
Someone help me please.

I've tried to write an asynchronous method, but it didn't call my web
service, do I need to do something in my webservice project to make it
work?

or if there is something wrong with the code that I have below.
Thanks..

The following are my two methods where one is calling web service and
second one is the delegate for callback method when asynchronous call
completed.

what I found is that it never went to the second sub that I created
when asynchornous finishes. weird... :(

sub CallWS()
Dim service As New CLWebService.service
service.Url = "http://localhost:2751/ws/Service.asmx"

'Add our callback function to the event handler
AddHandler service.GetConsultantsCompleted, AddressOf
GetConsultantsCallBack

'Call the Web service asynchronously
service.GetConsultantsAsync(#1/1/2005#, #1/5/2005#)

End Sub

Private Sub GetConsultantsCallBack(ByVal sender As Object, ByVal args
As CLWebService.GetConsultantsCompletedEventArgs)
Dim consultants() As CLWebService.Consultant = args.Result

Dim i As Integer = 1
For Each con As CLWebService.Consultant In consultants
Console.WriteLine(i.ToString & ". " & con.Name.Trim & " "
& con.Email.Trim)
i = i + 1
Next

End sub
Hello,
At first I would check that calling synchronously the WebService works.
Did you check the the service.Url is correct ?

Jul 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
0
by: Jonathan Trevor | last post by:
Hi, I've found what appears to be a bug with ASP.NET web service method invocation - making it impossible to invoke and get the result of a synchronous web call after an asynchronous call has...
8
by: TC | last post by:
Hello, I am making an asynchronous call to a webservice and trying to update the web page with the results. The page is not updating. Does anybody know why??? Below is my code:
3
by: usenetaccount | last post by:
In a newly created test app, to maximize client performance I tried to make two SOAP method calls in tandem (the soap methods execute some specified query), as each call includes a large amount of...
4
by: taskswap | last post by:
I have a legacy application written in C that I'm trying to convert to C#. It processes a very large amount of data from many clients (actually, upstream servers - this is a mux) simultaneously. ...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
1
by: dba123 | last post by:
I need to perform Asynchronous Inserts using DAAB. So far I have a method which does an insert but how can I do this Asyncronously so that it does not affect the load on our public production...
2
by: dba123 | last post by:
I need a way to do this insert below asynchronously and I'm pretty much lost at this point. Is there some example out there using Enterprise Library 2.0? We don't care about the return, it's...
5
by: Ryan Liu | last post by:
Hi, I read Microsoft SDK, ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpovrasynchronousprogramming overview.htm there are 4 ways to call EndInvoke: The code in this topic demonstrates...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.