Jade now has a REST provider and the logical next step is to provide support for a REST consumer. SOAP and REST web service is required from both provider and consumer perspective to be able to play with other vendors of different sizes and backgrounds
Currently, JADE is able to provide RESTful web services using the JadeRestService RootSchema class, but it is not able to easily consume them. Limited functionality is available from the JadeHTTPConnection sendRequest method, but this is not sufficient for most use cases.
This feature will provide JADE REST client RootSchema classes, which allow for the easy consumption of REST Services. The interface will be similar to REST clients in other technologies, such as the RestSharp library of .NET - see http://restsharp.org/ for details.
The usage will be to create set properties on a JadeRestRequest object in order to specify the desired resource and any required inputs such as parameters or put/post data, then pass the object as a parameter to a method of the JadeRestClient class, which will return a JadeRestResponse object with properties for the various response information, along with deserialization methods.
In addition, this feature will include a proxy class generator, which consumes an OpenAPI (formerly Swagger) specification of a REST API and generates the appropriate data model and resource proxy classes.
At this time it is planned that the REST Client’s proxy classes will support the GET, PUT, POST and DELETE verbs, though the PATCH and OPTIONS verbs are also being considered. All (arbritrary) verbs will be available when using the JadeRestClient class directly.
Julie Harliwich 23/10/2018 2:38:11 PM
I think some helper methods would be great, or at the minimum some sample code. We got a Rest API consumer working by reimplementing JadeHttpConnection, but took a while to work out all the right options and tactics for handling request and response data. Have only used it to call APIs for one provider, not sure if it will work for any others. Our provider was Hong Kong based so got caught out by string/stringUtf8
John Richards 7/03/2018 2:40:05 PM
I've created a separate JEDI for the _type issue. Number 130.
Mauritz Viljoen 15/02/2018 12:57:46 PM
I think a good example would be to look at RestSharp (http://restsharp.org/) and duplicate what they have done.
It is a .NET Rest API client that I used in Jade to be able to easily consume REST from Jade. It would be nice to not have to use an external .NET dll.
As Troy have mentioned, have a way to easily add headers, parameters, url segments, certificates etc. Also allow for varying authentication methods.
I also think the JadeJson parser is a bit limited as it seems to be only intended to be used by REST provider in Jade.
Consuming a non Jade REST provider in Jade that requires JSON makes it a bit hard using JadeJson class to generate the JSON because the JadeJson class adds "__type" for instance and having a strick REST provider will reject JSON with invalid parameters, ie "__type", making the JadeJson parser useless.
So would be nice to add more functionality to the JadeJson parser. Allow us to remove "_type", have a way to prevent properties of a class to be added to the json string.
Also would be very helpful, if possible and maybe a long-shot, to have the ability to pass a parent class to the JadeJson parser and it being smart enough to know which subclass it should generate based on what is in json string, without having "__type" in the json string.
John Richards 7/02/2018 11:25:37 AM
Could you please provide more details of the functionality you would like JADE to provide.
Troy Fowles 21/12/2017 3:09:07 PM
A RestConsumer class wrapping the use of JadeHTTPConnection would be great. Make it easier to add request headers for authorization - WinHTTP -
setRequestHeader, make _httpHeaderAdd public.
Expose the Winhttp setClientCertificate so SSL certs can be used for authentication.
Mike Day 1/12/2017 10:18:51 AM
I'd be interested if you had some "helper" methods available to write a REST consumer. Even if they were not ready for official release yet. This is because we have a project with tight timeframes coming up and I don't really want to have to write something in .Net and import it back into Jade if I have to.
Brian Henwood 3/10/2017 10:32:34 AM
Yes, that would be correct
Brian Johnstone 27/09/2017 9:41:52 AM
Most REST services don't provide a rest equivalent of a WSDL, such as a WADL/RSDL, and indeed there are vigorous arguments about why WADL/RSDL is a "bad" idea. Given that there is therefore nothing to "import" to create proxy classes/properties/methods, as happens with SOAP's WSDL, I'm assuming what you're asking for is some additional "helper" classes/methods to help developers write a REST consumer using the relevant documentation of the REST service to know what services/calls are available?