Interface WebServiceResource
- All Superinterfaces:
Element
,Resource
,java.io.Serializable
,XmlResourceBase
public interface WebServiceResource extends XmlResourceBase
WebServiceResource
interface represents an Web Service Resource. A Web Service Resource is used
to call a web service, either locally or remotely.
- Since:
- V4.4
-
Method Summary
Methods inherited from interface com.ebasetech.xi.api.Element
getElementName, getElementType
Methods inherited from interface com.ebasetech.xi.api.XmlResourceBase
fetch, getDocument, setDocument, update
-
Method Details
-
call
void call() throws com.ebasetech.xi.exceptions.FormRuntimeException, com.ebasetech.xi.exceptions.SoapFaultExceptionCalls the default adapter specified on the Web Service Resource. When this is a Web Services Adapter, the web service is called. Note that different adapters support different methods and not all adapters support this method.Before the call request is processed, the
update()
method is called internally - this transfers any non-tabular field data to the resource from mapped form fields . After the call request is processed, thefetch()
method is called internally - this transfers any non-tabular field data from the resource to mapped form fields.If the resource is mapped to tables in the form, resource data must be updated prior to invoking this method; this is done using the
updateTable()
method on all relevant tables. Similarly, any tables resulting from the call should be fetched after invoking this method using thefetchTable()
method.Javascript example:
// update the BOOKS_REQUEST table in the request document tables.BOOKS_REQUEST.updateTable(); // call the web service try { resources.BOOKS_WS.call(); } catch (e if e.javaException instanceof com.ebasetech.xi.exceptions.SoapFaultException) { log(e.javaException.message); } // load the BOOKS table from the response document tables.BOOKS.fetchTable();
- Specified by:
call
in interfaceXmlResourceBase
- Throws:
com.ebasetech.xi.exceptions.SoapFaultException
- if the web service returns a SOAP Fault or if a client SOAP Fault is generated because it is not possible to connect to the web servicecom.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during execution- Since:
- V4.4
- See Also:
call(String)
-
call
void call(java.lang.String adapterName) throws com.ebasetech.xi.exceptions.FormRuntimeException, com.ebasetech.xi.exceptions.SoapFaultExceptionCalls the adapter specified byadapterName
on the Web Service Resource. Note that different adapters support different methods and not all adapters support this method.Before the call request is processed, the
update()
method is called internally - this transfers any non-tabular field data to the resource from mapped form fields . After the call request is processed, thefetch()
method is called internally - this transfers any non-tabular field data from the resource to mapped form fields.If the resource is mapped to tables in the form, resource data must be updated prior to invoking this method; this is done using the
updateTable()
method on all relevant tables. Similarly, any tables resulting from the call should be fetched after invoking this method using thefetchTable()
method.Javascript example:
// update the BOOKS_REQUEST table in the request document tables.BOOKS_REQUEST.updateTable(); // call the web service try { resources.BOOKS_WS.call("ADAPTER1"); } catch (e if e.javaException instanceof com.ebasetech.xi.exceptions.SoapFaultException) { log(e.javaException.message); } // load the BOOKS table from the response document tables.BOOKS.fetchTable();
- Specified by:
call
in interfaceXmlResourceBase
- Parameters:
adapterName
- the adapter to be called- Throws:
com.ebasetech.xi.exceptions.SoapFaultException
- if the web service returns a SOAP Fault or if a client SOAP Fault is generated because it is not possible to connect to the web servicecom.ebasetech.xi.exceptions.FormRuntimeException
- if any other error occurs during execution- Since:
- V4.4
- See Also:
call()
-