What is main different between WCF service library and WCF service application? [Resolved]

Posted by Programmer123 under WCF on 11/21/2013 | Points: 10 | Views : 9529 | Status : [Member] | Replies : 4
What is main different between WCF service library and WCF service application.
When to use them?




Responses

Posted by: Allemahesh on: 11/22/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
1. The WCF Service Application template can be used to create WCF services with a hosting website created within the project
2. The WCF Service Library template can be used to create WCF services that are hosted by the WCF Service Host, and these can be tested using the WCF service Test Client.

Happy Coding,
If it helps you or directs U towards the solution, MARK IT AS ANSWER

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 11/22/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Another different:-

1. The very basic point is that you need to select a "WCF Service Application" template under the WCF project type at the time of project creation. In other words when you create the project from File >> New >> Project, select the WCF as project type from the left side of the screen and select "WCF Service Application" from the template. Select your desired location and provide an appropriate name for your project and press the "OK" button.
2. For a WCF Service Library you need to select "WCF Service Library" template at the time of project creation.
3. In the Service Application we have a service contract i.e. IService1 for the service implementation and Service1 as a Web.config file.
4. In the Service Library we also have a service contract i.e. IService1 for the service implementation and Service1 as an App.config file for the configuration (instead of web.config as in the Service Application).

Happy Coding,
If it helps you or directs U towards the solution, MARK IT AS ANSWER

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/21/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
A service application includes a website host already setup for you. A service library is a library of services that a host can reference and startup.

If you start with a service library (recommended) you can then choose any host you wish (a windows service, IIS/ASP.NET, or even a console application) and you'd just reference your library from your new host. Choosing a Service Application limits your host to just IIS/ASP.NET.

The following link will provide you the detailed differences between WCF Service app and library...

http://www.c-sharpcorner.com/uploadfile/db2972/wcf-difference-between-service-application-and-service-lib/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/22/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
when to use?
If you want to have your WCF application code hosted in eventually multiple hosts (i.e., IIS, custom built or Windows Service) the best approach is to place your service definition and implementation in a WCF class library. If your service will only ever need to be exposed as an IIS service (i.e., if its a front-end service wrapping some business logic/functionality that you exposed to external business trading partners via the Internet), then baking the code into the host like the WCF Service Application template does makes sense. In fact, at a later date, you can migrate the code into a WCF class library and "hallow out" the IIS host by point it to the library.

Reference:
http://blogs.msdn.com/b/echarran/archive/2007/09/18/how-to-arrange-a-solution-using-the-wcf-service-library-and-wcf-service-application-templates.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response