2

I have a windows service and a remote IIS server that need to communicate without any user interaction. As I can’t guarantee the two machines will be on the same network; the service will connect to the server’s public facing IP over the internet (so security is critical) and transmit encrypted binary back and forth. I am still trying to decide whether to use an ASP.NET restful service or WCF on the server side.

I like the idea of WCF and it exposing its interface so that I can reference and use directly with POCO’s in client development; but it’s something pretty new to myself and setting it all up and getting the security right is a pain (especially if you’re dropping HTTP for net.tcp)

ASP.NET is much easier to setup and run, but consuming the REST api from a http client object on the client side seems clunky. And as there’ll be no web pages; having HTTP requests and responses seems like redundant overhead.

From someone who knows a little bit more about WCF, would this be a more appropriate use for it over ASP.NET? Or an I missing something here?

1
  • 1
    There's significantly more overhead in SOAP requests over WCF. Commented Aug 12, 2018 at 15:47

2 Answers 2

0

Consider using ASP.NET MVC with Binary JSON (BSON) or JSON-RPC.

Overall, JSON has much lower overhead than the SOAP protocol used by WCF, and there will be better support from Microsoft (and others) going forward.

I would avoid WCF for this, even though it appears to support JSON. WCF has a reputation for being difficult to work with, and there are better, more agile (and yes, more modern) alternatives.

Nor do you necessarily need REST compliance. REST is a protocol for establishing standard representations and operations for documents and other resources on the Internet. If you don't need this capability, you don't need REST.

References
JSON RPC Specification
Json Rpc Router for Asp.Net Core
BSON Specification
BSON Support in ASP.NET Web API 2.1
How I explained REST to my wife

0

Theres no doubt that WCF is a superior tech when it comes to the various security and protocol options you have with it. However, the fact is its been surplanted by Rest style .net Web.Api or .net core MVC apis.

HTTPS is secure enough, binary data can be suitably encoded, clients can be written by hand and crucially json apis can be consumed easily by websites and non microsoft languages.

I don't think anyone would recommend WCF over Web.Api in 2018 just because its old.

7
  • 3
    Nor should anyone recommend REST in 2018 just because it's new. And you haven't provided any compelling reasons in your answer to do so. Commented Aug 12, 2018 at 21:33
  • @RH I give two. "the fact is its been surplanted by Rest", "crucially json apis can be consumed easily by websites and non microsoft languages.". Now, if you only have betamax tapes at home, obvs you need a betamax video player. But I wouldnt go buy one new one.
    – Ewan
    Commented Aug 12, 2018 at 22:08
  • "The fact that it's been surplanted [sic] by rest" is the same as "it is new." "Crucially json apis can be consumed easily by websites and non Microsoft languages" is not relevant to the OP; he already stated that this is all Microsoft technologies. Commented Aug 13, 2018 at 1:26
  • "surplanted" is not the same as "new" and it is a reason to use one tech over another, just not a technical reason
    – Ewan
    Commented Aug 13, 2018 at 6:12
  • "new" is the reason to use .net core over webapi
    – Ewan
    Commented Aug 13, 2018 at 6:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.