01b7fe9b7a96da9c86551b6b65c128f01cc42634
[shibboleth/cpp-xmltooling.git] / xmltooling / soap / SOAP.h
1 /*
2  *  Copyright 2001-2010 Internet2
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file xmltooling/soap/SOAP.h
19  * 
20  * XMLObjects representing SOAP content
21  */
22
23 #ifndef __xmltooling_soap_h__
24 #define __xmltooling_soap_h__
25
26 #include <xmltooling/ConcreteXMLObjectBuilder.h>
27 #include <xmltooling/ElementProxy.h>
28 #include <xmltooling/util/XMLConstants.h>
29
30 /**
31  * Macro for declaring SOAP builders.
32  * 
33  * @param cname name of class being built
34  */
35 #define DECL_SOAP11OBJECTBUILDER(cname) \
36     DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::SOAP11ENV_NS,xmlconstants::SOAP11ENV_PREFIX)
37
38 /**
39  * @namespace soap11
40  * Namespace for SOAP 1.1 schema objects
41  */
42 namespace soap11 {
43
44     DECL_XMLOBJECT_SIMPLE(XMLTOOL_API,Faultstring,String,SOAP 1.1 faultstring element);
45     DECL_XMLOBJECT_SIMPLE(XMLTOOL_API,Faultactor,Actor,SOAP 1.1 faultactor element);
46
47     BEGIN_XMLOBJECT(XMLTOOL_API,Faultcode,xmltooling::XMLObject,SOAP 1.1 faultcode element);
48         /** Gets the QName content of the element. */
49         virtual const xmltooling::QName* getCode() const=0;
50         /** Sets the QName content of the element. */
51         virtual void setCode(const xmltooling::QName* qname)=0;
52         /** Client Fault code. **/
53         static xmltooling::QName CLIENT;
54         /** Server Fault code. **/
55         static xmltooling::QName SERVER;
56         /** MustUnderstand Fault code. **/
57         static xmltooling::QName MUSTUNDERSTAND;
58         /** Version Mismatch Fault code. **/
59         static xmltooling::QName VERSIONMISMATCH;
60     END_XMLOBJECT;
61
62     BEGIN_XMLOBJECT(XMLTOOL_API,Detail,xmltooling::ElementProxy,SOAP 1.1 detail element);
63         /** detail (type) local name */
64         static const XMLCh TYPE_NAME[];
65     END_XMLOBJECT;
66
67     BEGIN_XMLOBJECT(XMLTOOL_API,Fault,xmltooling::XMLObject,SOAP 1.1 Fault element);
68         DECL_TYPED_CHILD(Faultcode);
69         DECL_TYPED_CHILD(Faultstring);
70         DECL_TYPED_CHILD(Faultactor);
71         DECL_TYPED_CHILD(Detail);
72         /** Fault (type) local name */
73         static const XMLCh TYPE_NAME[];
74     END_XMLOBJECT;
75
76     BEGIN_XMLOBJECT(XMLTOOL_API,Body,xmltooling::ElementProxy,SOAP 1.1 Body element);
77         /** encodingStyle attribute name */
78         static const XMLCh ENCODINGSTYLE_ATTRIB_NAME[];
79         /** Body (type) local name */
80         static const XMLCh TYPE_NAME[];
81     END_XMLOBJECT;
82
83     BEGIN_XMLOBJECT(XMLTOOL_API,Header,xmltooling::ElementProxy,SOAP 1.1 Header element);
84         /** Actor header block attribute name */
85         static const XMLCh ACTOR_ATTRIB_NAME[];
86         /** mustUnderstand header block attribute name */
87         static const XMLCh MUSTUNDERSTAND_ATTRIB_NAME[];
88         /** Header (type) local name */
89         static const XMLCh TYPE_NAME[];
90     END_XMLOBJECT;
91
92     BEGIN_XMLOBJECT(XMLTOOL_API,Envelope,xmltooling::AttributeExtensibleXMLObject,SOAP 1.1 Envelope element);
93         DECL_TYPED_CHILD(Header);
94         DECL_TYPED_CHILD(Body);
95         /** Envelope (type) local name */
96         static const XMLCh TYPE_NAME[];
97     END_XMLOBJECT;
98
99     DECL_SOAP11OBJECTBUILDER(Body);
100     DECL_SOAP11OBJECTBUILDER(Envelope);
101     DECL_SOAP11OBJECTBUILDER(Fault);
102     DECL_SOAP11OBJECTBUILDER(Header);
103     DECL_XMLOBJECTBUILDER(XMLTOOL_API,Detail,nullptr,nullptr);
104     DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultactor,nullptr,nullptr);
105     DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultcode,nullptr,nullptr);
106     DECL_XMLOBJECTBUILDER(XMLTOOL_API,Faultstring,nullptr,nullptr);
107
108     /**
109      * Registers builders and validators for SOAP 1.1 classes into the runtime.
110      */
111     void XMLTOOL_API registerSOAPClasses();
112 };
113
114 #endif /* __xmltooling_soap_h__ */