Git init
[external/xmlsec1.git] / include / xmlsec / soap.h
1 /** 
2  * XML Security Library (http://www.aleksey.com/xmlsec).
3  *
4  * Simple SOAP messages parsing/creation.
5  *
6  * This is free software; see Copyright file in the source
7  * distribution for preciese wording.
8  * 
9  * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com>
10  */
11 #ifndef __XMLSEC_SOAP_H__
12 #define __XMLSEC_SOAP_H__    
13
14 #ifndef XMLSEC_NO_SOAP
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */ 
19
20 #include <libxml/tree.h>
21 #include <xmlsec/xmlsec.h>
22
23
24 /***********************************************************************
25  *
26  * SOAP 1.1 
27  *
28  **********************************************************************/
29 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11CreateEnvelope      (xmlDocPtr doc);
30 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11EnsureHeader        (xmlNodePtr envNode);
31 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11AddBodyEntry        (xmlNodePtr envNode,
32                                                                  xmlNodePtr entryNode);
33 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11AddFaultEntry       (xmlNodePtr envNode,
34                                                                  const xmlChar* faultCodeHref,
35                                                                  const xmlChar* faultCodeLocalPart,
36                                                                  const xmlChar* faultString,
37                                                                  const xmlChar* faultActor);
38 XMLSEC_EXPORT int               xmlSecSoap11CheckEnvelope       (xmlNodePtr envNode);
39 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11GetHeader           (xmlNodePtr envNode);
40 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11GetBody             (xmlNodePtr envNode);
41 XMLSEC_EXPORT xmlSecSize        xmlSecSoap11GetBodyEntriesNumber(xmlNodePtr envNode);
42 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11GetBodyEntry        (xmlNodePtr envNode,
43                                                                  xmlSecSize pos);
44 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap11GetFaultEntry       (xmlNodePtr envNode);
45
46
47 /***********************************************************************
48  *
49  * SOAP 1.2 
50  *
51  **********************************************************************/
52 /**
53  * xmlSecSoap12FaultCode:
54  * @xmlSecSoap12FaultCodeUnknown:               The fault code is not available.
55  * @xmlSecSoap12FaultCodeVersionMismatch:       The faulting node found an 
56  *                                              invalid element information 
57  *                                              item instead of the expected 
58  *                                              Envelope element information item. 
59  * @xmlSecSoap12FaultCodeMustUnderstand:        An immediate child element 
60  *                                              information item of the SOAP 
61  *                                              Header element information item 
62  *                                              targeted at the faulting node 
63  *                                              that was not understood by the 
64  *                                              faulting node contained a SOAP 
65  *                                              mustUnderstand attribute 
66  *                                              information item with a value of "true"
67  * @xmlSecSoap12FaultCodeDataEncodingUnknown:   A SOAP header block or SOAP 
68  *                                              body child element information 
69  *                                              item targeted at the faulting 
70  *                                              SOAP node is scoped with a data 
71  *                                              encoding that the faulting node 
72  *                                              does not support.
73  * @xmlSecSoap12FaultCodeSender:                The message was incorrectly 
74  *                                              formed or did not contain the 
75  *                                              appropriate information in order 
76  *                                              to succeed. 
77  * @xmlSecSoap12FaultCodeReceiver:              The message could not be processed 
78  *                                              for reasons attributable to the 
79  *                                              processing of the message rather 
80  *                                              than to the contents of the 
81  *                                              message itself. 
82  * 
83  * The values of the <Value> child element information item of the 
84  * <Code> element information item (http://www.w3.org/TR/2003/REC-soap12-part1-20030624/#faultcodes).
85  */
86 typedef enum {
87     xmlSecSoap12FaultCodeUnknown = 0,
88     xmlSecSoap12FaultCodeVersionMismatch,
89     xmlSecSoap12FaultCodeMustUnderstand,
90     xmlSecSoap12FaultCodeDataEncodingUnknown,
91     xmlSecSoap12FaultCodeSender,
92     xmlSecSoap12FaultCodeReceiver
93 } xmlSecSoap12FaultCode; 
94
95 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12CreateEnvelope      (xmlDocPtr doc);
96 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12EnsureHeader        (xmlNodePtr envNode);
97 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12AddBodyEntry        (xmlNodePtr envNode,
98                                                                  xmlNodePtr entryNode);
99 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12AddFaultEntry       (xmlNodePtr envNode,
100                                                                  xmlSecSoap12FaultCode faultCode,
101                                                                  const xmlChar* faultReasonText,
102                                                                  const xmlChar* faultReasonLang,
103                                                                  const xmlChar* faultNodeURI,
104                                                                  const xmlChar* faultRole);
105 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12AddFaultSubcode     (xmlNodePtr faultNode,
106                                                                  const xmlChar* subCodeHref,
107                                                                  const xmlChar* subCodeName);                                                            
108 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12AddFaultReasonText  (xmlNodePtr faultNode,
109                                                                  const xmlChar* faultReasonText,
110                                                                  const xmlChar* faultReasonLang);
111 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12AddFaultDetailEntry (xmlNodePtr faultNode,
112                                                                  xmlNodePtr detailEntryNode);
113 XMLSEC_EXPORT int               xmlSecSoap12CheckEnvelope       (xmlNodePtr envNode);
114 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12GetHeader           (xmlNodePtr envNode);
115 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12GetBody             (xmlNodePtr envNode);
116 XMLSEC_EXPORT xmlSecSize        xmlSecSoap12GetBodyEntriesNumber(xmlNodePtr envNode);
117 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12GetBodyEntry        (xmlNodePtr envNode,
118                                                                  xmlSecSize pos);
119 XMLSEC_EXPORT xmlNodePtr        xmlSecSoap12GetFaultEntry       (xmlNodePtr envNode);
120
121                                                                  
122 #endif /* XMLSEC_NO_SOAP */
123
124
125 #ifdef __cplusplus
126 }
127 #endif /* __cplusplus */
128
129 #endif /* __XMLSEC_SOAP_H__ */
130