?
Solved

Self-hosting WCF service in a Windows Service

Posted on 2012-03-09
3
Medium Priority
?
513 Views
Last Modified: 2012-03-12
Hi,

I'm new to WCF so don't be to hard on me. I've tried almost all the demos we can find on the net to self-host a WCF Service inside a Windows Service with no success. I've created that simple WCF service that works perfectly when self-hosted in a Windows Console Application. I can connect from the host PC and any remote PC. But when I try to host the same WCF service in a Windows Service host application, I always get these crazy error messages on the client side saying stuff about SSPI or that the service wasn't able to respond in a reasonable time...

What's the problem ? Why is it working perfectly when self-hosted in a Windows Console Application, but not working at all when self-hosted in a Windows Service host application (even when trying from the host PC) ? And what is funny about this, is that when I type in the URL to see if I can reach the wsdl file in my web browser, I do get it and also when I add the service (using the mex url) in a WCFtestClient.exe client (VS2010), I do see all the endpoints with there respective "operationContracts".

This drives me crazy and can't find a way to get out of this maze. I saw some folks out there having almost the same problem as me, but their problem was related to Windows Firewall being up and running on both sides. It's not my case. Windows Firewall is down.

Anybody ?
0
Comment
Question by:jettaa2vr6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:gopaltayde
ID: 37707005
Please check the binding. netTCP.
0
 
LVL 25

Accepted Solution

by:
apeter earned 2000 total points
ID: 37707869
Enable tracing in your wcf service to know more about the error message. This link shows how to enable tracing for a wcf service

http://msdn.microsoft.com/en-us/library/ms733025.aspx
0
 

Author Closing Comment

by:jettaa2vr6
ID: 37709631
Thanks apeter ! Using the trace, I could finally realize that it wasn't my WCF service that wasn't working properly inside a Windows Service host : the problem was that I was using a resource that wasn't available in a certain context.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will show you how to add an attribute to an XML (http://en.wikipedia.org/wiki/XML) stream returned from a Windows Communication Foundation (http://en.wikipedia.org/wiki/Windows_Communication_Foundation) (WCF) Web Service.  Some knowled…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 5 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question