By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,494 Members | 859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,494 IT Pros & Developers. It's quick & easy.

Connection Error with Web Service

P: n/a
We have been receiving a connection error at one of our sites, our
application works elsewhere. The error occurs when our application written
in 2.0 running as a Windows Service under the LocalSystem account
attempts to connect to our web service (also written in 2.0) running at a
remote site. The error text is:

Exception in the Socket#25517075::Connect - A connection attempt failed
because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond.

I have taken the connection code and put it in a console app. When an admin
user launches the app from the command window, it can connect to the web
service. Likewise, when the admin user opens IE and types in the URL to the
web service, he can access it.

What could be different about the "LocalSystem" user that the service runs
as? I thought generally LocalSystem had more rights than an admin user.

Our network people say they've ruled out firewall as the cause, but I may
have them check that again. Even if they haven't checked it, it seems
strange that the same code can connect from a console app but not from a
Windows service.

Following is the function that returns true in the console app but not in
the Windows service. It is erroring on the call to ws.ValidLocation, which
is a web service method.

Any help would be greatly appreciated.

Private Function IsConnected(ByVal URL As String, ByVal Timeout As Integer)
As Boolean

Dim ws As ExchangeHost.ExchangeTransfer_ws
Dim blnTest As Boolean = False


ws = New ExchangeHost.ExchangeTransfer_ws
ws.Url = URL
ws.Timeout = Timeout


blnTest = True

Catch ex As Exception
If Not ws Is Nothing Then
End If
End Try

Return blnTest

End Function

Richard B
Nov 27 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.