9c60462bedf18d9572918749f39f7c4d1f2748ac
[yaz-moved-to-github.git] / include / yaz / soap.h
1 /*
2  * Copyright (c) 2002-2003, Index Data.
3  * See the file LICENSE for details.
4  *
5  * $Id: soap.h,v 1.1 2003-02-12 15:06:43 adam Exp $
6  */
7
8 #ifndef YAZ_SOAP_H
9 #define YAZ_SOAP_H
10
11 #include <yaz/odr.h>
12
13 #if HAVE_XSLT
14 #include <libxml/parser.h>
15 #include <libxml/tree.h>
16 #endif
17
18 typedef struct {
19     char *fault_code;
20     char *fault_string;
21     char *details;
22 } Z_SOAP_Fault;
23
24 typedef struct {
25     int no;
26     char *ns;
27     void *p;
28 } Z_SOAP_Generic;
29
30 #define Z_SOAP_fault 1
31 #define Z_SOAP_generic 2
32 #define Z_SOAP_error 3
33 typedef struct {
34     int which;
35     union {
36         Z_SOAP_Fault   *fault;
37         Z_SOAP_Generic *generic;
38         Z_SOAP_Fault   *soap_error;
39     } u;
40     const char *ns;
41 } Z_SOAP;
42
43 typedef struct {
44     char *ns;
45     void *client_data;
46     int (*f)(ODR o, xmlNodePtr ptr, void **handler_data,
47              void *client_data, const char *ns);
48 } Z_SOAP_Handler;
49
50 YAZ_EXPORT int z_soap_codec(ODR o, Z_SOAP **pp, 
51                             char **content_buf, int *content_len,
52                             Z_SOAP_Handler *handlers);
53
54 #endif