Update copyright.
[shibboleth/cpp-xmltooling.git] / xmltooling / soap / SOAP.h
1 /*
2  *  Copyright 2001-2007 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/ElementProxy.h>
27 #include <xmltooling/XMLObjectBuilder.h>
28 #include <xmltooling/util/XMLConstants.h>
29 #include <xercesc/util/XMLUniDefs.hpp>
30
31 /**
32  * Macro for declaring SOAP builders.
33  * 
34  * @param cname name of class being built
35  */
36 #define DECL_SOAP11OBJECTBUILDER(cname) \
37     DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::SOAP11ENV_NS,xmlconstants::SOAP11ENV_PREFIX)
38
39 /**
40  * @namespace soap11
41  * Namespace for SOAP 1.1 schema objects
42  */
43 namespace soap11 {
44
45     DECL_XMLOBJECT_SIMPLE(XMLTOOL_API,Faultstring,String,SOAP 1.1 faultstring element);
46     DECL_XMLOBJECT_SIMPLE(XMLTOOL_API,Faultactor,Actor,SOAP 1.1 faultactor element);
47
48     BEGIN_XMLOBJECT(XMLTOOL_API,Faultcode,xmltooling::XMLObject,SOAP 1.1 faultcode element);
49         /** Gets the QName content of the element. */
50         virtual const xmltooling::QName* getCode() const=0;
51         /** Sets the QName content of the element. */
52         virtual void setCode(const xmltooling::QName* qname)=0;
53     END_XMLOBJECT;
54
55     BEGIN_XMLOBJECT(XMLTOOL_API,Detail,xmltooling::ElementProxy,SOAP 1.1 detail element);
56         /** detail (type) local name */
57         static const XMLCh TYPE_NAME[];
58     END_XMLOBJECT;
59
60     BEGIN_XMLOBJECT(XMLTOOL_API,Fault,xmltooling::XMLObject,SOAP 1.1 Fault element);
61         DECL_TYPED_CHILD(Faultcode);
62         DECL_TYPED_CHILD(Faultstring);
63         DECL_TYPED_CHILD(Faultactor);
64         DECL_TYPED_CHILD(Detail);
65         /** Fault (type) local name */
66         static const XMLCh TYPE_NAME[];
67     END_XMLOBJECT;
68
69     BEGIN_XMLOBJECT(XMLTOOL_API,Body,xmltooling::ElementProxy,SOAP 1.1 Body element);
70         DECL_STRING_ATTRIB(EncodingStyle,ENCODINGSTYLE);
71         /** Body (type) local name */
72         static const XMLCh TYPE_NAME[];
73     END_XMLOBJECT;
74
75     BEGIN_XMLOBJECT(XMLTOOL_API,Header,xmltooling::ElementProxy,SOAP 1.1 Header element);
76         DECL_BOOLEAN_ATTRIB(MustUnderstand,MUSTUNDERSTAND,false);
77         DECL_STRING_ATTRIB(Actor,ACTOR);
78         /** Header (type) local name */
79         static const XMLCh TYPE_NAME[];
80     END_XMLOBJECT;
81
82     BEGIN_XMLOBJECT(XMLTOOL_API,Envelope,xmltooling::AttributeExtensibleXMLObject,SOAP 1.1 Envelope element);
83         DECL_TYPED_CHILD(Header);
84         DECL_TYPED_CHILD(Body);
85         /** Envelope (type) local name */
86         static const XMLCh TYPE_NAME[];
87     END_XMLOBJECT;
88
89     DECL_SOAP11OBJECTBUILDER(Body);
90     DECL_SOAP11OBJECTBUILDER(Detail);
91     DECL_SOAP11OBJECTBUILDER(Envelope);
92     DECL_SOAP11OBJECTBUILDER(Fault);
93     DECL_SOAP11OBJECTBUILDER(Faultactor);
94     DECL_SOAP11OBJECTBUILDER(Faultcode);
95     DECL_SOAP11OBJECTBUILDER(Faultstring);
96     DECL_SOAP11OBJECTBUILDER(Header);
97
98     /**
99      * Registers builders and validators for SOAP 1.1 classes into the runtime.
100      */
101     void XMLTOOL_API registerSOAPClasses();
102 };
103
104 #endif /* __xmltooling_soap_h__ */