473,626 Members | 3,484 Online
Bytes | Software Development & Data Engineering Community
+ 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.se rvice
service.Url = "http://localhost:2751/ws/Service.asmx"

'Add our callback function to the event handler
AddHandler service.GetCons ultantsComplete d, AddressOf
GetConsultantsC allBack

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

End Sub

Private Sub GetConsultantsC allBack(ByVal sender As Object, ByVal args
As CLWebService.Ge tConsultantsCom pletedEventArgs )
Dim consultants() As CLWebService.Co nsultant = args.Result

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

End sub

Jul 15 '06 #1
1 1926

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.se rvice
service.Url = "http://localhost:2751/ws/Service.asmx"

'Add our callback function to the event handler
AddHandler service.GetCons ultantsComplete d, AddressOf
GetConsultantsC allBack

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

End Sub

Private Sub GetConsultantsC allBack(ByVal sender As Object, ByVal args
As CLWebService.Ge tConsultantsCom pletedEventArgs )
Dim consultants() As CLWebService.Co nsultant = args.Result

Dim i As Integer = 1
For Each con As CLWebService.Co nsultant In consultants
Console.WriteLi ne(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
2836
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 remote server and display this info on the UI. From doing some research, I know that the way my implementation works today is not thread-safe, because essentially my worker thread updates the UI, which is BAD. So, here I am trying to figure out how...
0
1661
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 been made if both are using sessions. Heres an example for two calls in the web service, the first is expected to be executed asynchronously by the client and the second to get the progress of the first while it is executing:
8
3009
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
3981
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 idle time by the client as it waits for a query to execute and return a dataset. As a test, I initially wrote two versions: ' // Sequential & Synchronous Dim webobj As com.mycompany.webobject Dim ds1 As System.Data.DataSet Dim ds2 As...
4
3809
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. I've read through what must be dozens of ways to do socket communication in C#, and it seems they all devolve into three basic options - Socket.Select, IOCP through a native interface, and Asynchronous callbacks. I'm fine using Asynchronous...
7
9702
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 for this being to stop the user thinking the application has frozen when in fact it is just waiting for a long SP to complete. Another reason for doing it like this is that I also have had a problem in the past where the SP takes longer than the...
1
2869
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 website? This question is wide open but make sure you give me some ideas in context with DAAB syntax. Some thoughts are threading, ATLAS, etc. but I have no clue how to even approach an Asynchronous Insert or any techniques at this point. Also, I...
2
2393
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 just a call to run a method in my class which performs the insert and we need to give the call back to the client or something...I guess this is asynchronous. I am still a bit foggy on how asynchronous works (I guess you return the call to the...
5
2298
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 four common ways to use BeginInvoke and EndInvoke to make asynchronous calls. After calling BeginInvoke you can:
0
8202
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8366
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2628
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 we have to send another system
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.