Jump to content
Robert Gilland

How to even start? WSDL to REST

Recommended Posts

I currently use Web Services Tool kit (https://wiki.freepascal.org/Web_Service_Toolkit)

To generate WSDL documents, and server side implementation classes which I override to implement a SOAP web service.

It is fantastic.

I am looking to migrate to REST services.

I have gone through all of the demos of the MARS-Curiosity REST Library.

I cannot find anywhere where I can define my GET/POST/PUT API's .

And  then plug in my service side Delphi code.

I find no instructions on how to even start building REST API's.

Share this post


Link to post

Hi, you can start following instructions to install the library, if you haven't already. Check this link: https://github.com/andrea-magni/MARS/blob/master/docs/Installation.md

 

After that, find, compile and run the MARSCmd utility ( Utils/Source/MARScmd folder in your repository clone).

It will guide you through a simple wizard to startup your first MARS application, cloning the Demos/MARSTemplate project group.

 

You should have your first MARS REST server application up and running in 1 minute.

 

Sincerely,

Andrea 

Share this post


Link to post

Thank you Andrea, I have already done what you describe, and I don't know how to move forward from this skeleton application. I am used to generating the interface in WSDL using Web Services Tool kit and then having the Tool Kit auto generate Delphi classes I can easily plug my actual Delphi data access code in.

It does not seem that is possible  in REST.

It would be good to be able to build a YAML file and then have a set of pascal classes created to actually implement the REST service.

Maybe I have completely missed the point.

 

Kind Regards,

 

Robert Gilland.

Edited by Robert Gilland
I didn't properly respond the first time.

Share this post


Link to post

Hi, now I get what you meant, sorry.

To design your API in OpenAPI 3 format (for example) and to have the corresponding API implemented in MARS.

This is something I'd like to add as a feature but I would say not in the immediate future.

I've added (in the past) OpenAPI3 support to MARS, meaning the library will emit an OpenAPI3 description of your API (the other way around with respect to what you are asking).

 

It would be a nice addition to cover your use case.

 

I'll let you know if I'll find time to implement it (of course I would appreciate contribution as MARS is an OS project so if you feel to contribute, you are welcome!).

 

Sincerely,

Andrea

 

  • Like 1

Share this post


Link to post

That sounds great. My current plan is to see if I can use the OpenAPI demo  as a basis and see if I can get something actually working.

I am a bit lost as to how to GET a large binary file (5MB) with MARS.

Everything right now is explorative.

As I already have implemented all this functionality in WSDL.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×