VB.NET/ASP.NET Web service woes! Please help!! BMUK

K

Karl

Hi,

I'm accessing an ASP.NET webservice from within a vb.net rich client
application.
All goes perfectly when there is an available internet connection (the
app connects and all works as expected)or if the machine is standalone
and has no access to the web (the app cannot connect at all so tries
for a second or two then gives up and carries on).

The problem I have is with machines that are based on a LAN with no
internet connectivity. The line of code that connects to the
webservice sits there for at least a minute before realising that it
cannot connect and moving on.

I have a couple of questions:

1) How can I set a timeout on the webservice call to force it to give
up after a specified time? (I've tried setting the timeout property in
the webreference but it has made no difference)

2) Is there a quick check that can be run against a webservice to see
if it is available before trying to access it?

3) is there an easy way to check whether a client machine has web
access?? (I've tried creating an HTTPRequest, firing it at a popular
website and checking the response to see if it connected but this
hangs for the same period as the web service on a machine without a
connection!!)

This is the line that is causing problems:

Dim results() as object = me.invoke("GetCurrentVersion", new
object(-1){})

Any help will be greatly appreciated..!!!

thanks

Karl
 
D

Dino Chiesa [Microsoft]

Seems like it could the the DNS lookup that is timing out?

Try this
http://www.c-sharpcorner.com/Code/2002/April/IPLookUpMM.asp

to see if it, too, takes a really long time.

also an example for checking internet connectivity
http://msdn.microsoft.com/library/e...eterminingIfComputerIsConnectedToInternet.asp
maybe you are already doing something like that.

or you could try doing some p/invoke tricks to examine the IP config; maybe
there is something in there that can help you decide whether the internet is
available or not.

examples
http://www.dotnet247.com/247reference/msgs/18/91898.aspx
http://cheeso.members.winisp.net/srcview.aspx?file=MyIpConfig.cs


-D
 
K

Karl

Thanks for your reply Dino. I'll give it a go and let you know how it turns out...

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top