I get a timeout when calling a webservice from C#. Works fine in
browser. I am not doing anything out of the box. The same works on
other machines but not on mine. I tried writing HelloWorld service and
calling it and I get the same error.
I saw other posts relating to this (one talked about SETI and other
screen savers but I don't know which of my programs could be the
reason. I have tried uninstalling most of them).
I tried changing the localhost in the Reference.cs to my ipconfig and
I get a
Socket Exception.
Any pointers will help..
WITH IPADDRESS THE ERROR IS
'WindowsApplication1.exe': Loaded 'oevrvyg9', No symbols loaded.
A first chance exception of type 'System.NullReferenceException'
occurred in system.dll
Additional information: Object reference not set to an instance of an
object.
A first chance exception of type 'System.Net.Sockets.SocketException'
occurred in system.dll
Additional information: An established connection was aborted by the
software in your host machine
A first chance exception of type 'System.IO.IOException' occurred in
system.dll
Additional information: Unable to read data from the transport
connection.
A first chance exception of type 'System.Net.WebException' occurred in
system.dll
Additional information: The underlying connection was closed: An
unexpected error occurred on a receive.
A first chance exception of type 'System.Net.WebException' occurred in
system.web.services.dll
Additional information: The underlying connection was closed: An
unexpected error occurred on a receive.
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at WindowsApplication1.localhost.Service1.HelloWorld() in
D:\WindowsApplication1\Web References\localhost\Reference.cs:line 37
at WindowsApplication1.Form1.cmdBegin_Click(Object sender,
EventArgs e) in d:\windowsapplication1\form1.cs:line 97
WITH LOCAL HOST THE ERROR IS
Additional information: The operation has timed-out.
A first chance exception of type 'System.Net.WebException' occurred in
system.dll
Additional information: The operation has timed-out.
A first chance exception of type 'System.Net.WebException' occurred in
system.web.services.dll
Additional information: The operation has timed-out.
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest
request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at WindowsApplication1.localhost.Service1.HelloWorld() in
D:\WindowsApplication1\Web References\localhost\Reference.cs:line 37
at WindowsApplication1.Form1.cmdBegin_Click(Object sender,
EventArgs e) in d:\windowsapplication1\form1.cs:line 97
Hi,
I'll need some more information about how you set up the service virtual
directory to get started. For instance, a look at the code would help. I
know you stated it was a hello world, but I want to confirm that it's not
something obvious.
The next thing to do is to look at the configuration of the Vroot itself.
Since the debugger starts (e.g. shows the IE pages with the automatic
documentation), but from what you say, the SOAP dispatch isn't working when
called form a C# program...
Have you considered that the calling program is the issue? Again, some
facts about how you created this calling program, the relevant calling code
snippets, and what, if anything, you did to the machine similar to your
changing the machine config file (hint: NEVER touch this file as a rule!)
Hopefully we can drill into what changed, undoing those changes, and
figuring out what is working.
Regards
Dan Rogers
Microsoft Corporation
--------------------
>From: ksubha@gmail.com (subha)
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
[quoted text clipped - 7 lines]
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1100569925 21145 127.0.0.1 (16 Nov 2004
01:52:05 GMT)
>X-Complaints-To: groups-abuse@google.com
>NNTP-Posting-Date: Tue, 16 Nov 2004 01:52:05 +0000 (UTC)
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!not-for-mail
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26588
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 48 lines]
>request)
> at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReques
t
>request)
> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
[quoted text clipped - 20 lines]
>request)
> at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReques
t
>request)
> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
[quoted text clipped - 3 lines]
> at WindowsApplication1.Form1.cmdBegin_Click(Object sender,
>EventArgs e) in d:\windowsapplication1\form1.cs:line 97
subha - 16 Nov 2004 20:54 GMT
Which code would you like. Is there an ftp server where I can upload my zip
file? The virtual directory was setup when the ASP.NET webservice was
creating using the Visual Studio wizard.
calling program is a windows form app (I have put some relevant snippets
below) created using visual studio wizard.
I did mess around with machine.config initially but I uninstalled and
reinstalled IIS and did not touch it after that. I can put that also for you
in the zip file if I can somehow attach files. What section of the config
would you like to see and I can post it here
FORMS APP
private void cmdBegin_Click(object sender, System.EventArgs e)
{
try
{
localhost.Service1 x = new localhost.Service1();
// x.Timeout = 90000;
// x.Timeout = -1;
x.HelloWorld();
System.Diagnostics.Debug.WriteLine(x.HelloWorld());
}
catch(Exception exct)
{
System.Diagnostics.Debug.WriteLine(exct.Message.ToString());
// System.Diagnostics.Debug.WriteLine(exct.Source.ToString());
System.Diagnostics.Debug.WriteLine("INNER EXCEPTION" +
exct.InnerException.StackTrace.ToString());
System.Diagnostics.Debug.WriteLine(exct.StackTrace.ToString());
}
}
HELLO WORLD WEBSERVICE
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
GENERATED Reference.cs when adding the Web Reference using Visual Studio IDE
public Service1() {
this.Url = "http://localhost/WebService2/Service1.asmx";
}
EXCEPTION STACK TRACE
'WindowsApplication1.exe': Loaded 'va_qba8p', No symbols loaded.
The underlying connection was closed: An unexpected error occurred on a
receive.
An unhandled exception of type 'System.NullReferenceException' occurred in
WindowsApplication1.exe
Additional information: Object reference not set to an instance of an object.
Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object.
at WindowsApplication1.Form1.cmdBegin_Click(Object sender, EventArgs e)
in d:\windowsapplication1\form1.cs:line 104
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsApplication1.Form1.Main() in
d:\windowsapplication1\form1.cs:line 84The program '[2752]
WindowsApplication1.exe' has exited with code 0 (0x0).
> Hi,
>
[quoted text clipped - 129 lines]
> > at WindowsApplication1.Form1.cmdBegin_Click(Object sender,
> >EventArgs e) in d:\windowsapplication1\form1.cs:line 97
Dan Rogers - 16 Nov 2004 21:46 GMT
Let's start by just building a new proxy and just calling hello world. The
time-out stuff - is it happening immediately?
As a thing to try, go to the vroot for the service using IIS services
manager, click on properties, look at applicatton settings properties.
If the applicaiton name is blank, try this:
Click the remove button. The button should turn to a "create" button after
this. Click the create button. Click "Apply" at the bottom of the form,
and then click OK.
Try your new test application again.
If it still doesn't work, we'll have to start figuring out what part of
your .NET framework isn't set up correctly.
Regards,
Dan
--------------------
>Thread-Topic: Timeout when calling a webservice from C#
>thread-index: AcTMHmk1UA7rL+Z5Rua6dFRDJLGZwQ==
>X-WBNR-Posting-Host: 163.188.94.134
>From: "=?Utf-8?B?c3ViaGE=?=" <subha@discussions.microsoft.com>
>References: <7217b21f.0411151752.42443afd@posting.google.com>
<GwMfr1AzEHA.764@cpmsftngxa10.phx.gbl>
>Subject: RE: Timeout when calling a webservice from C#
>Date: Tue, 16 Nov 2004 12:54:05 -0800
[quoted text clipped - 13 lines]
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26622
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 119 lines]
>> >NNTP-Posting-Date: Tue, 16 Nov 2004 01:52:05 +0000 (UTC)
>> >Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
>> sfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!not-for-mail
>> >Xref: cpmsftngxa10.phx.gbl
[quoted text clipped - 52 lines]
>> >request)
>> > at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReques
>> t
>> >request)
[quoted text clipped - 22 lines]
>> >request)
>> > at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReques
>> t
>> >request)
[quoted text clipped - 4 lines]
>> > at WindowsApplication1.Form1.cmdBegin_Click(Object sender,
>> >EventArgs e) in d:\windowsapplication1\form1.cs:line 97