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