Fix regression when calling build_send_dbid_request_check_response in isds_GetDataBox...
[libisds.git] / src / validator.h
blobec250d354905d6f2020468f7155fae60767669fb
1 #ifndef __ISDS_VALIDATOR_H__
2 #define __ISDS_VALIDATOR_H__
4 #include "isds.h"
6 #if HAVE_LIBCURL
7 typedef enum {
8 SERVICE_DM_OPERATIONS,
9 SERVICE_DM_INFO,
10 SERVICE_DB_SEARCH,
11 SERVICE_DB_ACCESS,
12 SERVICE_DB_MANIPULATION
13 } isds_service;
15 /* Get ISDS status info from ISDS @response XML document.
16 * Be ware that different request families return differently encoded status
17 * (e.g. dmStatus, dbStatus)
18 * @context is ISDS context
19 * @service is ISDS web service identifier
20 * @response is ISDS response document
21 * @code is automatically allocated status code of the response
22 * @message is automatically allocated status message. Returned NULL means no
23 * message was delivered by server. Use NULL if you don't care.
24 * @refnumber is automatically reallocated request serial number assigned by
25 * ISDS. Returned *NULL means no number was delivered by server.
26 * Use NULL if you don't care. */
27 isds_error isds_response_status(struct isds_ctx *context,
28 const isds_service service, xmlDocPtr response,
29 xmlChar **code, xmlChar **message, xmlChar **refnumber);
31 /* Send @request to ISDS and return ISDS @response as XML document.
32 * Be ware the @response can be invalid (in sense of XML Schema).
33 * (And it is because current ISDS server does not follow its own
34 * specification. Please apology my government, its herd of incompetent
35 * creatures.)
36 * @context is ISDS session context,
37 * @service identifies ISDS web service
38 * @request is tree with ISDS message, can be NULL
39 * @response is automatically allocated response from server as XML Document
40 * @raw_response is automatically allocated bit stream with response body. Use
41 * NULL if you don't care
42 * @raw_response_length is size of @raw_response in bytes
43 * In case of error, @response and @raw_response will be deallocated.
44 * */
45 isds_error isds(struct isds_ctx *context, const isds_service service,
46 const xmlNodePtr request, xmlDocPtr *response,
47 void **raw_response, size_t *raw_response_length);
48 #endif /* HAVE_LIBCURL */
50 /* Walk through list of isds_documents and check for their types and
51 * references.
52 * @context is session context
53 * @documents is list of isds_document to check
54 * @returns IE_SUCCESS if structure is valid, otherwise context' message will
55 * be filled with explanation of found problem. */
56 isds_error _isds_check_documents_hierarchy(struct isds_ctx *context,
57 const struct isds_list *documents);
59 /* Check for message ID length
60 * @context is session context
61 * @message_id checked message ID
62 * @return IE_SUCCESS or appropriate error code and fill context' message */
63 isds_error validate_message_id_length(struct isds_ctx *context,
64 const xmlChar *message_id);
66 #if HAVE_LIBCURL
67 /* Send @request to Czech POINT conversion deposit and return response
68 * as XML document.
69 * @context is Czech POINT session context,
70 * @request is tree with deposit message, can be NULL
71 * @response is automatically allocated response from server as XML Document
72 * In case of error, @response will be deallocated.
73 * */
74 isds_error _czp_czpdeposit(struct isds_ctx *context,
75 const xmlNodePtr request, xmlDocPtr *response);
76 #endif /* HAVE_LIBCURL */
78 #endif