Skip to content

Webservice Calls

ValentinoAvonEFSA edited this page Nov 22, 2017 · 2 revisions

European Food Safety Authority

Webservice Calls

In this section, the webservice calls implemented in the EFSA-RCL are presented.

Generic Methods

Ping

Send a ping to the DCF to see if it is responding or not.

Usage

Ping req = new Ping();
boolean isResponding = req.ping();

Download Methods

GetDatasetList

It retrieves all the dataset related to the current user and to the selected data collection.

Usage

GetDatasetList req= new GetDatasetList("dataCollectionCode");
DatasetList<Dataset> datasets = req.getList();

GetDataset

It retrieves a specific dataset given its dataset id.

Usage

GetDataset req = new GetDataset("myId");
File file = req.getDatasetFile();  // handle to the downloaded .xml file

GetXsdFile

Get an xsd file from DCF given its resource id.

Usage

GetXsdFile req = new GetXsdFile("myId");
Document xsdFile = req.getFile();  // xml document

GetResourceList

Get the list of resources related to the selected data collection.

Usage

GetResourceList req = new GetResourceList("dataCollectionCode");
ResourceList resources = req.getList();

GetAck

Get an acknowledgment of a message given its id.

Usage

GetAck req = new GetAck("myMessageId");
Ack ack = req.getAck();

Upload Methods

SendMessage

Send an .xml report to the DCF for the selected data collection.

Usage

SendMessage req = new SendMessage(File); // input is an handle to the report .xml file
MessageResponse response = req.send();