#include "dc/dc_Dpws.h"
#include "dc/dc_Epx.h"
Typedefs | |
typedef int(* | serialize_cbk )(void *serializer_context, void *user_data) |
Generic serialization callback used to send messages. | |
typedef int(* | parser_cbk )(void *parser_context, void *user_data) |
Generic parsing callback used to receive messages. | |
typedef int(* | serve_cbk )(struct dpws *dpws, void *parser_context, serialize_cbk *response_cbk, void **p_user_data) |
Generic service callback used to process a request. | |
Functions | |
Generic skeleton | |
Server message processing. | |
DC_RT_FMAC1 int | dpws_process_request (struct dpws *dpws, char *resp_action, char *fault_action, struct prefix_def *resp_root_pfxs, int nb_pfxs, serve_cbk serve_func) |
Generic server message processing function. | |
Generic stub | |
Client message processing. | |
DC_RT_FMAC1 int | dpws_send (struct dpws *dpws, struct wsa_endpoint_ref *to, char *action, struct prefix_def *root_pfxs, int nb_pfxs, serialize_cbk request_cbk, void *user_data) |
Sends a generic one-way SOAP message. | |
DC_RT_FMAC1 int | dpws_call (struct dpws *dpws, struct wsa_endpoint_ref *to, char *action, struct prefix_def *root_pfxs, int nb_pfxs, serialize_cbk request_cbk, parser_cbk response_cbk, void *user_data) |
Performs a generic request-response SOAP interaction. |
Allows web service invocations without code generation thanks especially to the EPX XML processing API.
typedef int(* serialize_cbk)(void *serializer_context, void *user_data) |
Generic serialization callback used to send messages.
serializer_context | An EPX serialization context. | |
user_data | Data that will be passed back to the callback in order for the developper to retrieve its context. |
typedef int(* parser_cbk)(void *parser_context, void *user_data) |
Generic parsing callback used to receive messages.
parser_context | An EPX parsing context. | |
user_data | Data that will be passed back to the callback in order for the developper to retrieve its context. |
typedef int(* serve_cbk)(struct dpws *dpws, void *parser_context, serialize_cbk *response_cbk, void **p_user_data) |
Generic service callback used to process a request.
dpws | A pointer on a dpws runtime data structure. | |
parser_context | An EPX parsing context for processing the incoming message. | |
[out] | response_cbk | The service callback should return a pointer on the function responsible for sending the response. Can be ignored if the response is empty or does not exist (one-way). The response callback may be called twice in order to calculate the message size (for the HTTP header) and is expected to produce the same output each time. |
[out] | p_user_data | Put here the data that will be passed back to the response callback in order for the developper to retrieve its context. |
DC_RT_FMAC1 int dpws_process_request | ( | struct dpws * | dpws, | |
char * | resp_action, | |||
char * | fault_action, | |||
struct prefix_def * | resp_root_pfxs, | |||
int | nb_pfxs, | |||
serve_cbk | serve_func | |||
) |
Generic server message processing function.
Calls to this API should be performed in a dispatch function (signature int dispatch(struct dpws *)) based on the WS-Addressing action contained in the dpws runtime structure.
dpws | A pointer on a dpws runtime data structure. | |
resp_action | The action used for the response. If NULL, the operation is supposed to be one-way (no response message). | |
fault_action | The action used for a potential SOAP fault. If NULL, the default action for fault messages defined by WS-Addressing is assumed. | |
resp_root_pfxs | struct prefix_def array of user prefix definitions to be set at the root of the response message and thus usable both in the headers and in the body. Nullable (set nb_pfxs to 0). | |
nb_pfxs | Number of elements in the user prefix array. | |
serve_func | The callback that will process the service. |
DC_RT_FMAC1 int dpws_send | ( | struct dpws * | dpws, | |
struct wsa_endpoint_ref * | to, | |||
char * | action, | |||
struct prefix_def * | root_pfxs, | |||
int | nb_pfxs, | |||
serialize_cbk | request_cbk, | |||
void * | user_data | |||
) |
Sends a generic one-way SOAP message.
dpws | A pointer on a dpws runtime data structure. | |
to | The destination endpoint reference. | |
action | The WS-Addressing action of the request. | |
root_pfxs | struct prefix_def array of user prefix definitions to be set at the root of the request message and thus usable both in the headers and in the body. Nullable (set nb_pfxs to 0). | |
nb_pfxs | Number of elements in the user prefix array. | |
request_cbk | The callback that will be in charge to send the message. It may be called twice in order to calculate the message size (for the HTTP header) and is expected to produce the same output each time. | |
user_data | Data that will be passed back to the callback in order for the developper to retrieve its context. |
DC_RT_FMAC1 int dpws_call | ( | struct dpws * | dpws, | |
struct wsa_endpoint_ref * | to, | |||
char * | action, | |||
struct prefix_def * | root_pfxs, | |||
int | nb_pfxs, | |||
serialize_cbk | request_cbk, | |||
parser_cbk | response_cbk, | |||
void * | user_data | |||
) |
Performs a generic request-response SOAP interaction.
dpws | A pointer on a dpws runtime data structure. | |
to | The destination endpoint reference. | |
action | The WS-Addressing action of the request. | |
root_pfxs | struct prefix_def array of user prefix definitions to be set at the root of the request message and thus usable both in the headers and in the body. Nullable (set nb_pfxs to 0). | |
nb_pfxs | Number of elements in the user prefix array. | |
request_cbk | The callback that will be in charge to send the request. It may be called twice in order to calculate the message size (for the HTTP header) and is expected to produce the same output each time. | |
response_cbk | The callback that will be in charge to receive the response. The callback is responsible to return SOAP_FAULT if the action matches a user fault error or in case of root tag mismatch. | |
user_data | Data that will be passed back to the callbacks in order for the developper to retrieve its context. |