Closed andreasandreou closed 6 years ago
Maybe use ASP.NET WebAPI, use swashbuckle to generate a Swagger file.
Then use something like NSwag to generate the code for your swagger file. I think NSwag can also generate your swagger file.
Here's the fun part. Controllers in MVC 5/Web API 2.2 are relatively easy to port to MVC 6/MVC Core 1.0. Yes, you'll need to change namespaces and the whole pipeline will be different but at least your controller code is almost copy/paste.
Thanks for reply @MaximRouiller
We are working on fresh ground so we do need to worry about porting anything.
So from what I understand, your suggestion going forward, is to use WebAPI instead of WCF?
Yes sir.
Swagger is very fun in that you can go many ways to get the same result.
As mentioned before, NSwag or Swashbuckle can help you generate a swagger file from existing code. This will generate a definition of your API.
Think about 2 companies/team working together to integrate/build an API at the same time.
One swagger file. One company/team build the API while keeping the swagger file up to date. The other build the client basing themselves on the actual swagger file to ensure that their API uses yours properly.
Now let's say that a company/team provides you a swagger file to consume their service. You don't want to write this boilerplate by hand. You want it auto-generated as much as possible.
Check their website for a list of tools : http://swagger.io/open-source-integrations/
Thanks again @MaximRouiller
any other ideas regarding WCF vs WebAPI?
Is it safe to assume WebAPI is the future (even for web server to application server communication)?
WCF is hard to interoperate with anything other than HTTP protocol.
WebAPI is HTTP first. Depending on what you need, nothing prevent you from changing the content of a request to (for example) Protobuf. Of course, you won't be able to read it from a browser but if it's from Server to Server, well yeah!
That will allow you to actually leverage everything that has been built within WebAPI. Filters, advanced routing, middleware (in ASP.NET Core), authentication, caching, etc.
For me? WCF is dead for now.
You may want to take a look here: https://github.com/justkao/Bolt It's a library build on top of AspNetCore and is meant as replacement for WCF. It also supports some nice features like CancelationTokens and distributed sessions.
This issue is being closed because it has not been updated in 3 months.
We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.
Hi,
In the company I work for we are starting a new project and are excited to use the latest and greatest from AspNetCore. However we have a dilemma I would appreciate your feedback on.
Initial approach was to go with MVC 5 on web server and WCF on the application server. Although this is a proven and well working architecture since we do want to use AspNetCore and MVC 6 we quickly discovered that using WCF on the application server would be a challenge since WCF implementation is not supported in AspNetCore.
We examined our options and limited them into three scenarios:
So.. long story short :) What is the suggested way for this kind of architecture?
Thank you in advance for your comments