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