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.
myVar IRest;
myResource String = ServiceLib.convertToJson(myRec);
call myVar.invokePost("http://www.example.com", myResource)
returning to myCallbackfunction;
myString STRING:
myVar IRest;
myResource String = ServiceLib.convertToJson(myRec);
myString = myVar.invokePost("http://www.example.com", myResource);
myVar IRest {@RESTService {baseURI="http://www.example.com"};
myResource String = ServiceLib.convertToJSON(myRec);
call myVar.invokePost("", myResource)
returning to myCallbackfunction;
function invokeDelete(reqURL string in) returns(string)
{@deleteRest {uriTemplate="{reqURL}"}};