开发者

WCF: Web Service or not?

I'm at the moment creating an ASP.NET web app which should call a WCF Service... The WCF Service have 2 methods:

Bitmap TakeScreenDump(string websiteUrl, int width, int height);
Bitmap GenerateThumbNail(Bitmap source, int width, i开发者_开发技巧nt height);

The purpose of my ASP.NET web app is to let a user request a screenshot for a specific website, which the web app will hand over to the WCF Service.

Now is my question: Should I create the WCF Service as a Web service (http binding) ? or should I create it as a Console service (net.tcp)? My WCF Service wont be used by anyone else than me.

Whats the advantages/disadvantages of those two in this case?


It doesn't matter. The service code will be exactly the same.

It's one of the most important things about WCF that the service is separate from the binding. If you think you might want to use more than one binding, then create the service as a "WCF Service Library" project. Then you can host it in a Console Application, Windows Service, or whatever, using whichever binding you like.

In fact, there's no reason you can't do both. You can host it in a Console application using one of the HTTP bindings if you like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜