Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
So, in a nutshell, i want to implement some methods visible in the internet.
I think WCF, will be the best way, but i'm a little confused about how to host it.
I'm thinking about two ways:
1. Host by IIS, on www server.
2. Host by Windows Service, running on my computer, ofc connected to the internet.


edit:
Sorry, I have to improve my question, i don't want to start new one:
Which way will be better, in that situation:
- most of my WCF's methods will be used only in intranet - private computer network. For egzample - function - send email. So my network with have connection to global internet.
- when connection is lost, and someone want to send email - this email will be saved in DB as a tast to do in future.
- there will be a web page - with a log, with information about sent emails. So my web need to use probablly a WCF function "getLog" or sth like that.
I think: Windows service, which will be checking if there is a task to do in DB (there will be a lot of task - not only a 'future' email). the same windows service will host a WCF functions such as "send email" for local machines.. and "show log" for my web site.
That is why I thought hosting by windows service will be better. It is (in that situation) ?
Posted
Updated 28-Feb-11 7:18am
v2

I reckon hosting in IIS would be easier and more suitable.
 
Share this answer
 
Comments
mnd017 28-Feb-11 7:06am    
it is not important to me which is easier. I'm looking for better way.. safer, faster.. i don't know what else..

what do you mean by 'suitable' ?
jim lahey 28-Feb-11 7:58am    
By suitable I mean that you want to expose some methods to the internet, ergo you use the suitable technology for it, e.g. a web server
The best way is via IIS on a web server. *Your* machine won't always be turned on, or could be experiencing problems that affect your ability to serve the service. Beyond that, most ISPs don't allow you to run a web server from your house.
 
Share this answer
 
Comments
mnd017 28-Feb-11 8:08am    
Thank you for repley.
"Beyond that, most ISPs don't allow you to run a web server from your house."
I don't understand that. So If I had - computer with Windows Server 2008, external ip, i could run on my computer what ever i want. So i will run simple windows service, which will host WCF methods. And connect to that computer via internet from any place, and use those methods. Is that possible?
Sergey Alexandrovich Kryukov 28-Feb-11 11:15am    
Some ISP will not agree with you, that's it. What do you mean "external IP", is it a static one?
Changes are, you can self-host WCF and run you service in your computer...
--SA
mnd017 28-Feb-11 13:20pm    
I have to update my question. Some of my requirements were changed
You don't need WCF to send mail. You simply use the appropriate built in framework objects. WCF is for communicating between a client and a server.

If it were me, I'd have the windows service doing the check/email thing, but the web site would STILL be running on IIS, and would access the database for whatever you wanted to display to the user. Making the windows service communicate with the web site is kinda pointless.
 
Share this answer
 
Comments
mnd017 28-Feb-11 14:57pm    
But in my solution, web is running on IIS. From the web page i will access the database, but via WCF, to display some informations.

I know that i can implement sending message direct in the appliactions, and connect from webpage direct to DB... I just thought that keeping the whole bussiness 'part' in one pice (windows service), will be good idea.
mnd017 28-Feb-11 14:58pm    
*sending mails.. direct in the appliactions

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900