gSOAP WS-ReliableMessaging 2.8 Stable
|
#include "wsrmapi.h"
Functions | |
static int | soap_wsrm_init (struct soap *soap, struct soap_wsrm_data *data, void *arg) |
Initializes plugin data. | |
static int | soap_wsrm_copy (struct soap *soap, struct soap_plugin *p, struct soap_plugin *q) |
Copy plugin data. | |
static void | soap_wsrm_delete (struct soap *soap, struct soap_plugin *p) |
Deletes plugin data. | |
static int | soap_wsrm_send (struct soap *soap, const char *buf, size_t len) |
Internal callback function to override fsend(). When the wsrm plugin is enabled, saves the message to the current sequence that is created at the client side. Allows unacknowledged messages to be resend with soap_wsrm_resend(). | |
static int | soap_wsrm_preparefinalrecv (struct soap *soap) |
Internal callback function to override fpreparefinalrecv(). Takes acks returned by response to update the states of the sequences with acknowledgements. Acknowledged messages do not have to be resend and are purged from the sequence states. Also checks if at client-side response message was already received and otherwise records it in the state. | |
static int | soap_wsrm_disconnect (struct soap *soap) |
Internal callback function to override fdisconnect(). Turns caching off, sets the cached message to NACK, and resets the server-side handle, so sequence can be deallocated later. | |
static int | soap_wsrm_process_ack (struct soap *soap, struct _wsrm__SequenceAcknowledgement *ack) |
Internal function to purge acknowledged messages as given by wsrm:SequenceAcknowledgement header. | |
static int | soap_wsrm_chk_acks (struct soap *soap) |
Internal function to check for AckRequested headers to update state. | |
static int | soap_wsrm_add_acks (struct soap *soap, struct soap_wsrm_sequence *seq) |
Internal function to add SequenceAcknowledgement headers for AckRequested. Sends acknowledgements to the AcksTo destination service or back to the source related to the seq. These sends can take SOAP_WSRM_TIMEOUT seconds time, with at most 10 retries performed. | |
static int | soap_wsrm_set_ack (struct soap *soap, struct soap_wsrm_sequence *seq, struct _wsrm__SequenceAcknowledgement *ack) |
Internal function called by soap_wsrm_add_acks() to populate the SequenceAcknowledgement header block. | |
static int | soap_wsrm_resend_seq (struct soap *soap, struct soap_wsrm_sequence *seq, ULONG64 lower, ULONG64 upper) |
Internal function to resend unacknowledged messages of a sequence given a range of message numbers. Used by soap_wsrm_resend(). | |
static const char * | soap_wsrm_seq_newid (struct soap *soap, struct soap_wsrm_data *data) |
Internal function to generate a new sequence identifier. | |
static struct soap_wsrm_sequence * | soap_wsrm_seq_lookup_data (const struct soap_wsrm_data *data, const char *id) |
Internal function to look up sequence given its id. | |
static struct soap_wsrm_sequence * | soap_wsrm_seq_lookup_ack (const struct soap_wsrm_data *data, const char *id) |
Internal function to look up sequence given its acksid. | |
static struct soap_wsrm_sequence * | soap_wsrm_seq_insert (struct soap *soap, struct soap_wsrm_data *data) |
Internal function to create a new local sequence state. | |
static int | soap_wsrm_msg_append (struct soap *soap, struct soap_wsrm_data *data, const char *buf, size_t len) |
Internal function used by soap_wsrm_send() to append message data to the current message being transmitted for the current sequence. | |
static int | soap_wsrm_num_lookup (struct soap *soap, const struct soap_wsrm_sequence *seq, ULONG64 num) |
Internal function to look up a message number in the sequence state. | |
static int | soap_wsrm_num_insert (struct soap *soap, struct soap_wsrm_sequence *seq, ULONG64 num) |
Internal function to insert a message number in the sequence state. Updates the sequence ranges. | |
static int | soap_wsrm_num_size (const struct soap_wsrm_sequence *seq) |
Internal function returns the number of message ranges in a sequence state. | |
static void | soap_wsrm_num_free (struct soap *soap, struct soap_wsrm_sequence *seq) |
Internal function to deallocate all message number ranges from a sequence state. | |
static struct soap_wsrm_message * | soap_wsrm_msg_new (struct soap *soap, struct soap_wsrm_sequence *seq, ULONG64 num) |
Internal function to allocate a new message for a sequence sequence state. | |
static void | soap_wsrm_msg_free (struct soap *soap, struct soap_wsrm_message *p) |
Internal function to deallocate all cached message content from a sequence state. | |
int | soap_wsrm_create (struct soap *soap, const char *to, const char *acksto, LONG64 expires, const char *wsa_id, soap_wsrm_sequence_handle *seq) |
Creates a new sequence. Sequences are usually created by the sender (client) and confirmed by the receiver (server). The 'to' server address must be used for all messages of the sequence to be sent to the server. Optionally the 'acksto' address can be given for acknowledgement messages to be sent to. A sequence ID is generated by the server upon success. | |
int | soap_wsrm_create_offer (struct soap *soap, const char *to, const char *acksto, const char *id, LONG64 expires, enum wsrm__IncompleteSequenceBehaviorType behavior, const char *wsa_id, soap_wsrm_sequence_handle *seq) |
Creates a new sequence by offering suggested WS-RM parameters to the destination. Sequences are usually created by the sender (client) and confirmed by the receiver (server). The 'to' server address must be used for all messages of the sequence to be sent to the server. Optionally the 'acksto' address can be given for acknowledgement messages to be sent to. server upon success. | |
int | soap_wsrm_request_num (struct soap *soap, soap_wsrm_sequence_handle seq, const char *wsa_id, const char *wsa_action, ULONG64 num) |
Adds a WS-RM sequence message number to the next message transmitted. No acks are requested. | |
int | soap_wsrm_request (struct soap *soap, soap_wsrm_sequence_handle seq, const char *wsa_id, const char *wsa_action) |
Adds a WS-RM sequence message number to the next message transmitted to the WS-RM destination and increments the message counter by one. No acks are requested. | |
int | soap_wsrm_request_acks (struct soap *soap, soap_wsrm_sequence_handle seq, const char *wsa_id, const char *wsa_action) |
Adds a WS-RM sequence message number to the next message transmitted to the WS-RM destination and increments the message counter by one. Message acks for the current sequence are requested. | |
int | soap_wsrm_check_retry (struct soap *soap, soap_wsrm_sequence_handle seq) |
Client-side check to verify if the remote call can be retried when a failure occured. Increases the robustness of messages sends, by ensuring that the message was at least transmitted (but not necessarily received). Also implements HTTP 307 Temporary Redirect. Retries are limited to SOAP_WSRM_MAX_RETRIES iterations. | |
int | soap_wsrm_resend (struct soap *soap, soap_wsrm_sequence_handle seq, ULONG64 lower, ULONG64 upper) |
Client-side call to resend all non-acknowledged messages that were automatically cached for this sequence. Messages stored in the sequence for retransmission (those that were previously sent but not acknowledged) are resent to the soap_wsrm_to() address, which was set by soap_wsrm_create() or soap_wsrm_create_offer(). It is recommended to resend messages after the last message in the sequence was transmitted before closing the sequence. To reduce unnecessary resend attempts, it is recommended to use soap_wsrm_request_ack() with the last message to request acks for messages already delivered. | |
int | soap_wsrm_close (struct soap *soap, soap_wsrm_sequence_handle seq, const char *wsa_id) |
Closes the sequence, but does not yet terminate it. No new messages should be send, but messages can be resend with soap_wsrm_resend() if desired. | |
int | soap_wsrm_terminate (struct soap *soap, soap_wsrm_sequence_handle seq, const char *wsa_id) |
Terminates the sequence. No new messages should be send and no resends should be tried. Usually done after soap_wsrm_close() or any time to terminate the sequence prematurely. | |
int | soap_wsrm_acknowledgement (struct soap *soap, soap_wsrm_sequence_handle seq, const char *wsa_id) |
Sends acknowledgements. | |
void | soap_wsrm_seq_free (struct soap *soap, soap_wsrm_sequence_handle seq) |
Must be called to free the sequence allocated by soap_wsrm_create() or by soap_wsrm_create_offer(). Sequence handles are not automatically reclaimed by the engine. | |
const char * | soap_wsrm_to (soap_wsrm_sequence_handle seq) |
Returns the endpoint address of the destination service that serves the sequence. Initially set with soap_wsrm_create or soap_wsrm_create_offer. HTTP 307 Temporary Redirect can change the endpoint during the lifetime of a message sequence. Thus, this function returns the most recent endpoint binding that can be used to send message to the server endpoint. | |
const char * | soap_wsrm_acksto (soap_wsrm_sequence_handle seq) |
Returns the endpoint address of the AcksTo acknowledgement service that serves the sequence, when set with soap_wsrm_create() or soap_wsrm_create_offer() or NULL otherwise. HTTP 307 Temporary Redirect can change the endpoint during the lifetime of a message sequence. Thus, this function returns the most recent endpoint binding. | |
ULONG64 | soap_wsrm_num (soap_wsrm_sequence_handle seq) |
Returns the current message number of the sequence. | |
ULONG64 | soap_wsrm_nack (soap_wsrm_sequence_handle seq) |
Returns the number of non-acknowledged messages sent. | |
int | soap_wsrm_check (struct soap *soap) |
Server-side check for the presence of WS-Addressing and WS-RM header blocks in the SOAP header. Also prepares the return WS-RM header. This function should be called in the each service operation that supports WS-RM. Do not use this function in a ReplyTo response-accepting destination service operation. | |
int | soap_wsrm_reply_num (struct soap *soap) |
Adds a WS-RM sequence message number to the next message transmitted. No acks are requested. No WS-Addressing relay. | |
int | soap_wsrm_reply (struct soap *soap, const char *wsa_id, const char *wsa_action) |
Server-side server operation reply to be performed when the service operation returns. Server operations that support WS-Addressing and WS-RM must call this function to return normally (and allow the response to be relayed). | |
int | soap_wsrm_reply_request_acks (struct soap *soap, const char *wsa_id, const char *wsa_action) |
Server-side server operation reply to be performed when the service operation returns. Message acks for the current sequence are requested, but only when client made a create sequence offer. Server operations that support WS-Addressing and WS-RM must call this function or soap_wsrm_reply() to return normally (and allow the response to be relayed). | |
void | soap_wsrm_cleanup (struct soap *soap) |
Cleans up all expired sequences and releases resources. To be used at the server side to periodically clean up WS-RM sequences. Server-side cleanup is automatic, as long as WS-RM is in use. Does not release client-side sequences allocated by soap_wsrm_create() or soap_wsrm_create_offer(). | |
int | __wsrm__CreateSequence (struct soap *soap, struct wsrm__CreateSequenceType *req, struct wsrm__CreateSequenceResponseType *res) |
WS-RM CreateSequence service operation. Automatically invoked by the server to process a create sequence request (with or without offer). Creates a new local sequence state to keep track of messages. | |
int | __wsrm__CreateSequenceResponse (struct soap *soap, struct wsrm__CreateSequenceResponseType *res) |
WS-RM CreateSequenceResponse one-way service operation. Automatically invoked by the server to process a create sequence response (with or without offer). Creates a new local sequence state to keep track of messages. | |
int | __wsrm__CloseSequence (struct soap *soap, struct wsrm__CloseSequenceType *req, struct wsrm__CloseSequenceResponseType *res) |
WS-RM CloseSequence service operation. Automatically invoked by the server to process the close sequence request. Updates the server's local sequence state to closed. | |
int | __wsrm__CloseSequenceResponse (struct soap *soap, struct wsrm__CloseSequenceResponseType *res) |
WS-RM CloseSequenceResponse one-way service operation. Automatically invoked by the server to process the close sequence request. Updates the server's local sequence state to closed. | |
int | __wsrm__TerminateSequence (struct soap *soap, struct wsrm__TerminateSequenceType *req, struct wsrm__TerminateSequenceResponseType *res) |
WS-RM TerminateSequence service operation. Automatically invoked by the server to process the close sequence request. Updates the server's local sequence state to terminated. | |
int | __wsrm__TerminateSequenceResponse (struct soap *soap, struct wsrm__TerminateSequenceResponseType *res) |
WS-RM TerminateSequenceResponse one-way service operation. Automatically invoked by the server to process the terminate sequence request. Updates the server's local sequence state to terminated. | |
int | __wsrm__SequenceAcknowledgement (struct soap *soap) |
WS-RM SequenceAcknowledgement operation. | |
int | __wsrm__AckRequested (struct soap *soap) |
WS-RM AckRequested operation. | |
int | __wsrm__LastMessage (struct soap *soap) |
WS-RM LastMessage operation (WS-RM 1.0). | |
int | soap_wsrm_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 faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender. | |
int | soap_wsrm_sender_fault_subcode (struct soap *soap, const char *faultsubcode, const char *faultstring, const char *faultdetail) |
Sets sender SOAP Fault (sub)code for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender. | |
int | soap_wsrm_receiver_fault_subcode (struct soap *soap, const char *faultsubcode, const char *faultstring, const char *faultdetail) |
Sets receiver SOAP Fault (sub)code for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender. | |
int | soap_wsrm_sender_fault (struct soap *soap, const char *faultstring, const char *faultdetail) |
Sets sender SOAP Fault for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender. | |
int | soap_wsrm_receiver_fault (struct soap *soap, const char *faultstring, const char *faultdetail) |
Sets receiver SOAP Fault for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender. | |
int | soap_wsrm_check_fault (struct soap *soap, enum wsrm__FaultCodes *fault, const char **info) |
Checks the presence of a WS-RM fault at the client side (or in the FaultTo destination service) when a response is received. | |
int | soap_wsrm_error (struct soap *soap, struct soap_wsrm_sequence *seq, enum wsrm__FaultCodes fault) |
Sets SOAP Fault (sub)code for server WS-RM fault response. Terminates the sequence. | |
void | soap_wsrm_dump (struct soap *soap, FILE *fd) |
Dumps the current sequences and details of the wsrm plugin for diagnotics purposes. | |
int | soap_wsrm (struct soap *soap, struct soap_plugin *p, void *arg) |
Plugin registry function, used with soap_register_plugin. | |
struct soap_wsrm_sequence * | soap_wsrm_seq_lookup_id (struct soap *soap, const char *id) |
Function to look up sequence given its id. | |
struct soap_wsrm_sequence * | soap_wsrm_seq_lookup (struct soap *soap, const char *id) |
Function to look up sequence given its id. | |
struct soap_wsrm_sequence * | soap_wsrm_seq (struct soap *soap) |
Assuming a SOAP header is received, gets the sequence associated with the message. | |
int | soap_wsrm_seq_created (struct soap *soap, struct soap_wsrm_sequence *seq) |
Function to check if a sequence is created. | |
int | soap_wsrm_seq_terminated (struct soap *soap, struct soap_wsrm_sequence *seq) |
Function to check if a sequence is terminated or needs to be terminated when expired. | |
ULONG64 | soap_wsrm_msgs (struct soap *soap, const struct soap_wsrm_sequence *seq) |
Returns the number of complete messages received, or 0 when there is a gap. | |
Variables | |
const char | soap_wsrm_id [] = SOAP_WSRM_ID |
static struct soap_wsrm_sequence * | soap_wsrm_session = NULL |
char | soap_wsrm_idname [40] = "" |
int | soap_wsrm_idnum = 0 |
static MUTEX_TYPE | soap_wsrm_session_lock = MUTEX_INITIALIZER |
int __wsrm__AckRequested | ( | struct soap * | soap | ) |
WS-RM AckRequested operation.
soap | context |
int __wsrm__CloseSequence | ( | struct soap * | soap, |
struct wsrm__CloseSequenceType * | req, | ||
struct wsrm__CloseSequenceResponseType * | res | ||
) |
WS-RM CloseSequence service operation. Automatically invoked by the server to process the close sequence request. Updates the server's local sequence state to closed.
soap | context | |
[in] | req | wsrm__CloseSequence request message |
[out] | res | wsrm__CloseSequenceResponse response message |
int __wsrm__CloseSequenceResponse | ( | struct soap * | soap, |
struct wsrm__CloseSequenceResponseType * | res | ||
) |
WS-RM CloseSequenceResponse one-way service operation. Automatically invoked by the server to process the close sequence request. Updates the server's local sequence state to closed.
soap | context | |
[in] | res | wsrm__CloseSequenceResponse response message |
int __wsrm__CreateSequence | ( | struct soap * | soap, |
struct wsrm__CreateSequenceType * | req, | ||
struct wsrm__CreateSequenceResponseType * | res | ||
) |
WS-RM CreateSequence service operation. Automatically invoked by the server to process a create sequence request (with or without offer). Creates a new local sequence state to keep track of messages.
soap | context | |
[in] | req | wsrm__CreateSequence request message |
[out] | res | wsrm__CreateSequenceResponse response message |
int __wsrm__CreateSequenceResponse | ( | struct soap * | soap, |
struct wsrm__CreateSequenceResponseType * | res | ||
) |
WS-RM CreateSequenceResponse one-way service operation. Automatically invoked by the server to process a create sequence response (with or without offer). Creates a new local sequence state to keep track of messages.
soap | context | |
[in] | res | wsrm__CreateSequenceResponse response message |
int __wsrm__LastMessage | ( | struct soap * | soap | ) |
WS-RM LastMessage operation (WS-RM 1.0).
soap | context |
int __wsrm__SequenceAcknowledgement | ( | struct soap * | soap | ) |
WS-RM SequenceAcknowledgement operation.
soap | context |
int __wsrm__TerminateSequence | ( | struct soap * | soap, |
struct wsrm__TerminateSequenceType * | req, | ||
struct wsrm__TerminateSequenceResponseType * | res | ||
) |
WS-RM TerminateSequence service operation. Automatically invoked by the server to process the close sequence request. Updates the server's local sequence state to terminated.
soap | context | |
[in] | req | wsrm__TerminateSequence request message |
[out] | res | wsrm__TerminateSequenceResponse response message |
int __wsrm__TerminateSequenceResponse | ( | struct soap * | soap, |
struct wsrm__TerminateSequenceResponseType * | res | ||
) |
WS-RM TerminateSequenceResponse one-way service operation. Automatically invoked by the server to process the terminate sequence request. Updates the server's local sequence state to terminated.
soap | context | |
[in] | res | wsrm__TerminateSequenceResponse response message |
int soap_wsrm | ( | struct soap * | soap, |
struct soap_plugin * | p, | ||
void * | arg | ||
) |
Plugin registry function, used with soap_register_plugin.
soap | context | |
[in,out] | p | plugin created in registry |
[in] | arg | optional argument passed from soap_register_plugin_arg |
int soap_wsrm_acknowledgement | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
const char * | wsa_id | ||
) |
Sends acknowledgements.
soap | context | |
seq | sequence handle set by soap_wsrm_create or soap_wsrm_create_offer | |
[in] | wsa_id | WS-Addressing message ID (optional) |
const char* soap_wsrm_acksto | ( | soap_wsrm_sequence_handle | seq | ) |
Returns the endpoint address of the AcksTo acknowledgement service that serves the sequence, when set with soap_wsrm_create() or soap_wsrm_create_offer() or NULL otherwise. HTTP 307 Temporary Redirect can change the endpoint during the lifetime of a message sequence. Thus, this function returns the most recent endpoint binding.
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() |
static int soap_wsrm_add_acks | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq | ||
) | [static] |
Internal function to add SequenceAcknowledgement headers for AckRequested. Sends acknowledgements to the AcksTo destination service or back to the source related to the seq. These sends can take SOAP_WSRM_TIMEOUT seconds time, with at most 10 retries performed.
soap | context | |
[in] | seq | pointer to sequence |
int soap_wsrm_check | ( | struct soap * | soap | ) |
Server-side check for the presence of WS-Addressing and WS-RM header blocks in the SOAP header. Also prepares the return WS-RM header. This function should be called in the each service operation that supports WS-RM. Do not use this function in a ReplyTo response-accepting destination service operation.
soap | context |
int soap_wsrm_check_fault | ( | struct soap * | soap, |
enum wsrm__FaultCodes * | fault, | ||
const char ** | info | ||
) |
Checks the presence of a WS-RM fault at the client side (or in the FaultTo destination service) when a response is received.
soap | context | |
[out] | fault | code |
[out] | info | string pointer related to the fault (or NULL) |
int soap_wsrm_check_retry | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq | ||
) |
Client-side check to verify if the remote call can be retried when a failure occured. Increases the robustness of messages sends, by ensuring that the message was at least transmitted (but not necessarily received). Also implements HTTP 307 Temporary Redirect. Retries are limited to SOAP_WSRM_MAX_RETRIES iterations.
soap | context |
seq | sequence handle set by soap_wsrm_create or soap_wsrm_create_offer |
static int soap_wsrm_chk_acks | ( | struct soap * | soap | ) | [static] |
Internal function to check for AckRequested headers to update state.
soap | context |
void soap_wsrm_cleanup | ( | struct soap * | soap | ) |
Cleans up all expired sequences and releases resources. To be used at the server side to periodically clean up WS-RM sequences. Server-side cleanup is automatic, as long as WS-RM is in use. Does not release client-side sequences allocated by soap_wsrm_create() or soap_wsrm_create_offer().
soap | context |
int soap_wsrm_close | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
const char * | wsa_id | ||
) |
Closes the sequence, but does not yet terminate it. No new messages should be send, but messages can be resend with soap_wsrm_resend() if desired.
soap | context | |
seq | sequence handle set by soap_wsrm_create or soap_wsrm_create_offer | |
[in] | wsa_id | WS-Addressing message ID (optional) |
static int soap_wsrm_copy | ( | struct soap * | soap, |
struct soap_plugin * | p, | ||
struct soap_plugin * | q | ||
) | [static] |
Copy plugin data.
soap | context | |
[out] | p | plugin |
[in] | q | plugin |
int soap_wsrm_create | ( | struct soap * | soap, |
const char * | to, | ||
const char * | acksto, | ||
LONG64 | expires, | ||
const char * | wsa_id, | ||
soap_wsrm_sequence_handle * | seq | ||
) |
Creates a new sequence. Sequences are usually created by the sender (client) and confirmed by the receiver (server). The 'to' server address must be used for all messages of the sequence to be sent to the server. Optionally the 'acksto' address can be given for acknowledgement messages to be sent to. A sequence ID is generated by the server upon success.
soap | context | |
[in] | to | endpoint address of the WS-RM destination server (required) |
[in] | acksto | endpoint address of the WS-RM acknowledgement server (optional, use NULL when acks are piggy-backed on response messages to the source) |
[in] | expires | max sequence duration (its lifetime) in ms (use 0 for inifinite) |
[in] | wsa_id | WS-Addressing message ID (optional, use NULL when omitted) |
[out] | seq | sequence handle is set |
int soap_wsrm_create_offer | ( | struct soap * | soap, |
const char * | to, | ||
const char * | acksto, | ||
const char * | id, | ||
LONG64 | expires, | ||
enum wsrm__IncompleteSequenceBehaviorType | behavior, | ||
const char * | wsa_id, | ||
soap_wsrm_sequence_handle * | seq | ||
) |
Creates a new sequence by offering suggested WS-RM parameters to the destination. Sequences are usually created by the sender (client) and confirmed by the receiver (server). The 'to' server address must be used for all messages of the sequence to be sent to the server. Optionally the 'acksto' address can be given for acknowledgement messages to be sent to. server upon success.
soap | context | |
[in] | to | endpoint address of the WS-RM destination server (required) |
[in] | acksto | endpoint address of the WS-RM acknowledgement server (optional, use NULL when acks are piggy-backed on response messages to the source) |
[in] | id | offered WS-RM sequence identifier (optional, generate when NULL) |
[in] | expires | max sequence duration (its lifetime) in ms (use 0 for inifinite) |
[in] | behavior | offered DiscardEntireSequence, DiscardFollowingFirstGap, or NoDiscard, which specifies the WS-RM destination's action when a sequence is closed/terminated when it is incomplete, and notifies the source when failed. |
[in] | wsa_id | WS-Addressing message ID (optional, use NULL when omitted) |
[out] | seq | sequence handle is set or NULL when response is asynchronously send and the sequence is initialized upon receipt of the create response. |
static void soap_wsrm_delete | ( | struct soap * | soap, |
struct soap_plugin * | p | ||
) | [static] |
Deletes plugin data.
soap | context | |
[in,out] | p | plugin |
static int soap_wsrm_disconnect | ( | struct soap * | soap | ) | [static] |
Internal callback function to override fdisconnect(). Turns caching off, sets the cached message to NACK, and resets the server-side handle, so sequence can be deallocated later.
soap | context |
void soap_wsrm_dump | ( | struct soap * | soap, |
FILE * | fd | ||
) |
Dumps the current sequences and details of the wsrm plugin for diagnotics purposes.
soap | context | |
[in] | fd | file descriptor to send text to |
int soap_wsrm_error | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq, | ||
enum wsrm__FaultCodes | fault | ||
) |
Sets SOAP Fault (sub)code for server WS-RM fault response. Terminates the sequence.
soap | context | |
[in] | seq | pointer to sequence to terminate or NULL |
[in] | fault | is one of enum wsrm__FaultCodes enumeration values |
int soap_wsrm_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 faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender.
soap | context | |
[in] | flag | 0=receiver, 1=sender |
[in] | faultsubcode | sub code string |
[in] | faultstring | fault string |
[in] | faultdetail | detail string |
static int soap_wsrm_init | ( | struct soap * | soap, |
struct soap_wsrm_data * | data, | ||
void * | arg | ||
) | [static] |
Initializes plugin data.
soap | context | |
[in,out] | data | plugin data |
[in] | arg | optional argument passed from soap_register_plugin_arg |
static int soap_wsrm_msg_append | ( | struct soap * | soap, |
struct soap_wsrm_data * | data, | ||
const char * | buf, | ||
size_t | len | ||
) | [static] |
Internal function used by soap_wsrm_send() to append message data to the current message being transmitted for the current sequence.
soap | context | |
data | plugin | |
[in] | buf | message data |
[in] | len | message data length |
static void soap_wsrm_msg_free | ( | struct soap * | soap, |
struct soap_wsrm_message * | p | ||
) | [static] |
Internal function to deallocate all cached message content from a sequence state.
soap | context |
p | pointer to message (in a sequence state) |
static struct soap_wsrm_message * soap_wsrm_msg_new | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq, | ||
ULONG64 | num | ||
) | [static, read] |
Internal function to allocate a new message for a sequence sequence state.
soap | context |
seq | sequence pointer |
num | message num |
ULONG64 soap_wsrm_msgs | ( | struct soap * | soap, |
const struct soap_wsrm_sequence * | seq | ||
) |
Returns the number of complete messages received, or 0 when there is a gap.
soap | context | |
[in] | seq | pointer to sequence |
ULONG64 soap_wsrm_nack | ( | soap_wsrm_sequence_handle | seq | ) |
Returns the number of non-acknowledged messages sent.
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() |
ULONG64 soap_wsrm_num | ( | soap_wsrm_sequence_handle | seq | ) |
Returns the current message number of the sequence.
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() |
static void soap_wsrm_num_free | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq | ||
) | [static] |
Internal function to deallocate all message number ranges from a sequence state.
soap | context |
seq | pointer to sequence |
static int soap_wsrm_num_insert | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq, | ||
ULONG64 | num | ||
) | [static] |
Internal function to insert a message number in the sequence state. Updates the sequence ranges.
soap | context | |
seq | pointer to sequence | |
[in] | num |
static int soap_wsrm_num_lookup | ( | struct soap * | soap, |
const struct soap_wsrm_sequence * | seq, | ||
ULONG64 | num | ||
) | [static] |
Internal function to look up a message number in the sequence state.
soap | context | |
[in] | seq | pointer to sequence |
[in] | num | message num to search |
static int soap_wsrm_num_size | ( | const struct soap_wsrm_sequence * | seq | ) | [static] |
Internal function returns the number of message ranges in a sequence state.
seq | pointer to sequence |
static int soap_wsrm_preparefinalrecv | ( | struct soap * | soap | ) | [static] |
Internal callback function to override fpreparefinalrecv(). Takes acks returned by response to update the states of the sequences with acknowledgements. Acknowledged messages do not have to be resend and are purged from the sequence states. Also checks if at client-side response message was already received and otherwise records it in the state.
soap | context |
static int soap_wsrm_process_ack | ( | struct soap * | soap, |
struct _wsrm__SequenceAcknowledgement * | ack | ||
) | [static] |
Internal function to purge acknowledged messages as given by wsrm:SequenceAcknowledgement header.
soap | context | |
[in] | ack | from the WS-RM SequenceAcknowledgement header. |
int soap_wsrm_receiver_fault | ( | struct soap * | soap, |
const char * | faultstring, | ||
const char * | faultdetail | ||
) |
Sets receiver SOAP Fault for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender.
soap | context | |
[in] | faultstring | fault string |
[in] | faultdetail | detail string |
int soap_wsrm_receiver_fault_subcode | ( | struct soap * | soap, |
const char * | faultsubcode, | ||
const char * | faultstring, | ||
const char * | faultdetail | ||
) |
Sets receiver SOAP Fault (sub)code for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender.
soap | context | |
[in] | faultsubcode | sub code string |
[in] | faultstring | fault string |
[in] | faultdetail | detail string |
int soap_wsrm_reply | ( | struct soap * | soap, |
const char * | wsa_id, | ||
const char * | wsa_action | ||
) |
Server-side server operation reply to be performed when the service operation returns. Server operations that support WS-Addressing and WS-RM must call this function to return normally (and allow the response to be relayed).
soap | context | |
[in] | wsa_id | WS-Addressing message ID (optional) |
[in] | wsa_action | mandatory WS-Addressing action of the response |
int soap_wsrm_reply_num | ( | struct soap * | soap | ) |
Adds a WS-RM sequence message number to the next message transmitted. No acks are requested. No WS-Addressing relay.
soap | context |
int soap_wsrm_reply_request_acks | ( | struct soap * | soap, |
const char * | wsa_id, | ||
const char * | wsa_action | ||
) |
Server-side server operation reply to be performed when the service operation returns. Message acks for the current sequence are requested, but only when client made a create sequence offer. Server operations that support WS-Addressing and WS-RM must call this function or soap_wsrm_reply() to return normally (and allow the response to be relayed).
soap | context | |
[in] | wsa_id | WS-Addressing message ID (optional) |
[in] | wsa_action | mandatory WS-Addressing action of the response |
int soap_wsrm_request | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
const char * | wsa_id, | ||
const char * | wsa_action | ||
) |
Adds a WS-RM sequence message number to the next message transmitted to the WS-RM destination and increments the message counter by one. No acks are requested.
soap | context | |
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() | |
[in] | wsa_id | WS-Addressing message ID (optional, use NULL when omitted) |
[in] | wsa_action | mandatory WS-Addressing action of the next message sent |
int soap_wsrm_request_acks | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
const char * | wsa_id, | ||
const char * | wsa_action | ||
) |
Adds a WS-RM sequence message number to the next message transmitted to the WS-RM destination and increments the message counter by one. Message acks for the current sequence are requested.
soap | context | |
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() | |
[in] | wsa_id | WS-Addressing message ID (optional, use NULL when omitted) |
[in] | wsa_action | mandatory WS-Addressing action of the next message sent |
int soap_wsrm_request_num | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
const char * | wsa_id, | ||
const char * | wsa_action, | ||
ULONG64 | num | ||
) |
Adds a WS-RM sequence message number to the next message transmitted. No acks are requested.
soap | context | |
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() | |
[in] | wsa_id | WS-Addressing message ID (optional, use NULL when omitted) |
[in] | wsa_action | mandatory WS-Addressing action of the next message sent |
[in] | num | WS-RM sequence message number |
int soap_wsrm_resend | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
ULONG64 | lower, | ||
ULONG64 | upper | ||
) |
Client-side call to resend all non-acknowledged messages that were automatically cached for this sequence. Messages stored in the sequence for retransmission (those that were previously sent but not acknowledged) are resent to the soap_wsrm_to() address, which was set by soap_wsrm_create() or soap_wsrm_create_offer(). It is recommended to resend messages after the last message in the sequence was transmitted before closing the sequence. To reduce unnecessary resend attempts, it is recommended to use soap_wsrm_request_ack() with the last message to request acks for messages already delivered.
soap | context | |
seq | sequence handle set by soap_wsrm_create or soap_wsrm_create_offer | |
[in] | lower | resend message range lower bound (0 for lowest) |
[in] | upper | resend message range upper bound (or 0 for infinite) |
static int soap_wsrm_resend_seq | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq, | ||
ULONG64 | lower, | ||
ULONG64 | upper | ||
) | [static] |
Internal function to resend unacknowledged messages of a sequence given a range of message numbers. Used by soap_wsrm_resend().
soap | context | |
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() | |
[in] | lower | resend message range lower bound (0 for lowest) |
[in] | upper | resend message range upper bound (or 0 for infinite) |
static int soap_wsrm_send | ( | struct soap * | soap, |
const char * | buf, | ||
size_t | len | ||
) | [static] |
Internal callback function to override fsend(). When the wsrm plugin is enabled, saves the message to the current sequence that is created at the client side. Allows unacknowledged messages to be resend with soap_wsrm_resend().
soap | context | |
[in] | buf | message data |
[in] | len | message data length |
int soap_wsrm_sender_fault | ( | struct soap * | soap, |
const char * | faultstring, | ||
const char * | faultdetail | ||
) |
Sets sender SOAP Fault for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender.
soap | context | |
[in] | faultstring | fault string |
[in] | faultdetail | detail string |
int soap_wsrm_sender_fault_subcode | ( | struct soap * | soap, |
const char * | faultsubcode, | ||
const char * | faultstring, | ||
const char * | faultdetail | ||
) |
Sets sender SOAP Fault (sub)code for server faults (can be user defined faults). When called before soap_wsrm_check() in the server operation, terminates the current sequence. Otherwise, the sequence is not terminated. In either case the fault is returned to sender (client) or to the FaultTo server when the WS-Addressing FaultTo header was set by the sender.
soap | context | |
[in] | faultsubcode | sub code string |
[in] | faultstring | fault string |
[in] | faultdetail | detail string |
struct soap_wsrm_sequence* soap_wsrm_seq | ( | struct soap * | soap | ) | [read] |
Assuming a SOAP header is received, gets the sequence associated with the message.
soap | context |
int soap_wsrm_seq_created | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq | ||
) |
Function to check if a sequence is created.
soap | context |
seq | pointer to sequence |
void soap_wsrm_seq_free | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq | ||
) |
Must be called to free the sequence allocated by soap_wsrm_create() or by soap_wsrm_create_offer(). Sequence handles are not automatically reclaimed by the engine.
soap | context |
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() |
static struct soap_wsrm_sequence * soap_wsrm_seq_insert | ( | struct soap * | soap, |
struct soap_wsrm_data * | data | ||
) | [static, read] |
Internal function to create a new local sequence state.
soap | context |
data | plugin |
struct soap_wsrm_sequence* soap_wsrm_seq_lookup | ( | struct soap * | soap, |
const char * | id | ||
) | [read] |
Function to look up sequence given its id.
soap | context | |
[in] | id | identifier string |
static struct soap_wsrm_sequence * soap_wsrm_seq_lookup_ack | ( | const struct soap_wsrm_data * | data, |
const char * | id | ||
) | [static, read] |
Internal function to look up sequence given its acksid.
data | plugin | |
[in] | id | identifier string |
static struct soap_wsrm_sequence * soap_wsrm_seq_lookup_data | ( | const struct soap_wsrm_data * | data, |
const char * | id | ||
) | [static, read] |
Internal function to look up sequence given its id.
data | plugin | |
[in] | id | identifier string |
struct soap_wsrm_sequence* soap_wsrm_seq_lookup_id | ( | struct soap * | soap, |
const char * | id | ||
) | [read] |
Function to look up sequence given its id.
soap | context | |
[in] | id | identifier string |
static const char * soap_wsrm_seq_newid | ( | struct soap * | soap, |
struct soap_wsrm_data * | data | ||
) | [static] |
Internal function to generate a new sequence identifier.
soap | context |
data | plugin |
int soap_wsrm_seq_terminated | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq | ||
) |
Function to check if a sequence is terminated or needs to be terminated when expired.
soap | context |
seq | pointer to sequence |
static int soap_wsrm_set_ack | ( | struct soap * | soap, |
struct soap_wsrm_sequence * | seq, | ||
struct _wsrm__SequenceAcknowledgement * | ack | ||
) | [static] |
Internal function called by soap_wsrm_add_acks() to populate the SequenceAcknowledgement header block.
soap | context | |
[in] | seq | pointer to sequence |
[out] | ack | pointer to SequenceAcknowledgement to populate |
int soap_wsrm_terminate | ( | struct soap * | soap, |
soap_wsrm_sequence_handle | seq, | ||
const char * | wsa_id | ||
) |
Terminates the sequence. No new messages should be send and no resends should be tried. Usually done after soap_wsrm_close() or any time to terminate the sequence prematurely.
soap | context | |
seq | sequence handle set by soap_wsrm_create or soap_wsrm_create_offer | |
[in] | wsa_id | WS-Addressing message ID (optional) |
const char* soap_wsrm_to | ( | soap_wsrm_sequence_handle | seq | ) |
Returns the endpoint address of the destination service that serves the sequence. Initially set with soap_wsrm_create or soap_wsrm_create_offer. HTTP 307 Temporary Redirect can change the endpoint during the lifetime of a message sequence. Thus, this function returns the most recent endpoint binding that can be used to send message to the server endpoint.
seq | sequence handle set by soap_wsrm_create() or soap_wsrm_create_offer() |
const char soap_wsrm_id[] = SOAP_WSRM_ID |
Plugin identification for plugin registry
char soap_wsrm_idname[40] = "" |
int soap_wsrm_idnum = 0 |
struct soap_wsrm_sequence* soap_wsrm_session = NULL [static] |
Sequence session database
MUTEX_TYPE soap_wsrm_session_lock = MUTEX_INITIALIZER [static] |
Sequence session database lock