annotate GEMBASSY-1.0.3/gsoap/wsdl/service.h @ 0:8300eb051bea draft

Initial upload
author ktnyt
date Fri, 26 Jun 2015 05:19:29 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
1 /*
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
2 service.h
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
3
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
4 Service structures
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
5
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
6 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
7 gSOAP XML Web services tools
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
8 Copyright (C) 2001-2012, Robert van Engelen, Genivia Inc. All Rights Reserved.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
9 This software is released under one of the following licenses:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
10 GPL or Genivia's license for commercial use.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
11 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
12 GPL license.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
13
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
14 This program is free software; you can redistribute it and/or modify it under
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
15 the terms of the GNU General Public License as published by the Free Software
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
16 Foundation; either version 2 of the License, or (at your option) any later
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
17 version.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
18
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
19 This program is distributed in the hope that it will be useful, but WITHOUT ANY
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
21 PARTICULAR PURPOSE. See the GNU General Public License for more details.
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
22
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
23 You should have received a copy of the GNU General Public License along with
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
24 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
25 Place, Suite 330, Boston, MA 02111-1307 USA
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
26
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
27 Author contact information:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
28 engelen@genivia.com / engelen@acm.org
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
29 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
30 A commercial use license is available from Genivia, Inc., contact@genivia.com
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
31 --------------------------------------------------------------------------------
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
32
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
33 */
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
34
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
35 #ifndef SERVICE_H
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
36 #define SERVICE_H
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
37
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
38 #include "includes.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
39 #include "wsdlH.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
40
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
41 class Message
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
42 { public:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
43 const char *name;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
44 const char *URI;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
45 soap__styleChoice style;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
46 soap__useChoice use;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
47 const char *encodingStyle;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
48 const char *action;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
49 wsdl__message *message;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
50 xs__element *element;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
51 const char *body_parts;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
52 wsdl__part *part;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
53 bool mustUnderstand;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
54 vector<soap__header> header;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
55 vector<wsoap__header> wheader;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
56 mime__multipartRelated *multipartRelated; // MIME
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
57 mime__content *content; // REST/MIME
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
58 const char *layout; // DIME
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
59 const char *documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
60 const char *ext_documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
61 vector<const wsp__Policy*> policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
62 void generate(Types&, const char *sep, bool anonymous, bool remark, bool response, bool optional);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
63 };
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
64
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
65 typedef map<const char*, Message*, ltstr> MapOfStringToMessage;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
66
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
67 class Operation
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
68 { public:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
69 const char *prefix;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
70 const char *URI;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
71 const char *name;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
72 const char *mep; // WSDL 2.0
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
73 const char *protocol;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
74 soap__styleChoice style;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
75 const char *parameterOrder;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
76 const char *action;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
77 const char *input_name;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
78 const char *output_name;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
79 Message *input; // name, use, and parts
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
80 Message *output; // name, use, and parts
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
81 vector<Message*> infault;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
82 vector<Message*> outfault;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
83 const char *documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
84 const char *operation_documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
85 vector<const wsp__Policy*> policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
86 void generate(Types&, Service&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
87 };
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
88
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
89 class Service
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
90 { public:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
91 const char *prefix; // a gSOAP service has a unique namespace
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
92 const char *URI;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
93 const char *name; // binding name
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
94 const char *type; // portType
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
95 const char *transport; // binding transport
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
96 SetOfString location; // WSDL may specify multiple locations via <Port> -> <Binding>
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
97 vector<Operation*> operation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
98 MapOfStringToMessage header;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
99 MapOfStringToMessage headerfault;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
100 MapOfStringToMessage fault;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
101 MapOfStringToString service_documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
102 MapOfStringToString port_documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
103 MapOfStringToString binding_documentation;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
104 vector<const wsp__Policy*> policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
105 VectorOfString imports;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
106 Service();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
107 void generate(Types&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
108 void add_import(const char*);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
109 void del_import(const char*);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
110 };
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
111
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
112 typedef map<const char*, Service*, ltstr> MapOfStringToService;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
113
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
114 class Definitions
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
115 { public:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
116 Types types; // to process schema type information
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
117 MapOfStringToService services; // service information gathered
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
118 bool soap12;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
119 Definitions();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
120 void collect(const wsdl__definitions&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
121 void compile(const wsdl__definitions&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
122 private:
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
123 void analyze(const wsdl__definitions&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
124 void analyze_headers(const wsdl__definitions&, Service*, wsdl__ext_ioput*, wsdl__ext_ioput*);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
125 void analyze_faults(const wsdl__definitions&, Service*, Operation*, vector<wsdl__ext_operation>::const_iterator&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
126 Message *analyze_fault(const wsdl__definitions&, Service*, const wsdl__ext_fault&);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
127 void generate();
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
128 };
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
129
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
130 #endif