Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2006

Tip: Looking for answers? Try searching our database.

WSE Connection Problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bradley Plett - 20 May 2006 06:45 GMT
I have a strange connection problem with a web service that I wrote
using WSE.  I have a web service in a component.  I developed the
component using an interactive application, since it's much easier to
debug that way.  I have it working perfectly in the application.  I
then created a windows service that uses the same component, because I
eventually want a service to host the web service.  Everything works
well under both scenarios, except that I get strange connection
behavior.

I am behind a NAT router, and have gone through the steps to allow my
service to respond regardless of the incoming address.  If I host the
service in an application, I can connect to it just fine either
locally or remotely.  However, if I host the service in a Windows
service, I can only connect locally.  Remote connections are rejected.

- application hosting/local connection - works
- application hosting/remote connection - works
- service hosting/local connection - works
- service hosting/remote connection - FAILS!

Why is the service behaving differently?  Besides the NAT router, I
don't have a firewall active on my development machine.  My
development machine is not in the DMZ, but I have forwarded the
appropriate port.  Besides, when being hosted by an application,
everything works, so I really don't think this is a NAT nor a firewall
issue.

I do have one minor clue, but it hasn't helped me at all.  When I
first hosted in an application, and tried accessing remotely, Norton's
"Internet Worm Protection" popped up and asked for permission.
However, I completely disabled that, and it hasn't helped.  My service
is logging in with the same account I'm developing with, so I would
think it wouldn't be a profile difference.

Anybody got any ideas?  Any help would be much appreciated!

Thanks!
Brad.
Martin Kulov [MVP] - 21 May 2006 21:46 GMT
> I am behind a NAT router, and have gone through the steps to allow my
> service to respond regardless of the incoming address.  If I host the
[quoted text clipped - 6 lines]
> - service hosting/local connection - works
> - service hosting/remote connection - FAILS!

Brad,
can you telnet to your machine on the port you have opened?
Usually when I have connection problems, the first thing that I check is
whether telnet can connect to the specified socket.

Signature

Martin Kulov
http://www.codeattest.com/blogs/martin

MVP, MCT, MCSD.NET Early Achiever

Steven Cheng[MSFT] - 22 May 2006 06:43 GMT
Hi Brad,

Regarding on the webservice connecting issue, based on my experience, there
are still two possible causes in our webservice application or network
environment:

1. Is there any other particular code in your webservice which will try
connecting to another remote machine from your box? For windows service,
it's security context is a service logon session(though we can specify a
user account) and the program running under a non-interactive
destop/winstation. I'm wondering whether it's the webservcie's code (which
access other remote resource ) cause the error. to verify this ,you can try
using a very simple webservice instead to see whether it works.

2. As I mentioned in #1, since windows service running in a non-interactive
winstation, if there is any error, there won't popup a certain alert box
like in windows desktop application. So I think you can still try checking
whether there is any software which could block the remote connection. You
can completely disable or turn off such appication such as the Norton
firewall.

BTW, what' the detailed error message got in client?

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Bradley Plett - 22 May 2006 08:32 GMT
Thanks for your reply!

>Regarding on the webservice connecting issue, based on my experience, there
>are still two possible causes in our webservice application or network
[quoted text clipped - 7 lines]
>access other remote resource ) cause the error. to verify this ,you can try
>using a very simple webservice instead to see whether it works.

No, the code makes no other calls.  It does all of its work locally.
Also, as I've mentioned, my Windows service is not running under
"local system" or anything like that - I've configured it to use
exactly the same account that I'm using to develop the application.

Also, I've tried this with a completely simplistic ("Hello world")
service, and experience the same results.

(Also, see below re. Telnet.)

>2. As I mentioned in #1, since windows service running in a non-interactive
>winstation, if there is any error, there won't popup a certain alert box
>like in windows desktop application. So I think you can still try checking
>whether there is any software which could block the remote connection. You
>can completely disable or turn off such appication such as the Norton
>firewall.

Yes, I understand this point very well, and don't doubt that this
might be the problem, except for two things: 1) the connection itself
is being refused (see below), and 2) I would expect to see the same
error popping up when I'm using an application wrapper instead of a
Windows service wrapper.

I also don't doubt that it may be some other software in the way, but
I can't figure out what it might be.  I've disabled any and all
firewall and anti-virus software for my testing purposes.  Also, I
keep coming back to the thought that if it were some kind of firewall
or filtering software or something, I should see the same behavior
when the web service is hosted by an application, since I'm using the
same account (and hence, presumably, profile).

>BTW, what' the detailed error message got in client?

I don't think that the detailed error message in the client is
actually relevant.  The thing that I can't get around is the fact that
I get the same results if I simply use Telnet.  With Telnet, I can
connect in all situations except when the web service is hosted inside
a Windows service and the attempted connection is from a remote
machine.  In that scenario, even Telnet can't connect.

Having said that, here's the error message, in case it offers any
hints:
--------------------------------------------------
Microsoft.Web.Services2.AsynchronousOperationException: WSE101: An
asynchronous operation raised an exception. --->
System.Net.Sockets.SocketException: 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

Server stack trace:
  at Microsoft.Web.Services2.Messaging.SoapTcpConnection.Connect()
  at Microsoft.Web.Services2.Messaging.SoapTcpConnection..ctor(Uri
remoteEndpoint, SoapTcpTransportOptions options, ISoapFormatter
formatter)
  at
Microsoft.Web.Services2.Messaging.SoapTcpTransport.GetConnection(Uri
destination)
  at
Microsoft.Web.Services2.Messaging.SoapTcpOutputChannel.Send(SoapEnvelope
message)
  at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
  at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage
msg, IMessageSink replySink)

Exception rethrown at [0]:
  at
System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message
reqMsg, Boolean bProxyCase)
  at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object
NotUsed, MessageData& msgData)
  at
Microsoft.Web.Services2.Messaging.SendDelegate.EndInvoke(IAsyncResult
result)
  at
Microsoft.Web.Services2.Messaging.SoapOutputChannel.EndSend(IAsyncResult
result)
  at
Microsoft.Web.Services2.Messaging.SoapSender.EndSend(IAsyncResult
result)
  at
Microsoft.Web.Services2.Messaging.SoapClientAsyncResult.OnSendComplete(IAsyncResult
result)
  --- End of inner exception stack trace ---
  at Microsoft.Web.Services2.AsyncResult.End(IAsyncResult result)
  at
Microsoft.Web.Services2.Messaging.SoapClient.SendRequestResponse(String
methodname, SoapEnvelope envelope)
  at
Microsoft.Web.Services2.Messaging.SoapClient.SendRequestResponse(String
methodname, Object obj)
  at SCC_Regen.SCC_Regen_WebService.DoIt(Boolean request)
  at SCC_Regen.RepublishDoIt.Page_Load(Object sender, EventArgs e)
--------------------------------------------------

Thanks a lot for your help!
Brad.
Steven Cheng[MSFT] - 23 May 2006 10:19 GMT
Thanks for your response Brad,

Yes, now we can confirm that the issue should still concerned with the
windows service hosting scenario. I've also discussed with some other
engineers and they think that something as firewall software is still the
potential cause. At least, we should try to get telnet work from remote
client.

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Bradley Plett - 23 May 2006 16:30 GMT
I agree - it pretty much must be some kind of firewall-type software,
but I haven't been able to figure out what it is.

With respect to telnet - that's been my primary diagnostic tool since
the beginning.  :-)

Brad.

>Thanks for your response Brad,
>
[quoted text clipped - 21 lines]
>(This posting is provided "AS IS", with no warranties, and confers no
>rights.)
Bradley Plett - 23 May 2006 19:53 GMT
I've trimmed down my running processes to the absolute bare
essentials, and this hasn't helped.  Here's what I've got left
running:
--------------------------------------------------
C:\>tasklist /svc

Image Name                   PID Services
========================= ======
=============================================
System Idle Process            0 N/A
System                         4 N/A
smss.exe                     536 N/A
csrss.exe                    608 N/A
winlogon.exe                 632 N/A
services.exe                 676 Eventlog, PlugPlay
lsass.exe                    688 Netlogon, NtLmSsp, ProtectedStorage,
SamSs
svchost.exe                  848 DcomLaunch, TermService
svchost.exe                  924 RpcSs
svchost.exe                 1020 Dhcp, ERSvc, EventSystem,
lanmanserver,
                                lanmanworkstation, RasMan, SENS,
                                ShellHWDetection, TapiSrv, winmgmt
svchost.exe                 1068 Dnscache
svchost.exe                 1148 LmHosts, RemoteRegistry, SSDPSRV,
WebClient
nvsvc32.exe                  968 NVSvc
explorer.exe                2848 N/A
CCAPP.EXE                   1140 N/A
svchost.exe                 1008 stisvc
cmd.exe                     5800 N/A
ntvdm.exe                   5256 N/A
ctfmon.exe                  5904 N/A
msmsgs.exe                  5212 N/A
SCC_Regen_Service_WSE2.ex   3652 Service1
TASKLIST.EXE                3008 N/A
wmiprvse.exe                5188 N/A
--------------------------------------------------

Brad.

>Thanks for your response Brad,
>
[quoted text clipped - 21 lines]
>(This posting is provided "AS IS", with no warranties, and confers no
>rights.)
Steven Cheng[MSFT] - 24 May 2006 08:34 GMT
Thanks for your response Brad,

That's really strange. Have you tried manually creating a TCPListener in
that service application's code which  listening on a certain port? I think
that is also likely to fail ..  

BTW, have you tried testing remote connecting from any other client
machine? I'm also wondering whether it is another intermediate firewall or
proxy between the client and server machine that block the connection. How
do you think?

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Bradley Plett - 24 May 2006 16:05 GMT
You may want to check my follow-up at
http://groups.google.com/group/microsoft.public.dotnet.framework.webservices.enh
ancements/msg/f94fad8751120aaa?hl=en
&

I admit - I screwed up and embarrassed myself!

Brad.

>Thanks for your response Brad,
>
[quoted text clipped - 24 lines]
>(This posting is provided "AS IS", with no warranties, and confers no
>rights.)
Steven Cheng[MSFT] - 25 May 2006 02:48 GMT
Hi Brad,

Glad that you've figured out the problem and I think this is the most
important.

Have a good day!

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Bradley Plett - 22 May 2006 08:10 GMT
Telnet is one of the first tools I use in trying to diagnose a problem
like this.  Unfortunately, it has not helped me at all in this case.
:-(  Telnet follows exactly the same pattern as the client application
- it connects in all cases except from a remote machine when the web
service is hosted by a Windows service.

Brad.

>> I am behind a NAT router, and have gone through the steps to allow my
>> service to respond regardless of the incoming address.  If I host the
[quoted text clipped - 11 lines]
>Usually when I have connection problems, the first thing that I check is
>whether telnet can connect to the specified socket.
Martin Kulov [MVP] - 23 May 2006 00:24 GMT
> Telnet is one of the first tools I use in trying to diagnose a problem
> like this.  Unfortunately, it has not helped me at all in this case.
> :-(  Telnet follows exactly the same pattern as the client application
> - it connects in all cases except from a remote machine when the web
> service is hosted by a Windows service.

Well,
can you place some tracing code in your app to see if it actually opens the
socket or it throws silently some exception?

Regards,

Signature

Martin Kulov
http://www.codeattest.com/blogs/martin

MVP, MCT, MCSD.NET Early Achiever

Bradley Plett - 23 May 2006 03:27 GMT
WSE traces show nothing, since the connection does not even get
established.  Clearly, if the connection never gets established, it
never gets to any of my code.  I suppose I need some way of debugging
the actual connection process (i.e. to see what happens on the server
when this kind of incoming connection attempt hits the machine), but I
know of nothing that is at that low a level.

Brad.

>> Telnet is one of the first tools I use in trying to diagnose a problem
>> like this.  Unfortunately, it has not helped me at all in this case.
[quoted text clipped - 7 lines]
>
>Regards,
Martin Kulov [MVP] - 23 May 2006 20:27 GMT
> WSE traces show nothing, since the connection does not even get
> established.  Clearly, if the connection never gets established, it
> never gets to any of my code.  I suppose I need some way of debugging
> the actual connection process (i.e. to see what happens on the server
> when this kind of incoming connection attempt hits the machine), but I
> know of nothing that is at that low a level.

Brad,

when you host the WSE service in windows service there should be some code
that opens the socket for listening. If the socket is created successfully,
then the telnet client should be able to connect to it. Also run netstat -a
to see if there is someone listnening on that port before you start the
windows service and after you start it. If the socket is ok, then it should
be some firewall problem.

Regards,

Signature

Martin Kulov
http://www.codeattest.com/blogs/martin

MVP, MCT, MCSD.NET Early Achiever

Bradley Plett - 23 May 2006 21:18 GMT
Yes, I'm convinced that it must be a firewall issue, but I simply
can't figure out what it might be!  If you look at my other posts,
you'll notice that I've disabled pretty much everything that I can,
and still I can't get through.  :-(

The socket is definitely open for listening.  As I've said before, the
service works if accessed locally.  Also, telnet to the port works
fine as long as I'm local.

Do you know of any tool that will figure out the actual path of a
connection attempt through the various layers?  I've tried "netmon",
and the only difference I can see using that is that the incoming
packet gets a response fine when the it comes from a local address,
but gets no response at all when coming from a remote address.  The
packet reaches my machine, but then something either prevents the
packet from getting to the listener, or prevents the listener's
response from getting out.

Thanks!
Brad.

>> WSE traces show nothing, since the connection does not even get
>> established.  Clearly, if the connection never gets established, it
[quoted text clipped - 13 lines]
>
>Regards,
Bradley Plett - 23 May 2006 22:01 GMT
OK, I'm going to try wiping all of the egg off of my face, but it may
be difficult!  :-S

Thanks to all who replied.  It turned out to be the Windows firewall
after all.  Obviously checking and rechecking wasn't enough.
Apparently sometimes I need to check things three times!

Oh, well, I hope I didn't waste too much of your time.  I know I
wasted more of my own!

Brad.

>I have a strange connection problem with a web service that I wrote
>using WSE.  I have a web service in a component.  I developed the
[quoted text clipped - 34 lines]
>Thanks!
>Brad.
Martin Kulov [MVP] - 24 May 2006 22:56 GMT
> OK, I'm going to try wiping all of the egg off of my face, but it may
> be difficult!  :-S

oo do not worry
we have even more eggs :)))

Martin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.