Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello,
 
I've been search and reading on this topic for a few days now but can't really find a simple answer to my question. Which of course means there probably isn't one, but hey, here's to hoping!
 
I would just like to know the advantages/disadvantages and differences of hosting a WCF service in an Asp.Net Web Application or a Windows Service
 
In my solution I have both a windows service and a Web App, and I'm just trying to get them to talk to eachother.
Posted 10-Jul-12 10:06am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello,
 
Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application.
An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.
 
Windows Service: Technical implementation of a program which
is intended to run in the background continuously. Example: SQL Server Service and all other services that you would see under Services.msc console on windows xp or vista.
 
When should I go to create Window service ?
You would use this when you want to create windows service. The sevice which has to run in the background without UI. Has basically got nothing to do with WCF. It can be a genenral ftp service or http service, MSMQ service.
Goto Start-> Run and type Services.msc. You will see services that the OS and other software installs and runs there.
 
When should I go to create a new WCF service application?
Like you can host your WCF services in windows service, where the services are constantly listening at some port. You can on the same lines host the services in IIS. For this you actually use this Option. Open this template and give it a run- F5. You will see the service by default will use ASP.net development server (see your windows tray) and host this service for you.
 
In what scenarios must WCF be used:
 
1) A secure service to process business transactions.
2) A service that supplies current data to others, such as a traffic report or other monitoring service.
3) A chat service that allows two people to communicate or exchange data in real time.
4) A dashboard application that polls one or more services for data and presents it in a logical presentation.
5) Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
6) A Silverlight application to poll a service for the latest data feeds.
 
For more information please go through following links:
What's the Difference between WCF and Web Services?[^]
Difference Between WCF and Windows Service[^]
  Permalink  
v2
Comments
bjorandb at 11-Jul-12 9:58am
   
Yes this did help give me some clairty on how WCF works. However, I'm still confused on how exactly I can use this to fit my needs. I apologize to begin with because I am a novice developer and even less experience with WCF. Let me first describe what I am trying to do, and maybe you could simplify it for me.
 

I have a Asp.Net web application running on a server. I then also have a Windows Service running on a different server. The windows service is a simple text file searcher. When the user enters a term on the Web site I want to hand the search term over to the windows service so it can search a text file for the term that was entered by the user.
 
I think WCF is the best method to do this?
 
Could I right click on my Web App, go to Add -> WCF Service (then host it via IIS) and make an end point in my Windows Service?
 

Thank you in advance for any help you're able to give me, I've been stuck on this for days!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 225
1 Sergey Alexandrovich Kryukov 137
2 OriginalGriff 130
3 _Amy 115
4 manoj kumar choubey 115
0 OriginalGriff 7,320
1 Sergey Alexandrovich Kryukov 6,043
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,572


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100