public interface RestResource
Modifier and Type | Method and Description |
---|---|
java.lang.String |
call()
Calls the default endpoint specified on the REST Web Services Resource.
|
java.lang.String |
call(java.lang.String endpointName)
Calls the endpoint specified by
endpointName on the REST Web Services Resource |
java.lang.String call() throws com.ebasetech.xi.exceptions.FormRuntimeException
The call will invoke the HTTP request method configured in the REST resource. e.g If the resource method is configured as GET, then a HTTP GET request is called.
The following rest HTTP methods support a request field
Javascript example:
// call the REST web service try { resources.GET_BOOKS.call(); var allBooks = JSON.parse(fields.MyBooksResponse.value); //process allBooks .... } catch (e) { log(e.javaException.message); }
com.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during executioncall(String)
java.lang.String call(java.lang.String endpointName) throws com.ebasetech.xi.exceptions.FormRuntimeException
endpointName
on the REST Web Services Resource
The call will invoke the HTTP request method configured in the rest resource. e.g If the resource method is configured as GET, then a HTTP GET request is called.
The following rest HTTP methods support a request field
Javascript example:
// call the rest try { fields.BookId.value = "16-148410-0"; resources.BOOKS.call("getBookByISBN"); var allBooks = JSON.parse(fields.BookResponse.value); //process book .... } catch (e if e.javaException instanceof com.ebasetech.xi.exceptions.RestRuntimeException) { log(e.javaException.message); }
endpointName
- the endpoint to be calledcom.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during executioncall()