annotate GEMBASSY-1.0.3/gsoap/wsdl/wsp.cpp @ 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 wsp.cpp
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
3
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
4 WS-Policy 1.2 and 1.5 binding schema
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-2010, 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 #include "wsdlH.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
35 #include "includes.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
36 #include "types.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
37 #include "service.h"
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
38
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
39 static wsp__Policy *search(const char *URI, wsdl__definitions& definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
40 static wsp__Policy *search(const char *URI, wsp__Policy *policy);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
41 static wsp__Policy *search(const char *URI, wsp__Content *content);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
42 static void gen_parts(const sp__Parts& parts, Types& types, const char *what, const char *name, int indent);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
43
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
44 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
45 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
46 // wsp:OperatorContentType
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
47 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
48 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
49
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
50 int wsp__Content::traverse(wsdl__definitions& definitions)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
51 { if (vflag)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
52 cerr << " Analyzing wsp Policy" << endl;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
53 if (Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
54 Policy->traverse(definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
55 if (PolicyReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
56 PolicyReference->traverse(definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
57 for (vector<wsp__Content*>::iterator i = All.begin(); i != All.end(); ++i)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
58 { if (*i)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
59 (*i)->traverse(definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
60 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
61 for (vector<wsp__Content*>::iterator j = ExactlyOne.begin(); j != ExactlyOne.end(); ++j)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
62 { if (*j)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
63 (*j)->traverse(definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
64 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
65 return SOAP_OK;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
66 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
67
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
68 void wsp__Content::generate(Service& service, Types& types, int indent) const
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
69 { static const char stabs[] = "\t\t\t\t\t\t\t\t\t\t";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
70 const char *tabs;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
71 if (indent > 8)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
72 indent = 8;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
73 tabs = stabs + 9 - indent;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
74 // Recursive policies and references
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
75 if (Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
76 Policy->generate(service, types, indent);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
77 if (PolicyReference && PolicyReference->policyPtr())
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
78 PolicyReference->policyPtr()->generate(service, types, indent);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
79 // WS-Policy All
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
80 if (!All.empty())
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
81 { fprintf(stream, "%s- All of the following:\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
82 for (vector<wsp__Content*>::const_iterator p = All.begin(); p != All.end(); ++p)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
83 if (*p)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
84 (*p)->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
85 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
86 // WS-Policy ExactlyOne
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
87 if (!ExactlyOne.empty())
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
88 { fprintf(stream, "%s- Exactly one of the following:\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
89 for (vector<wsp__Content*>::const_iterator p = ExactlyOne.begin(); p != ExactlyOne.end(); ++p)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
90 if (*p)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
91 (*p)->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
92 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
93 // WS-SecurityPolicy Parts (TODO: do we need vectors of these?)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
94 for (vector<sp__Parts>::const_iterator sp = sp__SignedParts.begin(); sp != sp__SignedParts.end(); ++sp)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
95 gen_parts(*sp, types, "sign", "[4.1.1] WS-Security Signed Parts", indent);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
96 for (vector<sp__Parts>::const_iterator ep = sp__EncryptedParts.begin(); ep != sp__EncryptedParts.end(); ++ep)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
97 gen_parts(*ep, types, "encrypt", "[4.2.1] Security Encrypted Parts", indent);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
98 for (vector<sp__Parts>::const_iterator rp = sp__RequiredParts.begin(); rp != sp__RequiredParts.end(); ++rp)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
99 { fprintf(stream, "%s- Required Header elements:", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
100 for (vector<sp__Header>::const_iterator h = (*rp).Header.begin(); h != (*rp).Header.end(); ++h)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
101 if ((*h).Name)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
102 fprintf(stream, " %s", types.aname(NULL, (*h).Namespace, (*h).Name));
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
103 else if ((*h).Namespace)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
104 fprintf(stream, " %s", (*h).Namespace);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
105 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
106 // WS-SecurityPolicy Elements
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
107 sp__Elements *elts = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
108 const char *elts_name = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
109 if (sp__SignedElements)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
110 { elts = sp__SignedElements;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
111 elts_name = "[4.1.2] Signed";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
112 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
113 if (sp__EncryptedElements)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
114 { elts = sp__EncryptedElements;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
115 elts_name = "[4.2.2] Encrypted";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
116 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
117 if (sp__ContentEncryptedElements)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
118 { elts = sp__ContentEncryptedElements;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
119 elts_name = "[4.2.3] Content Encrypted";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
120 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
121 if (sp__RequiredElements)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
122 { elts = sp__RequiredElements;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
123 elts_name = "[4.3.1] Required";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
124 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
125 if (elts)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
126 { fprintf(stream, "%s- %s Elements requirements (XPath%s):\n%s @verbatim\n", tabs, elts_name, elts->XPathVersion?elts->XPathVersion:"", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
127 for (vector<xsd__string>::const_iterator s = elts->XPath.begin(); s != elts->XPath.end(); ++s)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
128 { fprintf(stream, "%s ", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
129 text(*s);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
130 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
131 fprintf(stream, "%s @endverbatim\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
132 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
133 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
134 // WS-SecurityPolicy Tokens
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
135 sp__Token *token = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
136 const char *token_name = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
137 if (sp__UsernameToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
138 { token = sp__UsernameToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
139 token_name = "[5.4.1] WS-Security Username";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
140 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
141 else if (sp__IssuedToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
142 { token = sp__IssuedToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
143 token_name = "[5.4.2] WS-Trust Issued";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
144 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
145 else if (sp__X509Token)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
146 { token = sp__X509Token;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
147 token_name = "[5.4.3] WS-Security X509";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
148 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
149 else if (sp__KerberosToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
150 { token = sp__KerberosToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
151 token_name = "[5.4.4] WS-Security Kerberos";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
152 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
153 else if (sp__SpnegoContextToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
154 { token = sp__SpnegoContextToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
155 token_name = "[5.4.5] WS-Trust n-leg RST/RSTR SPNEGO binary negotiation protocol (SpnegoContext)";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
156 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
157 else if (sp__SecurityContextToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
158 { token = sp__SecurityContextToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
159 token_name = "[5.4.6] WS-SecureConversation SecurityContext";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
160 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
161 else if (sp__SecureConversationToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
162 { token = sp__SecureConversationToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
163 token_name = "[5.4.7] WS-SecureConversation";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
164 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
165 else if (sp__SamlToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
166 { token = sp__SamlToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
167 token_name = "[5.4.8] SAML";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
168 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
169 else if (sp__RelToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
170 { token = sp__RelToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
171 token_name = "[5.4.9] WSS-REL";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
172 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
173 else if (sp__HttpsToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
174 { token = sp__HttpsToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
175 token_name = "[5.4.10] HTTPS";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
176 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
177 else if (sp__KeyValueToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
178 { token = sp__KeyValueToken;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
179 token_name = "[5.4.11] XML Signature";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
180 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
181 if (token)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
182 { fprintf(stream, "%s- %s required:\n", tabs, token_name);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
183 if (token->IncludeToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
184 fprintf(stream, "%s -# IncludeToken = %s\n", tabs, token->IncludeToken);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
185 if (token->Issuer && token->Issuer->Address)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
186 fprintf(stream, "%s -# Issuer = %s\n", tabs, token->Issuer->Address);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
187 if (token->IssuerName)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
188 fprintf(stream, "%s -# Issuer Name = %s\n", tabs, token->IssuerName);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
189 if (token->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
190 token->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
191 // TODO: add wst:Claims?
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
192 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
193 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
194 // WS-SecurityPolicy
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
195 if (sp__AlgorithmSuite)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
196 { fprintf(stream, "%s- [7.1] Security Binding Algorithm Suite requirements:\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
197 if (sp__AlgorithmSuite->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
198 sp__AlgorithmSuite->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
199 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
200 if (sp__Layout)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
201 { fprintf(stream, "%s- [7.2] WS-Security Header Layout requirements:\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
202 if (sp__Layout->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
203 sp__Layout->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
204 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
205 if (sp__TransportBinding)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
206 { fprintf(stream, "%s- [7.3] Transport Binding%s requirements:\n", tabs, sp__TransportBinding->Optional ? " (optional)" : sp__TransportBinding->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
207 if (sp__TransportBinding->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
208 sp__TransportBinding->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
209 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
210 if (sp__TransportToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
211 { fprintf(stream, "%s- Transport%s requirements:\n", tabs, sp__TransportToken->Optional ? " (optional)" : sp__TransportToken->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
212 if (sp__TransportToken->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
213 sp__TransportToken->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
214 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
215 if (sp__SymmetricBinding)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
216 { fprintf(stream, "%s- [7.4] WS-Security Symmetric Binding%s requirements:\n", tabs, sp__SymmetricBinding->Optional ? " (optional)" : sp__SymmetricBinding->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
217 if (sp__SymmetricBinding->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
218 sp__SymmetricBinding->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
219 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
220 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
221 if (sp__ProtectionToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
222 { fprintf(stream, "%s- Symmetric Protection%s requirements:\n", tabs, sp__ProtectionToken->Optional ? " (optional)" : sp__ProtectionToken->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
223 if (sp__ProtectionToken->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
224 sp__ProtectionToken->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
225 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
226 if (sp__AsymmetricBinding)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
227 { fprintf(stream, "%s- [7.5] WS-Security Asymmetric Binding%s (public key) requirements:\n", tabs, sp__AsymmetricBinding->Optional ? " (optional)" : sp__AsymmetricBinding->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
228 if (sp__AsymmetricBinding->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
229 sp__AsymmetricBinding->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
230 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
231 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
232 if (sp__InitiatorToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
233 { fprintf(stream, "%s- Initiator%s requirements:\n", tabs, sp__InitiatorToken->Optional ? " (optional)" : sp__InitiatorToken->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
234 if (sp__InitiatorToken->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
235 sp__InitiatorToken->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
236 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
237 if (sp__InitiatorSignatureToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
238 { fprintf(stream, "%s- Initiator Signature%s requirements:\n", tabs, sp__InitiatorSignatureToken->Optional ? " (optional)" : sp__InitiatorSignatureToken->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
239 if (sp__InitiatorSignatureToken->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
240 sp__InitiatorSignatureToken->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
241 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
242 if (sp__InitiatorEncryptionToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
243 { fprintf(stream, "%s- Initiator Encryption%s requirements:\n", tabs, sp__InitiatorEncryptionToken->Optional ? " (optional)" : sp__InitiatorEncryptionToken->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
244 if (sp__InitiatorEncryptionToken->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
245 sp__InitiatorEncryptionToken->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
246 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
247 if (sp__RecipientToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
248 { fprintf(stream, "%s- Recipient%s requirements:\n", tabs, sp__RecipientToken->Optional ? " (optional)" : sp__RecipientToken->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
249 if (sp__RecipientToken->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
250 sp__RecipientToken->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
251 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
252 if (sp__SupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
253 { fprintf(stream, "%s- [8.1] Supporting Tokens%s requirements:\n", tabs, sp__SupportingTokens->Optional ? " (optional)" : sp__SupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
254 if (sp__SupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
255 sp__SupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
256 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
257 if (sp__SignedSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
258 { fprintf(stream, "%s- [8.2] Signed Supporting Tokens%s requirements:\n", tabs, sp__SignedSupportingTokens->Optional ? " (optional)" : sp__SignedSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
259 if (sp__SignedSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
260 sp__SignedSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
261 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
262 if (sp__EndorsingSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
263 { fprintf(stream, "%s- [8.3] Endorsing Supporting Tokens%s requirements:\n", tabs, sp__EndorsingSupportingTokens->Optional ? " (optional)" : sp__EndorsingSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
264 if (sp__EndorsingSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
265 sp__EndorsingSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
266 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
267 if (sp__SignedEndorsingSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
268 { fprintf(stream, "%s- [8.4] Signed Endorsing Supporting Tokens%s requirements:\n", tabs, sp__SignedEndorsingSupportingTokens->Optional ? " (optional)" : sp__SignedEndorsingSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
269 if (sp__SignedEndorsingSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
270 sp__SignedEndorsingSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
271 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
272 if (sp__SignedEncryptedSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
273 { fprintf(stream, "%s- [8.5] Signed Encrypted Supporting Tokens%s requirements:\n", tabs, sp__SignedEncryptedSupportingTokens->Optional ? " (optional)" : sp__SignedEncryptedSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
274 if (sp__SignedEncryptedSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
275 sp__SignedEncryptedSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
276 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
277 if (sp__EncryptedSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
278 { fprintf(stream, "%s- [8.6] Encrypted Supporting Tokens%s requirements:\n", tabs, sp__EncryptedSupportingTokens->Optional ? " (optional)" : sp__EncryptedSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
279 if (sp__EncryptedSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
280 sp__EncryptedSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
281 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
282 if (sp__EndorsingEncryptedSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
283 { fprintf(stream, "%s- [8.7] Endorsing Encrypted Supporting Tokens%s requirements:\n", tabs, sp__EndorsingEncryptedSupportingTokens->Optional ? " (optional)" : sp__EndorsingEncryptedSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
284 if (sp__EndorsingEncryptedSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
285 sp__EndorsingEncryptedSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
286 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
287 if (sp__SignedEndorsingEncryptedSupportingTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
288 { fprintf(stream, "%s- [8.8] Signed Endorsing Encrypted Supporting Tokens%s requirements:\n", tabs, sp__SignedEndorsingEncryptedSupportingTokens->Optional ? " (optional)" : sp__SignedEndorsingEncryptedSupportingTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
289 if (sp__SignedEndorsingEncryptedSupportingTokens->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
290 sp__SignedEndorsingEncryptedSupportingTokens->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
291 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
292 // Wss10 or Wss11
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
293 if (sp__Wss10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
294 { fprintf(stream, "%s- [9.1] WSS: SOAP Message Security 1.0%s options:\n", tabs, sp__Wss10->Optional ? " (optional)" : sp__Wss10->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
295 if (sp__Wss10->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
296 sp__Wss10->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
297 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
298 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
299 else if (sp__Wss11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
300 { fprintf(stream, "%s- [9.2] WSS: SOAP Message Security 1.1%s options:\n", tabs, sp__Wss11->Optional ? " (optional)" : sp__Wss11->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
301 if (sp__Wss11->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
302 sp__Wss11->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
303 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
304 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
305 if (sp__MustSupportRefKeyIdentifier)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
306 fprintf(stream, "%s- Key Identifier References\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
307 if (sp__MustSupportRefIssuerSerial)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
308 fprintf(stream, "%s- Issuer Serial References\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
309 if (sp__MustSupportRefExternalURI)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
310 fprintf(stream, "%s- External URI References\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
311 if (sp__MustSupportRefEmbeddedToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
312 fprintf(stream, "%s- Embedded Token References\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
313 if (sp__MustSupportRefThumbprint)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
314 fprintf(stream, "%s- Thumbprint References\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
315 if (sp__MustSupportRefEncryptedKey)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
316 fprintf(stream, "%s- EncryptedKey References\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
317 if (sp__RequireSignatureConfirmation)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
318 fprintf(stream, "%s- Signature Confirmation\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
319 // WS-SecureConversation
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
320 if (sp__RequireDerivedKeys)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
321 fprintf(stream, "%s- Properties = WS-SecureConversation RequireDerivedKeys\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
322 else if (sp__RequireImpliedDerivedKeys)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
323 fprintf(stream, "%s- Properties = WS-SecureConversation RequireImpliedDerivedKeys\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
324 else if (sp__RequireExplicitDerivedKeys)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
325 fprintf(stream, "%s- Properties = WS-SecureConversation RequireExplicitDerivedKeys\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
326 if (sp__MustNotSendCancel)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
327 fprintf(stream, "%s- WS-SecureConversation STS issuing the secure conversation token does not support SCT/Cancel RST messages", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
328 else if (sp__MustNotSendAmend)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
329 fprintf(stream, "%s- WS-SecureConversation STS issuing the secure conversation token does not support SCT/Amend RST messages", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
330 else if (sp__MustNotSendRenew)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
331 fprintf(stream, "%s- WS-SecureConversation STS issuing the secure conversation token does not support SCT/Renew RST messages", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
332 if (sp__RequireExternalUriReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
333 fprintf(stream, "%s- WS-SecureConversation external URI reference is required", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
334 if (sp__SC13SecurityContextToken)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
335 fprintf(stream, "%s- WS-SecureConversation Security Context Token should be used", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
336 // WS-Security passwords
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
337 if (sp__NoPassword)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
338 fprintf(stream, "%s- No WS-Security password%s required\n", tabs, sp__NoPassword->Optional ? " (optional)" : sp__NoPassword->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
339 else if (sp__HashPassword)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
340 { fprintf(stream, "%s- Client-side WS-Security password%s should be set:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_add_UsernameTokenDigest(soap, \"User\", \"<username>\", \"<password>\");\n\t@endcode\n", tabs, sp__HashPassword->Optional ? " (optional)" : sp__HashPassword->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
341 fprintf(stream, "%s- Server-side WS-Security password%s verified with:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tconst char *username = soap_wsse_get_Username(soap);\n\t...\n\tif (soap_wsse_verify_Password(soap, \"<password>\")) ...<error>...\n\t@endcode\n", tabs, sp__HashPassword->Optional ? " (optional)" : sp__HashPassword->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
342 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
343 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
344 if (sp__WssUsernameToken10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
345 { fprintf(stream, "%s- Username token should be used as defined in UsernameTokenProfile1.0:\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
346 fprintf(stream, "%s - Client-side WS-Security password should be set:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_add_UsernameTokenDigest(soap, \"User\", \"<username>\", \"<password>\");\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
347 fprintf(stream, "%s - Server-side WS-Security password verified with:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tconst char *username = soap_wsse_get_Username(soap);\n\t...\n\tif (soap_wsse_verify_Password(soap, \"<password>\")) <error>\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
348 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
349 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
350 else if (sp__WssUsernameToken11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
351 { fprintf(stream, "%s- Username token should be used as defined in UsernameTokenProfile1.1:\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
352 fprintf(stream, "%s - Client-side WS-Security plain-text password should be set:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_add_UsernameToken(soap, \"User\", \"<username>\", \"<password>\");\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
353 fprintf(stream, "%s - Client-side WS-Security digest password should be set:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_add_UsernameTokenDigest(soap, \"User\", \"<username>\", \"<password>\");\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
354 fprintf(stream, "%s - Server-side WS-Security password verified with:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tconst char *username = soap_wsse_get_Username(soap);\n\t...\n\tif (soap_wsse_verify_Password(soap, \"<password>\")) ...\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
355 service.add_import("wsse.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
356 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
357 // WS-Trust
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
358 if (sp__RequireExternalReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
359 fprintf(stream, "%s- WS-Trust external reference is required when referencing this token\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
360 else if (sp__RequireInternalReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
361 fprintf(stream, "%s- WS-Trust internal reference is required when referencing this token\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
362 // WS-Trust 1.0 and 1.3
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
363 if (sp__Trust10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
364 { fprintf(stream, "%s- [10.1] WS-Trust 1.0%s options:\n", tabs, sp__Trust10->Optional ? " (optional)" : sp__Trust10->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
365 if (sp__Trust10->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
366 sp__Trust10->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
367 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
368 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
369 else if (sp__Trust13)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
370 { fprintf(stream, "%s- [10.1] WS-Trust 1.3%s options:\n", tabs, sp__Trust13->Optional ? " (optional)" : sp__Trust13->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
371 if (sp__Trust13->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
372 sp__Trust13->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
373 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
374 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
375 if (sp__MustSupportClientChallenge)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
376 { fprintf(stream, "%s- Client Challenge\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
377 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
378 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
379 if (sp__MustSupportServerChallenge)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
380 { fprintf(stream, "%s- Server Challenge\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
381 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
382 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
383 if (sp__RequireClientEntropy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
384 { fprintf(stream, "%s- Client Entropy\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
385 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
386 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
387 if (sp__RequireServerEntropy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
388 { fprintf(stream, "%s- Server Entropy\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
389 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
390 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
391 if (sp__MustSupportIssuedTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
392 { fprintf(stream, "%s- Issued Tokens\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
393 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
394 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
395 if (sp__RequireRequestSecurityTokenCollection)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
396 { fprintf(stream, "%s- Collection\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
397 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
398 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
399 if (sp__RequireAppliesTo)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
400 { fprintf(stream, "%s- STS requires the requestor to specify the scope for the issued token using wsp:AppliesTo in the RST\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
401 service.add_import("wst.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
402 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
403 // WS-Security header layout
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
404 if (sp__IncludeTimestamp)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
405 { fprintf(stream, "%s- WS-Security Timestamp%s should be set prior to send:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_add_Timestamp(soap, \"Timestamp\", <seconds>);\n\t@endcode\n", tabs, sp__IncludeTimestamp->Optional ? " (optional)" : sp__IncludeTimestamp->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
406 fprintf(stream, "%s- WS-Security Timestamp%s presence and expiration verified post-receive with:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tif (soap_wsse_verify_Timestamp(soap)) ...<error>...\n\t@endcode\n", tabs, sp__IncludeTimestamp->Optional ? " (optional)" : sp__IncludeTimestamp->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
407 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
408 if (sp__EncryptBeforeSigning)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
409 fprintf(stream, "%s- WS-Security Encrypt Before Signing%s (gSOAP unsupported)\n", tabs, sp__EncryptBeforeSigning->Optional ? " (optional)" : sp__EncryptBeforeSigning->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
410 if (sp__EncryptSignature)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
411 fprintf(stream, "%s- WS-Security Encrypt Signature%s\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_add_EncryptedKey_encrypt_only(soap, <SOAP_MEC_ENV_ENC_xxx_CBC>, NULL, <cert>, NULL, <issuer>, <serial>, \"ds:Signature SOAP-ENV:Body\");\n\t@endcode\n", tabs, sp__EncryptSignature->Optional ? " (optional)" : sp__EncryptSignature->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
412 if (sp__ProtectTokens)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
413 fprintf(stream, "%s- WS-Security Token Protection%s required\n", tabs, sp__ProtectTokens->Optional ? " (optional)" : sp__ProtectTokens->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
414 if (sp__OnlySignEntireHeadersAndBody)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
415 { fprintf(stream, "%s- WS-Security Sign Entire Headers and Body%s:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_set_wsu_id(soap, \"<ns:tagname1> <ns:tagname2> ...\"); // list each ns:tagname used in SOAP Header\n\tsoap_wsse_sign_body(soap, <algorithm>, <key>, <keylen>);\n\t@endcode\n", tabs, sp__OnlySignEntireHeadersAndBody->Optional ? " (optional)" : sp__OnlySignEntireHeadersAndBody->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
416 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
417 if (sp__Strict)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
418 fprintf(stream, "%s- WS-Security headers 'declare before use' required (gSOAP default)\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
419 else if (sp__Lax)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
420 fprintf(stream, "%s- WS-Security headers may occur in any order (gSOAP allows this)\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
421 else if (sp__LaxTsFirst)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
422 fprintf(stream, "%s- WS-Security Timestamp must appear first (gSOAP default)\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
423 else if (sp__LaxTsLast)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
424 fprintf(stream, "%s- WS-Security Timestamp must appear last (requires changing the placement of the Timestamp header in SOAP_ENV__Header defined in import/wsse.h)\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
425 // HTTP authentication
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
426 if (sp__HttpBasicAuthentication)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
427 fprintf(stream, "%s- HTTP/S Basic Authentication required:\n\t@code\n\tsoap->userid = \"<userid>\"; soap->passwd = \"<passwd>\";\nsoap_call_ns__method(...)\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
428 else if (sp__HttpDigestAuthentication)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
429 fprintf(stream, "%s- HTTP/S Digest Authentication required:\n%sSee plugin/httpda.c plugin for usage details\n", tabs, tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
430 if (sp__RequireClientCertificate)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
431 fprintf(stream, "%s- HTTPS client must authenticate to server with a certificate:\n\t@code\n\tsoap_ssl_client_context(soap, <sslflags>, \"<certkeyfile>\", \"<certkeypw>\", ...)\n\t@endcode\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
432 // Security token requirements
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
433 if (sp__RequireKeyIdentifierReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
434 fprintf(stream, "%s- Key identifier reference is required\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
435 if (sp__RequireIssuerSerialReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
436 fprintf(stream, "%s- Issuer serial reference is required\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
437 if (sp__RequireEmbeddedTokenReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
438 fprintf(stream, "%s- An embedded token reference is required\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
439 if (sp__RequireThumbprintReference)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
440 fprintf(stream, "%s- A thumbprint reference is required\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
441 // Algorithm suite
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
442 if (sp__Basic256)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
443 fprintf(stream, "%s- Basic256\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
444 else if (sp__Basic192)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
445 fprintf(stream, "%s- Basic192\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
446 else if (sp__Basic128)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
447 fprintf(stream, "%s- Basic128\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
448 else if (sp__TripleDes)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
449 fprintf(stream, "%s- TripleDes\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
450 else if (sp__Basic256Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
451 fprintf(stream, "%s- Basic256Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
452 else if (sp__Basic192Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
453 fprintf(stream, "%s- Basic192Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
454 else if (sp__Basic128Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
455 fprintf(stream, "%s- Basic128Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
456 else if (sp__TripleDesRsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
457 fprintf(stream, "%s- TripleDesRsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
458 else if (sp__Basic256Sha256)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
459 fprintf(stream, "%s- Basic256Sha256\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
460 else if (sp__Basic192Sha256)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
461 fprintf(stream, "%s- Basic192Sha256\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
462 else if (sp__Basic128Sha256)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
463 fprintf(stream, "%s- Basic128Sha256\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
464 else if (sp__TripleDesSha256)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
465 fprintf(stream, "%s- TripleDesSha256\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
466 else if (sp__Basic256Sha256Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
467 fprintf(stream, "%s- Basic256Sha256Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
468 else if (sp__Basic192Sha256Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
469 fprintf(stream, "%s- Basic192Sha256Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
470 else if (sp__Basic128Sha256Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
471 fprintf(stream, "%s- Basic128Sha256Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
472 else if (sp__TripleDesSha256Rsa15)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
473 fprintf(stream, "%s- TripleDesSha256Rsa15\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
474 if (sp__InclusiveC14N)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
475 fprintf(stream, "%s- InclusiveC14N\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
476 if (sp__SOAPNormalization10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
477 fprintf(stream, "%s- SOAPNormalization10\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
478 if (sp__STRTransform10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
479 fprintf(stream, "%s- STRTransform10\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
480 if (sp__Path10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
481 fprintf(stream, "%s- Path10\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
482 else if (sp__XPathFilter20)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
483 fprintf(stream, "%s- XPathFilter20\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
484 else if (sp__AbsXPath)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
485 fprintf(stream, "%s- AbsXPath\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
486 // WSS
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
487 if (sp__WssX509V3Token10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
488 fprintf(stream, "%s- An X509 Version 3 token should be used as defined in X509TokenProfile1.0\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
489 else if (sp__WssX509Pkcs7Token10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
490 fprintf(stream, "%s- An X509 PKCS7 token should be used as defined in X509TokenProfile1.0\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
491 else if (sp__WssX509PkiPathV1Token10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
492 fprintf(stream, "%s- An X509 PKI Path Version 1 token should be used as defined in X509TokenProfile1.0\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
493 else if (sp__WssX509V1Token11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
494 fprintf(stream, "%s- An X509 Version 1 token should be used as defined in X509TokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
495 else if (sp__WssX509V3Token11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
496 fprintf(stream, "%s- An X509 Version 3 token should be used as defined in X509TokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
497 else if (sp__WssX509Pkcs7Token11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
498 fprintf(stream, "%s- An X509 PKCS7 token should be used as defined in X509TokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
499 else if (sp__WssX509PkiPathV1Token11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
500 fprintf(stream, "%s- An X509 PKI Path Version 1 token should be used as defined in X509TokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
501 if (sp__WssKerberosV5ApReqToken11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
502 fprintf(stream, "%s- A Kerberos Version 5 AP-REQ X509 token should be used as defined in KerberosTokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
503 else if (sp__WssGssKerberosV5ApReqToken11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
504 fprintf(stream, "%s- A GSS Kerberos Version 5 AP-REQ token should be used as defined in KerberosTokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
505 if (sp__WssRelV10Token10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
506 fprintf(stream, "%s- A REL Version 1.0 token should be used as defined in RELTokenProfile1.0\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
507 else if (sp__WssRelV20Token10)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
508 fprintf(stream, "%s- A REL Version 2.0 token should be used as defined in RELTokenProfile1.0\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
509 else if (sp__WssRelV10Token11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
510 fprintf(stream, "%s- A REL Version 1.0 token should be used as defined in RELTokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
511 else if (sp__WssRelV20Token11)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
512 fprintf(stream, "%s- A REL Version 2.0 token should be used as defined in RELTokenProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
513 if (sp__BootstrapPolicy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
514 { fprintf(stream, "%s- SecureConversation BootstrapPolicy\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
515 sp__BootstrapPolicy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
516 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
517 // WS-Addressing WSDL Policy
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
518 if (wsaw__UsingAddressing)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
519 { fprintf(stream, "%s- WS-Addressing is used\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
520 service.add_import("wsa5.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
521 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
522 // WS-Addressing Metadata Policy
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
523 if (wsam__Addressing)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
524 { fprintf(stream, "%s- WS-Addressing%s is used\n", tabs, wsam__Addressing->Optional ? " (optional)" : wsam__Addressing->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
525 if (wsam__Addressing->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
526 wsam__Addressing->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
527 service.add_import("wsa5.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
528 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
529 if (wsam__AnonymousResponses)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
530 fprintf(stream, "%s- WS-Addressing Anonymous Responses\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
531 else if (wsam__NonAnonymousResponses)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
532 fprintf(stream, "%s- WS-Addressing NonAnonymous Responses\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
533 // WS-ReliableMessaging Policy
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
534 if (wsrmp__RMAssertion_)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
535 { fprintf(stream, "%s- WS-ReliableMessaging%s is used\n", tabs, wsrmp__RMAssertion_->Optional ? " (optional)" : wsrmp__RMAssertion_->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
536 if (wsrmp__RMAssertion_->InactivityTimeout && wsrmp__RMAssertion_->InactivityTimeout->Milliseconds)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
537 fprintf(stream, "%s - Inactivity Timeout = %s (ms)\n", tabs, wsrmp__RMAssertion_->InactivityTimeout->Milliseconds);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
538 if (wsrmp__RMAssertion_->BaseRetransmissionInterval && wsrmp__RMAssertion_->BaseRetransmissionInterval->Milliseconds)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
539 fprintf(stream, "%s - Base Retransmission Interval = %s (ms)\n", tabs, wsrmp__RMAssertion_->BaseRetransmissionInterval->Milliseconds);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
540 if (wsrmp__RMAssertion_->AcknowledgementInterval && wsrmp__RMAssertion_->AcknowledgementInterval->Milliseconds)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
541 fprintf(stream, "%s - Acknowledgement Interval = %s (ms)\n", tabs, wsrmp__RMAssertion_->AcknowledgementInterval->Milliseconds);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
542 if (wsrmp__RMAssertion_->ExponentialBackoff)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
543 fprintf(stream, "%s - ExponentialBackoff\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
544 if (wsrmp__RMAssertion_->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
545 wsrmp__RMAssertion_->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
546 service.add_import("wsrm.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
547 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
548 if (wsrmp__DeliveryAssurance)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
549 { fprintf(stream, "%s- WS-ReliableMessaging Delivery Assurance%s:\n", tabs, wsrmp__DeliveryAssurance->Optional ? " (optional)" : wsrmp__DeliveryAssurance->Ignorable ? " (ignorable)" : "");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
550 if (wsrmp__DeliveryAssurance->Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
551 wsrmp__DeliveryAssurance->Policy->generate(service, types, indent + 1);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
552 service.add_import("wsrm.h");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
553 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
554 if (wsrmp__AtLeastOnce)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
555 fprintf(stream, "%s- At Least Once\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
556 if (wsrmp__AtMostOnce)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
557 fprintf(stream, "%s- At Most Once\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
558 if (wsrmp__ExactlyOnce)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
559 fprintf(stream, "%s- Exactly Once\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
560 if (wsrmp__InOrder)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
561 fprintf(stream, "%s- In Order\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
562 // All else
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
563 for (vector<_XML>::const_iterator x = __any.begin(); x != __any.end(); ++x)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
564 { if (*x && *(*x))
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
565 { fprintf(stream, "%s- Other policy requirements:\n\t@verbatim\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
566 text(*x);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
567 fprintf(stream, "\t@endverbatim\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
568 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
569 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
570 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
571
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
572 static void gen_parts(const sp__Parts& parts, Types& types, const char *what, const char *name, int indent)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
573 { static const char stabs[] = "\t\t\t\t\t\t\t\t\t\t";
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
574 const char *tabs;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
575 if (indent > 8)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
576 indent = 8;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
577 tabs = stabs + 9 - indent;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
578 fprintf(stream, "%s- %s requirements:\n", tabs, name);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
579 if (parts.Body)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
580 fprintf(stream, "%s -# Body:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_%s_body(soap, <algorithm>, <key>, <keylen>);\n\t@endcode\n", tabs, what);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
581 if (!parts.Header.empty())
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
582 { fprintf(stream, "%s -# Header elements:\n\t@code\n\t#include \"plugin/wsseapi.h\"\n\tsoap_wsse_set_wsu_id(soap, \"", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
583 for (vector<sp__Header>::const_iterator h = parts.Header.begin(); h != parts.Header.end(); ++h)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
584 { if ((*h).Name)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
585 fprintf(stream, "%s ", types.aname(NULL, (*h).Namespace, (*h).Name));
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
586 else if ((*h).Namespace)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
587 fprintf(stream, "%s: ", types.nsprefix(NULL, (*h).Namespace));
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
588 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
589 fprintf(stream, "\");\n\t@endcode\n");
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
590 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
591 if (parts.Attachments)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
592 fprintf(stream, "%s -# Attachments as defined in SwAProfile1.1\n", tabs);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
593 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
594
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
595 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
596 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
597 // wsp:PolicyReference
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
598 //
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
599 ////////////////////////////////////////////////////////////////////////////////
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
600
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
601 int wsp__PolicyReference::traverse(wsdl__definitions& definitions)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
602 { policyRef = NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
603 if (!URI || !*URI)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
604 { cerr << "PolicyReference has no URI" << endl;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
605 return SOAP_OK;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
606 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
607 if (*URI == '#')
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
608 { policyRef = search(URI + 1, definitions);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
609 if (!policyRef)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
610 { cerr << "PolicyReference URI=\"" << URI << "\" not found" << endl;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
611 return SOAP_OK;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
612 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
613 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
614 return SOAP_OK;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
615 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
616
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
617 void wsp__PolicyReference::policyPtr(wsp__Policy *Policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
618 { policyRef = Policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
619 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
620
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
621 wsp__Policy *wsp__PolicyReference::policyPtr() const
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
622 { return policyRef;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
623 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
624
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
625 static wsp__Policy *search(const char *URI, wsdl__definitions& definitions)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
626 { for (vector<wsp__Policy>::iterator p = definitions.wsp__Policy_.begin(); p != definitions.wsp__Policy_.end(); ++p)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
627 { wsp__Policy *policy = search(URI, &(*p));
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
628 if (policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
629 return policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
630 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
631 return NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
632 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
633
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
634 static wsp__Policy *search(const char *URI, wsp__Policy *policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
635 { if (!policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
636 return NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
637 if (policy->wsu__Id && !strcmp(URI, policy->wsu__Id))
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
638 return policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
639 return search(URI, (wsp__Content*)policy);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
640 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
641
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
642 static wsp__Policy *search(const char *URI, wsp__Content *content)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
643 { wsp__Policy *policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
644 policy = search(URI, content->Policy);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
645 if (policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
646 return policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
647 for (vector<wsp__Content*>::iterator i = content->All.begin(); i != content->All.end(); ++i)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
648 { policy = search(URI, *i);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
649 if (policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
650 return policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
651 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
652 for (vector<wsp__Content*>::iterator j = content->ExactlyOne.begin(); j != content->ExactlyOne.end(); ++j)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
653 { policy = search(URI, *j);
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
654 if (policy)
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
655 return policy;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
656 }
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
657 return NULL;
8300eb051bea Initial upload
ktnyt
parents:
diff changeset
658 }