Bump year
[yaz-moved-to-github.git] / include / yaz / soap.h
1 /*
2  * Copyright (C) 1995-2005, Index Data ApS
3  * See the file LICENSE for details.
4  *
5  * $Id: soap.h,v 1.9 2005-01-15 19:47:10 adam Exp $
6  */
7 /**
8  * \file soap.h
9  * \brief Header for SOAP
10  */
11
12 #ifndef YAZ_SOAP_H
13 #define YAZ_SOAP_H
14
15 #include <yaz/odr.h>
16
17 YAZ_BEGIN_CDECL
18
19 typedef struct {
20     char *fault_code;
21     char *fault_string;
22     char *details;
23 } Z_SOAP_Fault;
24
25 typedef struct {
26     int no;
27     char *ns;
28     void *p;
29 } Z_SOAP_Generic;
30
31 #define Z_SOAP_fault 1
32 #define Z_SOAP_generic 2
33 #define Z_SOAP_error 3
34 typedef struct {
35     int which;
36     union {
37         Z_SOAP_Fault   *fault;
38         Z_SOAP_Generic *generic;
39         Z_SOAP_Fault   *soap_error;
40     } u;
41     const char *ns;
42 } Z_SOAP;
43
44 typedef int (*Z_SOAP_fun)(ODR o, void * ptr, void **handler_data,
45                          void *client_data, const char *ns);
46 typedef struct {
47     char *ns;
48     void *client_data;
49     Z_SOAP_fun f;
50 } Z_SOAP_Handler;
51
52 YAZ_EXPORT int z_soap_codec(ODR o, Z_SOAP **pp, 
53                             char **content_buf, int *content_len,
54                             Z_SOAP_Handler *handlers);
55 YAZ_EXPORT int z_soap_codec_enc(ODR o, Z_SOAP **pp, 
56                                 char **content_buf, int *content_len,
57                                 Z_SOAP_Handler *handlers,
58                                 const char *encoding);
59 YAZ_EXPORT int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, 
60                                     char **content_buf, int *content_len,
61                                     Z_SOAP_Handler *handlers,
62                                     const char *encoding,
63                                     const char *stylesheet);
64
65 YAZ_EXPORT int z_soap_error(ODR o, Z_SOAP *p,
66                             const char *fault_code, const char *fault_string,
67                             const char *details);
68
69 YAZ_END_CDECL
70 #endif