Genivia Home Documentation
wsaapi.c File Reference

updated Tue May 21 2024 by Robert van Engelen
 
Functions | Variables
wsaapi.c File Reference
#include "wsaapi.h"
Include dependency graph for wsaapi.c:

Functions

static int soap_wsa_init (struct soap *soap, struct soap_wsa_data *data, void *arg)
 
static void soap_wsa_delete (struct soap *soap, struct soap_plugin *p)
 Deletes plugin data. More...
 
static int soap_wsa_header (struct soap *soap)
 Copies WS-Addressing action to SOAP action. More...
 
static void soap_wsa_set_error (struct soap *soap, const char **c, const char **s)
 Copies WS-Addressing action to SOAP action. More...
 
static int soap_wsa_response (struct soap *soap, int status, ULONG64 count)
 Overrides the HTTP response operations to send an HTTP POST. More...
 
static int soap_wsa_disconnect (struct soap *soap)
 Accepts HTTP 200 or 202 response upon HTTP POST response relay. More...
 
static int soap_wsa_alloc_header (struct soap *soap)
 Adds SOAP Header if not present. More...
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_wsa_rand_uuid (struct soap *soap)
 Generates a random UUID (UUID algorithm version 4). Compile all source codes with -DWITH_OPENSSL for better randomness. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_request (struct soap *soap, const char *id, const char *to, const char *action)
 Sets the WS-Addressing information header for the next request message with MessageID (optional), To (optional), and Action (required). More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_From (struct soap *soap, const char *from)
 Sets WS-Addressing From header for request message. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_NoReply (struct soap *soap)
 Sets WS-Addressing ReplyTo header to 'none' (no reply) More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_ReplyTo (struct soap *soap, const char *replyTo)
 Sets WS-Addressing ReplyTo header for request message. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_FaultTo (struct soap *soap, const char *faultTo)
 Sets WS-Addressing FaultTo header for request message. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_RelatesTo (struct soap *soap, const char *relatesTo)
 Sets WS-Addressing RelatesTo header. More...
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_wsa_From (struct soap *soap)
 Returns WS-Addressing From header. More...
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_wsa_ReplyTo (struct soap *soap)
 Returns WS-Addressing ReplyTo header. More...
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_wsa_FaultTo (struct soap *soap)
 Returns WS-Addressing FaultTo header. More...
 
SOAP_FMAC1 const char *SOAP_FMAC2 soap_wsa_RelatesTo (struct soap *soap)
 Returns WS-Addressing RelatesTo header. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_check (struct soap *soap)
 Checks the presence and validity of WS-Addressing information headers. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_reply (struct soap *soap, const char *id, const char *action)
 Sets WS-Addressing header fields for server response. Automatically relays the response to the ReplyTo address (when ReplyTo != to From and ReplyTo != 'none') and returns HTTP 202 Accept to sender when relay was successful. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_fault_subcode (struct soap *soap, int flag, const char *faultsubcode, const char *faultstring, const char *faultdetail)
 Sets sender/receiver SOAP Fault (sub)code for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_fault_subcode_action (struct soap *soap, int flag, const char *faultsubcode, const char *faultstring, const char *faultdetail, const char *action)
 Sets sender/receiver SOAP Fault (sub)code and action for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_sender_fault_subcode (struct soap *soap, const char *faultsubcode, const char *faultstring, const char *faultdetail)
 Sets sender SOAP Fault (sub)code for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_sender_fault_subcode_action (struct soap *soap, const char *faultsubcode, const char *faultstring, const char *faultdetail, const char *action)
 Sets sender SOAP Fault (sub)code for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_receiver_fault_subcode (struct soap *soap, const char *faultsubcode, const char *faultstring, const char *faultdetail)
 Sets receiver SOAP Fault (sub)code for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_receiver_fault_subcode_action (struct soap *soap, const char *faultsubcode, const char *faultstring, const char *faultdetail, const char *action)
 Sets receiver SOAP Fault (sub)code for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_sender_fault (struct soap *soap, const char *faultstring, const char *faultdetail)
 Sets sender SOAP Fault for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_receiver_fault (struct soap *soap, const char *faultstring, const char *faultdetail)
 Sets receiver SOAP Fault for server fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_check_fault (struct soap *soap, SOAP_WSA(FaultSubcodeValues)*fault)
 Checks the presence of a WS-Addressing fault. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_error (struct soap *soap, SOAP_WSA(FaultSubcodeValues) fault)
 Sets SOAP Fault (sub)code for server WS-Addressing fault response. More...
 
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa (struct soap *soap, struct soap_plugin *p, void *arg)
 Plugin registry function, used with soap_register_plugin and soap_register_plugin_arg. More...
 

Variables

const char soap_wsa_id [] = SOAP_WSA_ID
 
const char * soap_wsa_anonymousURI = "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"
 
const char * soap_wsa_noneURI = "addressing/none not supported"
 
const char * soap_wsa_faultAction = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault"
 
const char * soap_wsa_allAnonymousURI = "http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous http://www.w3.org/2005/08/addressing/anonymous"
 

Function Documentation

SOAP_FMAC1 int SOAP_FMAC2 soap_wsa ( struct soap *  soap,
struct soap_plugin *  p,
void *  arg 
)

Plugin registry function, used with soap_register_plugin and soap_register_plugin_arg.

Parameters
soapcontext
[in,out]pplugin created in registry
[in]argpassed from soap_register_plugin_arg
Returns
SOAP_OK
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_FaultTo ( struct soap *  soap,
const char *  faultTo 
)

Sets WS-Addressing FaultTo header for request message.

Parameters
soapcontext
[in]faultToendpoint URI or NULL for remove faultTo
Returns
SOAP_OK or SOAP_ERR

Use soap_wsa_request to populate the WS-Addressing header first.

SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_From ( struct soap *  soap,
const char *  from 
)

Sets WS-Addressing From header for request message.

Parameters
soapcontext
[in]fromendpoint URI
Returns
SOAP_OK or SOAP_ERR

Use soap_wsa_request to populate the WS-Addressing header first.

SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_NoReply ( struct soap *  soap)

Sets WS-Addressing ReplyTo header to 'none' (no reply)

Parameters
soapcontext
Returns
SOAP_OK or SOAP_ERR

Note: WS-Addressing 2005/08 standard.

Use soap_wsa_request to populate the WS-Addressing header.

SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_RelatesTo ( struct soap *  soap,
const char *  relatesTo 
)

Sets WS-Addressing RelatesTo header.

Parameters
soapcontext
[in]relatesToendpoint URI
Returns
SOAP_OK or SOAP_ERR

Use soap_wsa_request to populate the WS-Addressing header.

SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_add_ReplyTo ( struct soap *  soap,
const char *  replyTo 
)

Sets WS-Addressing ReplyTo header for request message.

Parameters
soapcontext
[in]replyToendpoint URI or NULL for anonymous
Returns
SOAP_OK or SOAP_ERR

Use soap_wsa_request to populate the WS-Addressing header.

static int soap_wsa_alloc_header ( struct soap *  soap)
static

Adds SOAP Header if not present.

Parameters
soapcontext
Returns
SOAP_OK
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_check ( struct soap *  soap)

Checks the presence and validity of WS-Addressing information headers.

Parameters
soapcontext
Returns
SOAP_OK or fault
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_check_fault ( struct soap *  soap,
SOAP_WSA(FaultSubcodeValues)*  fault 
)

Checks the presence of a WS-Addressing fault.

Parameters
soapcontext
[out]faultcode
Returns
SOAP_OK (no fault) or fault code
static void soap_wsa_delete ( struct soap *  soap,
struct soap_plugin *  p 
)
static

Deletes plugin data.

Parameters
soapcontext
[in,out]pplugin
Returns
SOAP_OK
static int soap_wsa_disconnect ( struct soap *  soap)
static

Accepts HTTP 200 or 202 response upon HTTP POST response relay.

Parameters
soapcontext
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_error ( struct soap *  soap,
SOAP_WSA(FaultSubcodeValues)  fault 
)

Sets SOAP Fault (sub)code for server WS-Addressing fault response.

Parameters
soapcontext
[in]faultis one of wsa:FaultSubcodeValues
Returns
SOAP_FAULT
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_fault_subcode ( struct soap *  soap,
int  flag,
const char *  faultsubcode,
const char *  faultstring,
const char *  faultdetail 
)

Sets sender/receiver SOAP Fault (sub)code for server fault response.

Parameters
soapcontext
[in]flag0=receiver, 1=sender
[in]faultsubcodesub code string
[in]faultstringfault string
[in]faultdetaildetail string
Returns
SOAP_FAULT
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_fault_subcode_action ( struct soap *  soap,
int  flag,
const char *  faultsubcode,
const char *  faultstring,
const char *  faultdetail,
const char *  action 
)

Sets sender/receiver SOAP Fault (sub)code and action for server fault response.

Parameters
soapcontext
[in]flag0=receiver, 1=sender
[in]faultsubcodesub code string
[in]faultstringfault string
[in]faultdetaildetail string
[in]actionWS-Addressing action string
Returns
SOAP_FAULT
SOAP_FMAC1 const char* SOAP_FMAC2 soap_wsa_FaultTo ( struct soap *  soap)

Returns WS-Addressing FaultTo header.

Parameters
soapcontext
Returns
From string or NULL
SOAP_FMAC1 const char* SOAP_FMAC2 soap_wsa_From ( struct soap *  soap)

Returns WS-Addressing From header.

Parameters
soapcontext
Returns
From string or NULL
static int soap_wsa_header ( struct soap *  soap)
static

Copies WS-Addressing action to SOAP action.

Parameters
soapcontext
Returns
SOAP_OK or fault

This callback is invoked to copy the WS-Addressing action to the SOAP action before invoking the service operation.

static int soap_wsa_init ( struct soap *  soap,
struct soap_wsa_data data,
void *  arg 
)
static
SOAP_FMAC1 const char* SOAP_FMAC2 soap_wsa_rand_uuid ( struct soap *  soap)

Generates a random UUID (UUID algorithm version 4). Compile all source codes with -DWITH_OPENSSL for better randomness.

Parameters
soapcontext
Returns
UUID "urn:uuid:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" or NULL if out of memory
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_receiver_fault ( struct soap *  soap,
const char *  faultstring,
const char *  faultdetail 
)

Sets receiver SOAP Fault for server fault response.

Parameters
soapcontext
[in]faultstringfault string
[in]faultdetaildetail string
Returns
SOAP_FAULT
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_receiver_fault_subcode ( struct soap *  soap,
const char *  faultsubcode,
const char *  faultstring,
const char *  faultdetail 
)

Sets receiver SOAP Fault (sub)code for server fault response.

Parameters
soapcontext
[in]faultsubcodesub code string
[in]faultstringfault string
[in]faultdetaildetail string
Returns
SOAP_FAULT
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_receiver_fault_subcode_action ( struct soap *  soap,
const char *  faultsubcode,
const char *  faultstring,
const char *  faultdetail,
const char *  action 
)

Sets receiver SOAP Fault (sub)code for server fault response.

Parameters
soapcontext
[in]faultsubcodesub code string
[in]faultstringfault string
[in]faultdetaildetail string
[in]actionWS-Addressing action string
Returns
SOAP_FAULT
SOAP_FMAC1 const char* SOAP_FMAC2 soap_wsa_RelatesTo ( struct soap *  soap)

Returns WS-Addressing RelatesTo header.

Parameters
soapcontext
Returns
From string or NULL
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_reply ( struct soap *  soap,
const char *  id,
const char *  action 
)

Sets WS-Addressing header fields for server response. Automatically relays the response to the ReplyTo address (when ReplyTo != to From and ReplyTo != 'none') and returns HTTP 202 Accept to sender when relay was successful.

Parameters
soapcontext
[in]idis the messageID (optional)
[in]actionis the target action (required)
Returns
SOAP_OK or fault
SOAP_FMAC1 const char* SOAP_FMAC2 soap_wsa_ReplyTo ( struct soap *  soap)

Returns WS-Addressing ReplyTo header.

Parameters
soapcontext
Returns
From string or NULL
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_request ( struct soap *  soap,
const char *  id,
const char *  to,
const char *  action 
)

Sets the WS-Addressing information header for the next request message with MessageID (optional), To (optional), and Action (required).

Parameters
soapcontext
[in]idis the message ID (optional)
[in]tois the target endpoint (optional, set to anonymous when NULL)
[in]actionis the target action (required)
Returns
SOAP_OK or error

Note: use soap_wsa_add_From, soap_wsa_add_ReplyTo, soap_wsa_add_FaultTo to add other addressing fields following this function call.

static int soap_wsa_response ( struct soap *  soap,
int  status,
ULONG64  count 
)
static

Overrides the HTTP response operations to send an HTTP POST.

Parameters
soapcontext
statuscode
countmessage length (if non-chunked)
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_sender_fault ( struct soap *  soap,
const char *  faultstring,
const char *  faultdetail 
)

Sets sender SOAP Fault for server fault response.

Parameters
soapcontext
[in]faultstringfault string
[in]faultdetaildetail string
Returns
SOAP_FAULT
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_sender_fault_subcode ( struct soap *  soap,
const char *  faultsubcode,
const char *  faultstring,
const char *  faultdetail 
)

Sets sender SOAP Fault (sub)code for server fault response.

Parameters
soapcontext
[in]faultsubcodesub code string
[in]faultstringfault string
[in]faultdetaildetail string
Returns
SOAP_FAULT
SOAP_FMAC1 int SOAP_FMAC2 soap_wsa_sender_fault_subcode_action ( struct soap *  soap,
const char *  faultsubcode,
const char *  faultstring,
const char *  faultdetail,
const char *  action 
)

Sets sender SOAP Fault (sub)code for server fault response.

Parameters
soapcontext
[in]faultsubcodesub code string
[in]faultstringfault string
[in]faultdetaildetail string
[in]actionWS-Addressing action string
Returns
SOAP_FAULT
static void soap_wsa_set_error ( struct soap *  soap,
const char **  c,
const char **  s 
)
static

Copies WS-Addressing action to SOAP action.

Parameters
soapcontext
cfault code
sfault string

Variable Documentation

const char* soap_wsa_allAnonymousURI = "http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous http://www.w3.org/2005/08/addressing/anonymous"

anonymous URI of 2004 and 2005 schemas

const char* soap_wsa_anonymousURI = "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"

Anonymous Reply/To endpoint address

const char* soap_wsa_faultAction = "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault"
const char soap_wsa_id[] = SOAP_WSA_ID

Plugin identification for plugin registry

const char* soap_wsa_noneURI = "addressing/none not supported"

Specifies no Reply endpoint address (no reply)