test: Fix a typo
[libisds.git] / src / validator.h
blobb22998a5d918c2ea741720e31e503cc732a5d5b6
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 SERVICE_ASWS
14 } isds_service;
16 /* Get ISDS status info from ISDS @response XML document.
17 * Be ware that different request families return differently encoded status
18 * (e.g. dmStatus, dbStatus)
19 * @context is ISDS context
20 * @service is ISDS web service identifier
21 * @response is ISDS response document
22 * @code is automatically allocated status code of the response
23 * @message is automatically allocated status message. Returned NULL means no
24 * message was delivered by server. Use NULL if you don't care.
25 * @refnumber is automatically reallocated request serial number assigned by
26 * ISDS. Returned *NULL means no number was delivered by server.
27 * Use NULL if you don't care. */
28 isds_error isds_response_status(struct isds_ctx *context,
29 const isds_service service, xmlDocPtr response,
30 xmlChar **code, xmlChar **message, xmlChar **refnumber);
32 /* Send @request to ISDS and return ISDS @response as XML document.
33 * Be ware the @response can be invalid (in sense of XML Schema).
34 * (And it is because current ISDS server does not follow its own
35 * specification. Please apology my government, its herd of incompetent
36 * creatures.)
37 * @context is ISDS session context,
38 * @service identifies ISDS web service
39 * @request is tree with ISDS message, can be NULL
40 * @response is automatically allocated response from server as XML Document
41 * @raw_response is automatically allocated bit stream with response body. Use
42 * NULL if you don't care
43 * @raw_response_length is size of @raw_response in bytes
44 * In case of error, @response and @raw_response will be deallocated.
45 * */
46 isds_error isds(struct isds_ctx *context, const isds_service service,
47 const xmlNodePtr request, xmlDocPtr *response,
48 void **raw_response, size_t *raw_response_length);
49 #endif /* HAVE_LIBCURL */
51 /* Walk through list of isds_documents and check for their types and
52 * references.
53 * @context is session context
54 * @documents is list of isds_document to check
55 * @returns IE_SUCCESS if structure is valid, otherwise context' message will
56 * be filled with explanation of found problem. */
57 isds_error _isds_check_documents_hierarchy(struct isds_ctx *context,
58 const struct isds_list *documents);
60 /* Check for message ID length
61 * @context is session context
62 * @message_id checked message ID
63 * @return IE_SUCCESS or appropriate error code and fill context' message */
64 isds_error validate_message_id_length(struct isds_ctx *context,
65 const xmlChar *message_id);
67 #if HAVE_LIBCURL
68 /* Send @request to Czech POINT conversion deposit and return response
69 * as XML document.
70 * @context is Czech POINT session context,
71 * @request is tree with deposit message, can be NULL
72 * @response is automatically allocated response from server as XML Document
73 * In case of error, @response will be deallocated.
74 * */
75 isds_error _czp_czpdeposit(struct isds_ctx *context,
76 const xmlNodePtr request, xmlDocPtr *response);
77 #endif /* HAVE_LIBCURL */
79 #endif