473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Setting web service timeout in vb.net

How do I set the web service timeout in vb.net?
Mar 31 '08 #1
8 12816
Bob Connolly wrote:
How do I set the web service timeout in vb.net?
The web.config file for the service can have a <httpRuntime/element, which
includes an executionTimeout attribute. The httpRuntime element goes in the
<system.webelement. See this link:

http://msdn2.microsoft.com/en-us/lib...41(VS.80).aspx
Mar 31 '08 #2
This link references asp.net. I am not using asp.net. I am accessing a web
service in a windows console program and it keeps timing out. I have read
that the default is 100 seconds. I want to increase this. What is the syntax
that I should use in my program to do this?
--
Bob Connolly
"Steve Gerrard" wrote:
Bob Connolly wrote:
How do I set the web service timeout in vb.net?

The web.config file for the service can have a <httpRuntime/element, which
includes an executionTimeout attribute. The httpRuntime element goes in the
<system.webelement. See this link:

http://msdn2.microsoft.com/en-us/lib...41(VS.80).aspx
Mar 31 '08 #3
Bob,'

A webservice = aspnet.

If you want to do this in a windows form, than don't talk about a webservice
timeout.
Steve gave you a very nice answer, on something that you were not asking.

Your question is to unclear to give a full answer, however probably you can
let your thread sleep a while.

Cor

"Bob Connolly" <Bo*********@discussions.microsoft.comschreef in bericht
news:AD**********************************@microsof t.com...
This link references asp.net. I am not using asp.net. I am accessing a web
service in a windows console program and it keeps timing out. I have read
that the default is 100 seconds. I want to increase this. What is the
syntax
that I should use in my program to do this?
--
Bob Connolly
"Steve Gerrard" wrote:
>Bob Connolly wrote:
How do I set the web service timeout in vb.net?

The web.config file for the service can have a <httpRuntime/element,
which
includes an executionTimeout attribute. The httpRuntime element goes in
the
<system.webelement. See this link:

http://msdn2.microsoft.com/en-us/lib...41(VS.80).aspx
Mar 31 '08 #4
Bob Connolly wrote:
>>To do this I first added a Web reference (in Solution
Explorer) which I called AmiClmSvc_WebService (setting the Web
Reference URL property to point to the WSDL on my server with the
web service). Then in my code I have:

Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService.AmiClmSvc
Right, I have tried typing something like:

AmiClmSvc_Proxy.timeout = 5*60*1000

When I do this, there are no intellisense options and when I am done
it gives me a syntax error: "Declaration expected"
I don't know what is up. I would not like to use a web service instance that had
no properties.

Maybe that should be
Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService

If you don't have intellisense showing anything, how does it even make a call?
Apr 1 '08 #5
In the previous post you say:

Maybe that should be
Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService

When I try this I get a syntax error on AmiClmSvc_WebService that tells me
"Type Expected"

What else do you suggest?
--
Bob Connolly
"Steve Gerrard" wrote:
Bob Connolly wrote:
>To do this I first added a Web reference (in Solution
Explorer) which I called AmiClmSvc_WebService (setting the Web
Reference URL property to point to the WSDL on my server with the
web service). Then in my code I have:

Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService.AmiClmSvc
Right, I have tried typing something like:

AmiClmSvc_Proxy.timeout = 5*60*1000

When I do this, there are no intellisense options and when I am done
it gives me a syntax error: "Declaration expected"

I don't know what is up. I would not like to use a web service instance that had
no properties.

Maybe that should be
Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService

If you don't have intellisense showing anything, how does it even make a call?
Apr 1 '08 #6
Bob Connolly wrote:
In the previous post you say:

Maybe that should be
Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService

When I try this I get a syntax error on AmiClmSvc_WebService that
tells me "Type Expected"

What else do you suggest?
I don't really know. If you aren't getting intellisense on your proxy object, I
don't see how you can do anything with it. Does it have any properties or
methods, when you dim it the original way, As New AmiClmSvc_WebService.AmiClmSvc
?

Apr 2 '08 #7
I was finally able to resolve this issue, though I do not fully understand
why. When I originally coded as you suggested:

AmiClmSvc_Proxy.Timeout = 60 * 60 * 1000 '60 minutes

I got the errors that I described where I was not getting intellisense and
syntax error: "Declaration expected". I was coding this statement at the
Module level directly under the dim statement where I defined the
AmiClmSvc_Proxy in the first place. I was finally able to resolve the issue
when I coded the above statement within a SUB within the module. Suddenly the
intellisense started working and the timeout was changed. I don't understand
why the statement would work in one place and not the other, but it does.
Perhaps you can explain why? In any event, it is working and I thank you for
your help.

--
Bob Connolly
"Steve Gerrard" wrote:
Bob Connolly wrote:
In the previous post you say:

Maybe that should be
Dim AmiClmSvc_Proxy As New AmiClmSvc_WebService

When I try this I get a syntax error on AmiClmSvc_WebService that
tells me "Type Expected"

What else do you suggest?

I don't really know. If you aren't getting intellisense on your proxy object, I
don't see how you can do anything with it. Does it have any properties or
methods, when you dim it the original way, As New AmiClmSvc_WebService.AmiClmSvc
?

Apr 2 '08 #8
Cor,

Please go back to school before you start offending other posters like Bob. I have no idea how you got your MVP or in what area your MVP is in, but I can tell it's not in .NET. "A webservice = aspnet" is an absurd statement. .NET Web services can be accessed from anywhere with anything and on any platform as long as that anything runs .NET. You can even call a web service from managed SQL since SQL 2005 came out, and you could call Web services from Windows Application since the beginning of .NET.

Bob, your question was 100% valid. To set timeout on a web service, first instantiate that web service. Let's say you called your web service MyFunkyService when you added Web Reference to it to your project. Then you'd instantiate it like this:

Dim myServiceInstance as New MyFunkyService.MyFunkyService

"MyFunkyService" repeats twice because by default when you add a web service, a proxy class is created and placed in the same namespace as class itself, so the first "MyFunkyService" refers to the namespace while the second one - to class name.

To set timeout to, say, 360 seconds, write:

myServiceInstance.Timeout = 360000 'in milliseconds

I think you're right that default is at 100 seconds or 100000 milliseconds.
Jun 27 '08 #9

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

Similar topics

0
by: Carson Saunders | last post by:
I have a C# client application that calls a web service. I implement the CookieContainer class on the client to ensure the session is kept. However, I'm having trouble with the session timeout. I...
11
by: Frank Rizzo | last post by:
Hello, My c# based windows service takes a while to dispose. I have to release bunch of resources all over the place and unfortunately it can take 20-40 seconds before I can cleanly exit. ...
1
by: Scott Walters | last post by:
Hi, I have an asp.net webapp that uses some javascript in a hidden frame on the browser to poll the server every 30 seconds, using an http post. I also want my sessions to timeout in the...
2
by: wcchan | last post by:
Hi, We set debug="false" at web.config of a WebService for performance sake. We found that after set, the web service request will sometimes got a timeout exception. Would anyone tell me how long...
0
by: Barb | last post by:
Hello, I have a (C#) web service being consumed by a high volume "asp classic" site. It worked perfectly until I tried consuming a second web service from the first web service. Both services...
1
by: Shane | last post by:
I have a particular requirement when I call a web service; I have to call the web service, wait until the web service returns or my timeout expires (whichever is sooner) and exit. I tried to use...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully to that service and retrieves data. I then ported...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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
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,...
0
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...

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.