public interface RestResource
java.lang.String call() throws com.ebasetech.xi.exceptions.FormRuntimeException, com.ebasetech.xi.exceptions.RestRuntimeException
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 if e.javaException instanceof com.ebasetech.xi.exceptions.RestRuntimeException) { log(e.javaException.message); }
com.ebasetech.xi.exceptions.RestRuntimeException
- if the REST resource has an internal error performing the call.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, com.ebasetech.xi.exceptions.RestRuntimeException
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.RestRuntimeException
- if the REST resource has an internal error performing the call.com.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during executioncall()