1

I am going to create a WCF service(IIS host) and it will be called from client side javascript code.

When I call a WCF from client side, is the WCF a WCF library or WCF application type?

For example: I have the javascript below.

function AddFunds() {
    var postObject = {
        myID: myObject.myIDNumber,
        LocationID: myObject.LocationID,
        fundsToAdd: CurrencyFormatted($("#txtAddFunds").val())
};
    $.post('/OrServices/myService.svc/AddFunds',
        JSON.stringify(postObject)
        ).success(AddFundsResult);
}

In the beginning, I have to create WCF Service "myService.svc", but I am not sure if it is a library or application or doesn't matter.

John Saunders
  • 160,644
  • 26
  • 247
  • 397

1 Answers1

1

this answer describes the difference:

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 (though this might be ok for your purposes, but will limit the protocols you can use).

Edit: Changes in IIS since I wrote this allow for a wider variety of protocols on ASP.NET activated services, so choosing a service application is much less limiting than before.

if your only going to host in IIS then I would recommend to just use a Service Application. As a lot of the work is done for you.

Community
  • 1
  • 1
Mike
  • 2,547
  • 1
  • 24
  • 36