Package com.ebasetech.xi.api
Interface RestResource
public interface RestResource
-
Method Summary
-
Method Details
-
call
java.lang.String call() throws com.ebasetech.xi.exceptions.FormRuntimeExceptionCalls the default endpoint specified 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
- PUT
- POST
- PATCH
- GET
- PUT
- POST
- PATCH
- OPTIONS
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); }
- Returns:
- HTTP code status from the REST call
- Throws:
com.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during execution- Since:
- V5.1
- See Also:
call(String)
-
call
java.lang.String call(java.lang.String endpointName) throws com.ebasetech.xi.exceptions.FormRuntimeExceptionCalls the endpoint specified byendpointName
on the REST Web Services ResourceThe 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
- PUT
- POST
- PATCH
- GET
- PUT
- POST
- PATCH
- OPTIONS
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); }
- Parameters:
endpointName
- the endpoint to be called- Returns:
- HTTP code status from the REST call
- Throws:
com.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during execution- Since:
- V5.1
- See Also:
call()
-