You can attempt to make a WebRequest that checks the wsdl of the web service. It's not a guarantee, but in most cases, if the service will serve the wsdl it'll serve the function as well. Here's one I wrote to test basic availability of a service.
Dim _streamReader As StreamReader
Dim responseString As New StringBuilder()
_streamReader = New StreamReader(Me.Response.GetResponseStream())
responseString.Append(_streamReader.ReadToEnd())
_streamReader.Close()
_streamReader = Nothing
If responseString.ToString().Contains("<wsdl:definitions") AndAlso _
responseString.ToString().Contains("</wsdl:definitions>") Then
wsdlVerified = True
Else
Throw New Exception("The response did not generate valid wsdl.")
End If
Where the properties for this class serve the code above:
Public Property Url() As String
Get
Return _url.Trim()
End Get
Set(ByVal value As String)
_url = value.Trim()
End Set
End Property
Public ReadOnly Property Request() As System.Net.HttpWebRequest
Get
If _request Is Nothing AndAlso Me.Url.Trim.Length > 0 Then _
_request = CType(System.Net.HttpWebRequest.Create(Me.Url & "?wsdl"), _
System.Net.HttpWebRequest)
Return _request
End Get
End Property
Public ReadOnly Property Response() As System.Net.HttpWebResponse
Get
If _response Is Nothing AndAlso Me.Url.Trim().Length > 0 Then _
_response = CType(Request.GetResponse(), System.Net.HttpWebResponse)
Return _response
End Get
End Property
EDIT: I'd refactor this into C# but it is fairly basic and should translate easily.