sbrcsr  3.2.0
ATOMAS sbrcsr
Request Message

A Request message contains one or more sbr_Sbdm objects, as well as a Response (after a submit). More...

Macros

#define SBR_MTOM_THRESHOLD_DEFAULT   2000
 Default threshold to use for MTOM processing - see sbr_req_mtom_setsize().
 

Typedefs

typedef struct _sbr_Request sbr_Request
 The CSR request object used to submit a business report.
 

Functions

SBR_CSR_EXPORT int sbr_req_create (ato_Ctx *ctx, sbr_Request **request, sbr_Csr *csr)
 Create a CSR request object based on the service type and template information of the CSR object. More...
 
SBR_CSR_EXPORT void sbr_req_free (sbr_Request *request)
 Free the CSR request object if not NULL. More...
 
SBR_CSR_EXPORT int sbr_req_xml (ato_Ctx *ctx, sbr_Request *request, char **buffer)
 This is a convenience method to extract the entire request as an XML string. More...
 
SBR_CSR_EXPORT int sbr_req_submit (ato_Ctx *ctx, sbr_Request *request, sbr_Response **response, ato_String *certificate, ato_String *privatekey, ato_String *prooftoken, ato_String *assertion)
 Use a CSR request object to submit to the CSR service and return a CSR response. More...
 
SBR_CSR_EXPORT void sbr_req_mtom_setsize (sbr_Request *request, size_t threshold)
 Set whether or not to process the request through the MTOM filter. More...
 
SBR_CSR_EXPORT size_t sbr_req_mtom_size (sbr_Request *request)
 Return the current threshold size for processing content through MTOM. More...
 
SBR_CSR_EXPORT void sbr_req_ssid_set (sbr_Request *request, const char *ssid)
 Set the current softwareSubscriptionId value (copy taken), which may be NULL. More...
 
SBR_CSR_EXPORT const char * sbr_req_ssid (sbr_Request *request)
 Return the current softwareSubscriptionId value, which may be NULL. More...
 
SBR_CSR_EXPORT size_t sbr_req_sbdm_count (sbr_Request *request)
 Return the number of sbr_Sbdm objects in the request. More...
 
SBR_CSR_EXPORT void sbr_req_sbdm_iterator (sbr_Request *request, ato_Iterator **iter)
 Create an iterator for the collection of sbdms to use - caller must free. More...
 
SBR_CSR_EXPORT sbr_Sbdmsbr_req_sbdm_firstv (sbr_Request *request)
 Get the first sbdm of the collection. More...
 
SBR_CSR_EXPORT sbr_Sbdmsbr_req_sbdm_nextv (sbr_Request *request)
 Get the next sbdm of the collection. More...
 
SBR_CSR_EXPORT int sbr_req_sbdm_add (ato_Ctx *ctx, sbr_Request *request, sbr_Sbdm **sbdm)
 Create and add a new sbr_Sbdm object - not currently implemented. More...
 
SBR_CSR_EXPORT int sbr_req_sbdm_remove (ato_Ctx *ctx, sbr_Request *request, sbr_Sbdm *sbdm)
 Remove an existing sbr_Sbdm object - not currently implemented. More...
 

Detailed Description

A Request message contains one or more sbr_Sbdm objects, as well as a Response (after a submit).

After sbr_req_submit() is called, assuming no errors, a Response object is created and returned to the caller. The Request object retains a handle to the Response object and will free it when freed itself or when the Request is resubmitted. The caller should never free the Response object. Only the last Response object is retained for each Request object.

Function Documentation

◆ sbr_req_create()

SBR_CSR_EXPORT int sbr_req_create ( ato_Ctx ctx,
sbr_Request **  request,
sbr_Csr csr 
)

Create a CSR request object based on the service type and template information of the CSR object.

Use sbr_req_free() to free.

Parameters
ctxthe current thread local Context.
requestthe CSR request object.
csrthe CSR service object used to construct the request.
Returns
ATO_ERR_OK

◆ sbr_req_free()

SBR_CSR_EXPORT void sbr_req_free ( sbr_Request request)

Free the CSR request object if not NULL.

Parameters
requestthe request object. If NULL do nothing.

◆ sbr_req_xml()

SBR_CSR_EXPORT int sbr_req_xml ( ato_Ctx ctx,
sbr_Request request,
char **  buffer 
)

This is a convenience method to extract the entire request as an XML string.

Parameters
ctxthe current thread local Context.
requestthe request object.
bufferthe address of the buffer to allocate - must be freed by the caller.
Returns
ATO_ERR_OK or an error code.

◆ sbr_req_submit()

SBR_CSR_EXPORT int sbr_req_submit ( ato_Ctx ctx,
sbr_Request request,
sbr_Response **  response,
ato_String certificate,
ato_String privatekey,
ato_String prooftoken,
ato_String assertion 
)

Use a CSR request object to submit to the CSR service and return a CSR response.

The set methods will assert if called AFTER a submit. To change values, create a new request.

Parameters
ctxthe current thread local Context.
requestthe request object.
responsethe response object address (do not free) or NULL if none or an error occurred.
certificateX509 certificate
privatekeyP8 private key
prooftokenprooftoken from an STS response
assertionencrypted assertion from an STS response
Returns
ATO_ERR_OK or an error code.

◆ sbr_req_mtom_setsize()

SBR_CSR_EXPORT void sbr_req_mtom_setsize ( sbr_Request request,
size_t  threshold 
)

Set whether or not to process the request through the MTOM filter.

This will convert all (Base64) element values over the given threshold size to binary before sending to the CSR URL service endpoint. This typically applies to attachments.

Parameters
requestthe request object.
thresholdthe size, in bytes, of the value to apply the MTOM process to. If 0, turn off MTOM processing. For the default use the "#define" SBR_MTOM_THRESHOLD_DEFAULT.

◆ sbr_req_mtom_size()

SBR_CSR_EXPORT size_t sbr_req_mtom_size ( sbr_Request request)

Return the current threshold size for processing content through MTOM.

Parameters
requestthe request object.
Returns
the current MTOM size. If 0 MTOM processing is disabled.

◆ sbr_req_ssid_set()

SBR_CSR_EXPORT void sbr_req_ssid_set ( sbr_Request request,
const char *  ssid 
)

Set the current softwareSubscriptionId value (copy taken), which may be NULL.

Clear existing value if any.

This element will be only included in the request if the value is not NULL.

Parameters
requestthe request object.
ssidsoftwareSubscriptionId value.

◆ sbr_req_ssid()

SBR_CSR_EXPORT const char* sbr_req_ssid ( sbr_Request request)

Return the current softwareSubscriptionId value, which may be NULL.

Parameters
requestthe request object.
Returns
the current softwareSubscriptionId value.

◆ sbr_req_sbdm_count()

SBR_CSR_EXPORT size_t sbr_req_sbdm_count ( sbr_Request request)

Return the number of sbr_Sbdm objects in the request.

Parameters
requestthe request object.
Returns
number of Sbdm objects.

◆ sbr_req_sbdm_iterator()

SBR_CSR_EXPORT void sbr_req_sbdm_iterator ( sbr_Request request,
ato_Iterator **  iter 
)

Create an iterator for the collection of sbdms to use - caller must free.

This is useful if a collection is being shared between threads and each thread has its own iterator.

If this is not the case then the sbr_req_sbdm_firstv() and sbr_req_sbdm_nextv() methods are simpler and this method can be ignored.

Parameters
requestthe request object.
iterthe address of the iterator to create - *iter must be NULL. This will be NULL if there is no collection.

◆ sbr_req_sbdm_firstv()

SBR_CSR_EXPORT sbr_Sbdm* sbr_req_sbdm_firstv ( sbr_Request request)

Get the first sbdm of the collection.

This also initialises the iterator associated with the current sbdms.

Parameters
requestthe request object.
Returns
an sbdm or NULL if none.

◆ sbr_req_sbdm_nextv()

SBR_CSR_EXPORT sbr_Sbdm* sbr_req_sbdm_nextv ( sbr_Request request)

Get the next sbdm of the collection.

Parameters
requestthe request object.
Returns
an sbdm or NULL if none.

◆ sbr_req_sbdm_add()

SBR_CSR_EXPORT int sbr_req_sbdm_add ( ato_Ctx ctx,
sbr_Request request,
sbr_Sbdm **  sbdm 
)

Create and add a new sbr_Sbdm object - not currently implemented.

Parameters
ctxthe current thread local Context.
requestthe request object.
sbdmthe address of the Sbdm object to allocate - DO NOT free. The object will be freed when the request is freed or sbr_req_sbdm_remove() is used.
Returns
ATO_ERR_OK or an error code.

◆ sbr_req_sbdm_remove()

SBR_CSR_EXPORT int sbr_req_sbdm_remove ( ato_Ctx ctx,
sbr_Request request,
sbr_Sbdm sbdm 
)

Remove an existing sbr_Sbdm object - not currently implemented.

Parameters
ctxthe current thread local Context.
requestthe request object.
sbdmthe Sbdm object - DO NOT reference after this call. The object will be freed.
Returns
ATO_ERR_OK or an error code.