Using a provided Interface part for a non-EGL REST service

In EGL, you can use the following Interface part to access a non-EGL REST service:
interface IRest
   function invokeGet(reqURL string in) returns(string)  
      {@getRest {uriTemplate="{reqURL}"}};
   function invokePost(reqURL string in, representation string in) returns(string)
      {@postRest {uriTemplate="{reqURL}"}};
   function invokePut(reqURL string in, representation string in) returns(string)
      {@putRest {uriTemplate="{reqURL}"}};
   function invokeDelete(reqURL string in, representation string in) returns(string) 
      {@deleteRest {uriTemplate="{reqURL}"}};
end

By using this Interface part as is, you do not have to write one. However, the work required to code the service-invocation statement is different.

Here is an example for asynchronous access, as occurs in Rich UI applications:
myVar IRest;
myResource String = ServiceLib.convertToJson(myRec);
call myVar.invokePost("http://www.example.com", myResource) 
    returning to myCallbackfunction;
Here is an example for synchronous access, as occurs elsewhere:
myString STRING:
myVar IRest;
myResource String = ServiceLib.convertToJson(myRec);
myString = myVar.invokePost("http://www.example.com", myResource);
The differences between synchronous and asynchronous access are as follows:
If you need a function prototype that has a different characteristic—for example, a DELETE operation that does not require you to pass a representation—create a similar Interface part, but change the InvokeDelete function prototype or add a prototype with a different name. Here is a changed prototype:
function invokeDelete(reqURL string in) returns(string) 
   {@deleteRest {uriTemplate="{reqURL}"}};

Feedback