I Invoke Web Service, it's fine. ********Code Here**************************** CalcWebService calc = new CalcWebService(); AsyncCallback cb = new AsyncCallback(GetAddCompleted); IAsyncResult res = calc.BeginAdd(2, 2, cb, null); private void GetAddCompleted(IAsyncResult
res) { int sum = calc.EndAdd(res); } ********Code Here**************************** The return value is correct, it's great. But a few minutes later, I got an error 'System.NullReferenceException' Why? All things are right, why got the error message?
Call back dosn't helps in the example! Please see below post, it might helps you http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=341680 [Withought call back function, null reference] Hope it helps!
Thanks a lot. I run the Webservicessamples.exe, and happen the same thing. The return value is correct, a few minutes later, got an error 'System.NullReferenceException' *******Error Message**************************************************************** at
System.Net.OSSOCK.WSAGetOverlappedResult(IntPtr socketHandle, IntPtr overlapped, UInt32& bytesTransferred, Boolean wait, IntPtr ignored) at System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped*
nativeOverlapped)'[4496] *******Error Message**************************************************************** So, my code is right, because the Webservicessamples.exe also got the same message, but, I cann't find where the problem is, is my server wrong ?
I had put it on internet web-hosting, it also happened. Need your help, thanks...
"is my server wrong ? " I don't think so! Do you tried the way I told you to try in above post. To make you more clear see below example from MSDN, it worked for me! Try as below code, I took the piece of code form MSDN from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service11052002.asp
Dim proxy as New localhost.Service1() Dim result as IAsyncResult Result = proxy.BeginDelayedResponse(2000, _ Nothing, _ Nothing) While (result.IsCompleted = False) ' Do some processing ... Wend Dim response as String response = proxy.EndDelayedResponse(result)
See it works or not (By keeping 3 param as nothing)!
I try a very easy example "HelloWord", only a Label and a Button on Client App private void button1_Click(object sender, System.EventArgs e) { Service1 service = new Service1(); label1.Text = service.HelloWorld(); } oops! the result is the same, I can get the
"HelloWord" string, but about ten minutes later, I got 'System.NullReferenceException' again. I don't know how to do. Do you try it for me? Please... http://doraemon.europe.webmatrixhosting.net/Service1.asmx Thanks...
I tried on my machine (DSL connection). I could able to consume it very well. I tried 30 min, I did not got System.NullReferencException, But couple of times I got 'Time out' Error, that you can handel I guess, By calling it again second time by trapping 'Time
out' error!
Thanks... you are a good person. I find out the problem, if run Client App in Visual Studio .NET 2003 IDE, will get the 'System.NullReferenceException' if run without IDE, it works well. I don't know why it is. thanks again.
None
0 Points
14 Posts
The return value is correct, a few minutes later, 'System.NullReferenceException'
Sep 26, 2003 01:08 AM|sakurapuremm|LINK
Member
180 Points
3041 Posts
Re: The return value is correct, a few minutes later, 'System.NullReferenceException'
Sep 28, 2003 08:59 AM|SreedharK|LINK
http://www.w3coder.org
weblog http://weblogs.asp.net/skoganti
None
0 Points
14 Posts
Re: The return value is correct, a few minutes later, 'System.NullReferenceException'
Sep 29, 2003 05:03 AM|sakurapuremm|LINK
Member
180 Points
3041 Posts
Re: The return value is correct, a few minutes later, 'System.NullReferenceException'
Sep 29, 2003 05:55 AM|SreedharK|LINK
http://www.w3coder.org
weblog http://weblogs.asp.net/skoganti
None
0 Points
14 Posts
Re: The return value is correct, a few minutes later, 'System.NullReferenceException'
Sep 30, 2003 11:26 PM|sakurapuremm|LINK
Member
180 Points
3041 Posts
Re: The return value is correct, a few minutes later, 'System.NullReferenceException'
Oct 01, 2003 06:06 AM|SreedharK|LINK
http://www.w3coder.org
weblog http://weblogs.asp.net/skoganti
None
0 Points
14 Posts
Re: The return value is correct, a few minutes later, 'System.NullReferenceException'
Oct 01, 2003 08:14 AM|sakurapuremm|LINK