If Web Service Exist?

J

joel_dizon

Hi,

Im writing a small application that checks whether a Web Service in is
available or not using VB.Net. Just need to decide whether to call a
secondary source or whatever. Can anyone help me with this or even
point me in the right direction.

Thanks in advance.

Joel
 
K

Karim

try calling the WebService from inside a Try Catch End Try block
eg
Try
Dim SomeObject = new WebServiceName()
Catch ex as SoapException
Console.WriteLine(ex.Message) 'Just in Case
'webservice not up
End Try

Does this answer your question?
 
J

joel_dizon

try calling the WebService from inside a Try Catch End Try block
eg
Try
Dim SomeObject = new WebServiceName()
Catch ex as SoapException
Console.WriteLine(ex.Message) 'Just in Case
'webservice not up
End Try

Does this answer your question?






- Show quoted text -

Hi Karim,

so sorry coz im still new with Web Service in VB.Net but here's what I
did so far...

1. I added a Web References -> MyWebService
2. Reference -> http://localhost/ACMEWS.asmx
3. In Form Class...

Public Class Form1
Inherits Windows.Forms.Form
Private service As MyWebService.ACMEWS

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click

service = New MyWebService.ACMEWS()

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

End Class

if button1 is clicked and web service is down it should notify me that
its down so i can decide which action to take.

are you saying to wrap this...

service = New MyWebService.ACMEWS()

with Try...Catch...End Try ?
 
J

joel_dizon

try calling the WebService from inside a Try Catch End Try block
eg
Try
Dim SomeObject = new WebServiceName()
Catch ex as SoapException
Console.WriteLine(ex.Message) 'Just in Case
'webservice not up
End Try

Does this answer your question?






- Show quoted text -

Hi Karim/Rowe,

Thanks, it works.

Many thanks.

Joel
 

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

Top