You are here

function SampleProcessor::accepts in Web Service Data 7

Accepted data formats

Tells the WsConnector the type of data the parser can accept as input. Some web services offer data in a variety of formats (ex: json, xml). This function tells the WsConnector instance what type of data to request from the service.

At the same time, if the WsConnector doesn't support the sepcified data format, the service call is skipped and a warning is logged.

You can define any kind of data format in the accepts array as long as the WsConnector knows how to interpret it. By default, "xml" and "json" are supported by the base class of WsConnector.

Return value

array Returns an array of strings.

Overrides WsData::accepts

File

modules/wsconfig/wsconfig.api.php, line 134
Describe the file

Class

SampleProcessor
Sample implementation of WsData

Code

function accepts() {
  return array(
    'xml',
    'json',
  );
}