When I try to call web service asynchronousIy I am getting exception from CLR: System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced. (During VS.NET debugging the exception is wrapped as: Unable to connect to the remote server)
When i call the service synchronously it works perfectly. The service just convert strings to lower case.
I'm using .NET Framework 2.0, here is the source code of form to call the service asynchronously:
PartialClass ChangeStrings Inherits System.Web.UI.Page Dim ws As New MojeStringsService2 Protected Sub btnToLower_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnToLower.Click Dim ms As New MojeStringsService2 Dim acb As New AsyncCallback(AddressOf ToLowerCallBack) Dim ar As IAsyncResult = ms.BeginToLowerCase("Transfer this text to LOWERCASE", acb, ms) End Sub Private Sub ToLowerCallBack(ByVal ar As IAsyncResult) Dim ms As MojeStringsService2 = ar.AsyncState Me.lblResult.Text = ms.EndToLowerCase(ar) End Sub
Any Idea where could be a problem? Thanks