WebServiceData Struct Reference

The configuration data for a WebService. More...

#include <web_service_util.h>

Inheritance diagram for WebServiceData:
[legend]
Collaboration diagram for WebServiceData:
[legend]

Public Member Functions

bool InitWebServiceData (WebServiceData *const data_p, json_t *op_json_p)
 Initialise a WebServiceData. More...
 
void ClearWebServiceData (WebServiceData *const data_p)
 Clear a WebServiceData and free any associated memory. More...
 
bool CallCurlWebservice (WebServiceData *data_p)
 Make the request to the web service uri and store the response. More...
 
bool AddParametersToGetWebService (WebServiceData *data_p, ParameterSet *param_set_p)
 Add parameters to the HTTP GET request used by the given WebServiceData. More...
 
bool AddParametersToPostWebService (WebServiceData *data_p, ParameterSet *param_set_p)
 Add parameters to the HTTP POST request used by the given WebServiceData. More...
 
bool AddParametersToBodyWebService (WebServiceData *data_p, ParameterSet *param_set_p)
 Add parameters to an HTTP POST request with a JSON fragment in its body used by the given WebServiceData. More...
 

Data Fields

ServiceData wsd_base_data
 The base ServiceData. More...
 
json_t * wsd_config_p
 The configuration from the reference service. More...
 
const char * wsd_name_s
 The name of the WebService. More...
 
const char * wsd_description_s
 The description of the WebService. More...
 
const char * wsd_alias_s
 The alias of the WebService. More...
 
const char * wsd_info_uri_s
 The uri for more information about this WebService. More...
 
ParameterSetwsd_params_p
 The ParameterSet for this WebService. More...
 
ByteBufferwsd_buffer_p
 This is used to store the data when building the submission uri. More...
 
const char * wsd_base_uri_s
 The uri that the WebService will submit its query to. More...
 
SubmissionMethod wsd_method
 The SubmissionMethod to use to submit the query. More...
 
CurlToolwsd_curl_data_p
 The CurlTool used to send the request and receive the results. More...
 
- Data Fields inherited from ServiceData
struct Servicesd_service_p
 The service that owns this data. More...
 
json_t * sd_config_p
 If this service has an entry in global server config it will be stored here. More...
 
bool sd_config_flag
 If this is true, then this ServiceData will decrease the reference count on sd_config_p when this ServiceData is freed. More...
 

Detailed Description

The configuration data for a WebService.

This is used by reference services to call web services.

Member Function Documentation

◆ InitWebServiceData()

bool InitWebServiceData ( WebServiceData *const  data_p,
json_t *  op_json_p 
)

Initialise a WebServiceData.

Parameters
data_pThe WebServiceData to initialise.
op_json_pThe JSON fragment for the reference service which will be used to initialise the WebServiceData.
Returns
true if successful, false otherwise.

◆ ClearWebServiceData()

void ClearWebServiceData ( WebServiceData *const  data_p)

Clear a WebServiceData and free any associated memory.

Parameters
data_pThe WebServiceData to clear.

◆ CallCurlWebservice()

bool CallCurlWebservice ( WebServiceData data_p)

Make the request to the web service uri and store the response.

Parameters
data_pThe WebServiceData to make the request for.
Returns
true if successful, false otherwise.

◆ AddParametersToGetWebService()

bool AddParametersToGetWebService ( WebServiceData data_p,
ParameterSet param_set_p 
)

Add parameters to the HTTP GET request used by the given WebServiceData.

Parameters
data_pThe WebServiceData to build the request for.
param_set_pThe ParameterSet to use to build the request.
Returns
true if successful, false otherwise.

◆ AddParametersToPostWebService()

bool AddParametersToPostWebService ( WebServiceData data_p,
ParameterSet param_set_p 
)

Add parameters to the HTTP POST request used by the given WebServiceData.

Parameters
data_pThe WebServiceData to build the request for.
param_set_pThe ParameterSet to use to build the request.
Returns
true if successful, false otherwise.

◆ AddParametersToBodyWebService()

bool AddParametersToBodyWebService ( WebServiceData data_p,
ParameterSet param_set_p 
)

Add parameters to an HTTP POST request with a JSON fragment in its body used by the given WebServiceData.

Parameters
data_pThe WebServiceData to build the request for.
param_set_pThe ParameterSet to use to build the request.
Returns
true if successful, false otherwise.

Field Documentation

◆ wsd_base_data

ServiceData wsd_base_data

The base ServiceData.

◆ wsd_config_p

json_t* wsd_config_p

The configuration from the reference service.

◆ wsd_name_s

const char* wsd_name_s

The name of the WebService.

◆ wsd_description_s

const char* wsd_description_s

The description of the WebService.

◆ wsd_alias_s

const char* wsd_alias_s

The alias of the WebService.

◆ wsd_info_uri_s

const char* wsd_info_uri_s

The uri for more information about this WebService.

◆ wsd_params_p

ParameterSet* wsd_params_p

The ParameterSet for this WebService.

◆ wsd_buffer_p

ByteBuffer* wsd_buffer_p

This is used to store the data when building the submission uri.

◆ wsd_base_uri_s

const char* wsd_base_uri_s

The uri that the WebService will submit its query to.

◆ wsd_method

SubmissionMethod wsd_method

The SubmissionMethod to use to submit the query.

◆ wsd_curl_data_p

CurlTool* wsd_curl_data_p

The CurlTool used to send the request and receive the results.


The documentation for this struct was generated from the following file: