test: Checks for string2isds_credit_event_type() added
[libisds.git] / src / soap.h
blob6fd3754adc5fc5916d0243ae1c39f7312c1f27bb
1 #ifndef __ISDS_SOAP_H__
2 #define __ISDS_SOAP_H__
4 #include "isds.h"
6 /* Close connection to server and destroy CURL handle associated
7 * with @context */
8 isds_error _isds_close_connection(struct isds_ctx *context);
10 /* Do SOAP request.
11 * @context holds the base URL,
12 * @file is a (CGI) file of SOAP URL,
13 * @request is XML node set with SOAP request body.
14 * @file must be NULL, @request should be NULL rather than empty, if they should
15 * not be signaled in the SOAP request.
16 * @reponse is automatically allocated() node set with SOAP response body.
17 * You must xmlFreeNodeList() it. This is literal body, empty (NULL), one node
18 * or more nodes can be returned.
19 * @raw_response is automatically allocated bit stream with response body. Use
20 * NULL if you don't care
21 * @raw_response_length is size of @raw_response in bytes
22 * In case of error the response will be deallocated automatically.
23 * Side effect: message buffer */
24 isds_error _isds_soap(struct isds_ctx *context, const char *file,
25 const xmlNodePtr request, xmlNodePtr *response,
26 void **raw_response, size_t *raw_response_length);
28 /* Build new URL from current @context and template.
29 * @context is context carrying an URL
30 * @template is printf(3) format string. First argument is string of base URL
31 * found in @context, second argument is length of the base URL.
32 * @new_url is newly allocated URL built from @template. Caller must free it.
33 * Return IE_SUCCESS, or corresponding error code and @new_url will not be
34 * allocated.
35 * */
36 isds_error _isds_build_url_from_context(struct isds_ctx *context,
37 const char *template, char **new_url);
39 /* Invalidate session cookie for otp authenticated @context */
40 isds_error _isds_invalidate_otp_cookie(struct isds_ctx *context);
42 #endif