Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

Create REST Web API

I have built all my WEB Services in the past as SOAP XML

In VS 2019
What is the process for building a REST WebAPI?

Avatar of David Favor
David Favor
Flag of United States of America image

Simple approach is to visit + pull off one of the many API projects, in whatever language you prefer.

Use this code as a starting point.
API Design Note

After having to recode many a failing API Endpoint system, here's an important design consideration.

1) Any synchronous API must be fast.

By synchronous I mean the API is called, then returns data.

You best well ensure all data to be returned is living in RAM... else...

2) The primary reason APIs fail is the project succeeds + traffic destroys API throughput.

The API keeps getting called, then falls behind answering requests, then the client (callers) + server (API Endpoint) start crashing.

3) The solution for any API service you expect to succeed is only use asynchronous API return design patterns.

The most common is to register a Webhook with the API service, then make an API call that returns instantly with no data payload, then as the API Endpoint server has time, a Webhook is called to return the data payload.

If you use an asynchronous API return design pattern then your API Endpoint will survive any level of traffic.
You didn't add a topic zone for ASP.NET but you mentioned VS 2019 and SOAP, so I'm reading between the lines here and thinking you built a WCF-based SOAP service in .NET.

Just to avoid assumptions, are you looking to use the same language and framework but just do it as REST instead of SOAP?

Aside from anything language-specific, there are some general good practice principles. For example, while most of SOAP behavior is defined in the message body and the SOAPAction header, REST often makes more just of different, less-common HTTP verbs like PATCH and DELETE.

However, I'm not sure if you're looking for general advice or something more specific like how to get started...?
Avatar of Larry Brister


 You are correct... I have a WCF Based Soap API where WE provide the endpoint for vendors to get insert sales and personnel data.  It is C# code base but I ddon;t care which if its C# or VB

Simply looking to morph it into REST and need some general guidelines...

As in

Do I need to recode the whole thing?

There are about 30 WebMethods and 5000 lines of code.
Avatar of gr8gonzo
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial