webservices: Add support for union types in the writer.
[wine.git] / dlls / webservices / string.c
blob8fc2b6a5f440c912f681a2f3265b5ca80ab4eebb
1 /*
2 * Copyright 2015-2017 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <stdarg.h>
21 #include "windef.h"
22 #include "winbase.h"
23 #include "webservices.h"
25 #include "wine/debug.h"
26 #include "wine/list.h"
27 #include "webservices_private.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(webservices);
31 const char *debugstr_xmlstr( const WS_XML_STRING *str )
33 if (!str) return "(null)";
34 return debugstr_an( (const char *)str->bytes, str->length );
37 static CRITICAL_SECTION dict_cs;
38 static CRITICAL_SECTION_DEBUG dict_cs_debug =
40 0, 0, &dict_cs,
41 { &dict_cs_debug.ProcessLocksList,
42 &dict_cs_debug.ProcessLocksList},
43 0, 0, {(DWORD_PTR)(__FILE__ ": dict_cs") }
45 static CRITICAL_SECTION dict_cs = { &dict_cs_debug, -1, 0, 0, 0, 0 };
47 struct dictionary dict_builtin =
49 {{0x82704485,0x222a,0x4f7c,{0xb9,0x7b,0xe9,0xa4,0x62,0xa9,0x66,0x2b}}}
52 static inline int cmp_string( const unsigned char *str, ULONG len, const unsigned char *str2, ULONG len2 )
54 if (len < len2) return -1;
55 else if (len > len2) return 1;
56 while (len--)
58 if (*str == *str2) { str++; str2++; }
59 else return *str - *str2;
61 return 0;
64 /* return -1 and string id if found, sort index if not found */
65 static int find_string( const WS_XML_DICTIONARY *dict, const ULONG *sorted, const unsigned char *data,
66 ULONG len, ULONG *ret_id )
68 int i, c, min = 0, max = dict->stringCount - 1;
69 while (min <= max)
71 i = (min + max) / 2;
72 c = cmp_string( data, len, dict->strings[sorted[i]].bytes, dict->strings[sorted[i]].length );
73 if (c < 0)
74 max = i - 1;
75 else if (c > 0)
76 min = i + 1;
77 else
79 *ret_id = dict->strings[sorted[i]].id;
80 return -1;
83 return max + 1;
86 #define MIN_DICTIONARY_SIZE 256
87 #define MAX_DICTIONARY_SIZE 2048
89 static BOOL grow_dict( struct dictionary *dict, ULONG size )
91 WS_XML_STRING *tmp;
92 ULONG new_size, *tmp_sorted;
94 if (dict->size >= dict->dict.stringCount + size) return TRUE;
95 if (dict->size + size > MAX_DICTIONARY_SIZE) return FALSE;
97 if (!dict->dict.strings)
99 new_size = max( MIN_DICTIONARY_SIZE, size );
100 if (!(dict->dict.strings = heap_alloc( new_size * sizeof(*dict->dict.strings) ))) return FALSE;
101 if (!(dict->sorted = heap_alloc( new_size * sizeof(*dict->sorted) )))
103 heap_free( dict->dict.strings );
104 dict->dict.strings = NULL;
105 return FALSE;
107 dict->size = new_size;
108 return TRUE;
111 new_size = max( dict->size * 2, size );
112 if (!(tmp = heap_realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return FALSE;
113 dict->dict.strings = tmp;
114 if (!(tmp_sorted = heap_realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return FALSE;
115 dict->sorted = tmp_sorted;
117 dict->size = new_size;
118 return TRUE;
121 static BOOL insert_string( struct dictionary *dict, unsigned char *data, ULONG len, int i, ULONG *ret_id )
123 ULONG id = dict->dict.stringCount;
124 if (!grow_dict( dict, 1 )) return FALSE;
125 memmove( &dict->sorted[i] + 1, &dict->sorted[i], (dict->dict.stringCount - i) * sizeof(*dict->sorted) );
126 dict->sorted[i] = id;
128 dict->dict.strings[id].length = len;
129 dict->dict.strings[id].bytes = data;
130 dict->dict.strings[id].dictionary = &dict->dict;
131 dict->dict.strings[id].id = id;
132 dict->dict.stringCount++;
133 *ret_id = id;
134 return TRUE;
137 HRESULT add_xml_string( WS_XML_STRING *str )
139 int index;
140 ULONG id;
142 if (str->dictionary) return S_OK;
144 EnterCriticalSection( &dict_cs );
145 if ((index = find_string( &dict_builtin.dict, dict_builtin.sorted, str->bytes, str->length, &id )) == -1)
147 heap_free( str->bytes );
148 *str = dict_builtin.dict.strings[id];
149 LeaveCriticalSection( &dict_cs );
150 return S_OK;
152 if (insert_string( &dict_builtin, str->bytes, str->length, index, &id ))
154 *str = dict_builtin.dict.strings[id];
155 LeaveCriticalSection( &dict_cs );
156 return S_OK;
158 LeaveCriticalSection( &dict_cs );
159 return WS_E_QUOTA_EXCEEDED;
162 WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len )
164 WS_XML_STRING *ret;
166 if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
167 if ((ret->length = len) && !(ret->bytes = heap_alloc( len )))
169 heap_free( ret );
170 return NULL;
172 if (data)
174 memcpy( ret->bytes, data, len );
175 if (add_xml_string( ret ) != S_OK) WARN( "string not added to dictionary\n" );
177 return ret;
180 void free_xml_string( WS_XML_STRING *str )
182 if (!str) return;
183 if (!str->dictionary) heap_free( str->bytes );
184 heap_free( str );
187 WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src )
189 WS_XML_STRING *ret;
190 unsigned char *data;
191 int index;
192 ULONG id;
194 if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
195 if (src->dictionary)
197 *ret = *src;
198 return ret;
201 EnterCriticalSection( &dict_cs );
202 if ((index = find_string( &dict_builtin.dict, dict_builtin.sorted, src->bytes, src->length, &id )) == -1)
204 *ret = dict_builtin.dict.strings[id];
205 LeaveCriticalSection( &dict_cs );
206 return ret;
208 if (!(data = heap_alloc( src->length )))
210 heap_free( ret );
211 LeaveCriticalSection( &dict_cs );
212 return NULL;
214 memcpy( data, src->bytes, src->length );
215 if (insert_string( &dict_builtin, data, src->length, index, &id ))
217 *ret = dict_builtin.dict.strings[id];
218 LeaveCriticalSection( &dict_cs );
219 return ret;
221 LeaveCriticalSection( &dict_cs );
223 WARN( "string not added to dictionary\n" );
224 ret->length = src->length;
225 ret->bytes = data;
226 ret->dictionary = NULL;
227 ret->id = 0;
228 return ret;
231 const struct dictionary dict_builtin_static;
232 static const WS_XML_STRING dict_strings[] =
234 #define X(str, id) { sizeof(str) - 1, (BYTE *)(str), (WS_XML_DICTIONARY *)&dict_builtin_static.dict, id },
235 X("mustUnderstand", 0)
236 X("Envelope", 1)
237 X("http://www.w3.org/2003/05/soap-envelope", 2)
238 X("http://www.w3.org/2005/08/addressing", 3)
239 X("Header", 4)
240 X("Action", 5)
241 X("To", 6)
242 X("Body", 7)
243 X("Algorithm", 8)
244 X("RelatesTo", 9)
245 X("http://www.w3.org/2005/08/addressing/anonymous", 10)
246 X("URI", 11)
247 X("Reference", 12)
248 X("MessageID", 13)
249 X("Id", 14)
250 X("Identifier", 15)
251 X("http://schemas.xmlsoap.org/ws/2005/02/rm", 16)
252 X("Transforms", 17)
253 X("Transform", 18)
254 X("DigestMethod", 19)
255 X("DigestValue", 20)
256 X("Address", 21)
257 X("ReplyTo", 22)
258 X("SequenceAcknowledgement", 23)
259 X("AcknowledgementRange", 24)
260 X("Upper", 25)
261 X("Lower", 26)
262 X("BufferRemaining", 27)
263 X("http://schemas.microsoft.com/ws/2006/05/rm", 28)
264 X("http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement", 29)
265 X("SecurityTokenReference", 30)
266 X("Sequence", 31)
267 X("MessageNumber", 32)
268 X("http://www.w3.org/2000/09/xmldsig#", 33)
269 X("http://www.w3.org/2000/09/xmldsig#enveloped-signature", 34)
270 X("KeyInfo", 35)
271 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", 36)
272 X("http://www.w3.org/2001/04/xmlenc#", 37)
273 X("http://schemas.xmlsoap.org/ws/2005/02/sc", 38)
274 X("DerivedKeyToken", 39)
275 X("Nonce", 40)
276 X("Signature", 41)
277 X("SignedInfo", 42)
278 X("CanonicalizationMethod", 43)
279 X("SignatureMethod", 44)
280 X("SignatureValue", 45)
281 X("DataReference", 46)
282 X("EncryptedData", 47)
283 X("EncryptionMethod", 48)
284 X("CipherData", 49)
285 X("CipherValue", 50)
286 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", 51)
287 X("Security", 52)
288 X("Timestamp", 53)
289 X("Created", 54)
290 X("Expires", 55)
291 X("Length", 56)
292 X("ReferenceList", 57)
293 X("ValueType", 58)
294 X("Type", 59)
295 X("EncryptedHeader", 60)
296 X("http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", 61)
297 X("RequestSecurityTokenResponseCollection", 62)
298 X("http://schemas.xmlsoap.org/ws/2005/02/trust", 63)
299 X("http://schemas.xmlsoap.org/ws/2005/02/trust#BinarySecret", 64)
300 X("http://schemas.microsoft.com/ws/2006/02/transactions", 65)
301 X("s", 66)
302 X("Fault", 67)
303 X("MustUnderstand", 68)
304 X("role", 69)
305 X("relay", 70)
306 X("Code", 71)
307 X("Reason", 72)
308 X("Text", 73)
309 X("Node", 74)
310 X("Role", 75)
311 X("Detail", 76)
312 X("Value", 77)
313 X("Subcode", 78)
314 X("NotUnderstood", 79)
315 X("qname", 80)
316 X("", 81)
317 X("From", 82)
318 X("FaultTo", 83)
319 X("EndpointReference", 84)
320 X("PortType", 85)
321 X("ServiceName", 86)
322 X("PortName", 87)
323 X("ReferenceProperties", 88)
324 X("RelationshipType", 89)
325 X("Reply", 90)
326 X("a", 91)
327 X("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", 92)
328 X("Identity", 93)
329 X("Spn", 94)
330 X("Upn", 95)
331 X("Rsa", 96)
332 X("Dns", 97)
333 X("X509v3Certificate", 98)
334 X("http://www.w3.org/2005/08/addressing/fault", 99)
335 X("ReferenceParameters", 100)
336 X("IsReferenceParameter", 101)
337 X("http://www.w3.org/2005/08/addressing/reply", 102)
338 X("http://www.w3.org/2005/08/addressing/none", 103)
339 X("Metadata", 104)
340 X("http://schemas.xmlsoap.org/ws/2004/08/addressing", 105)
341 X("http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous", 106)
342 X("http://schemas.xmlsoap.org/ws/2004/08/addressing/fault", 107)
343 X("http://schemas.xmlsoap.org/ws/2004/06/addressingex", 108)
344 X("RedirectTo", 109)
345 X("Via", 110)
346 X("http://www.w3.org/2001/10/xml-exc-c14n#", 111)
347 X("PrefixList", 112)
348 X("InclusiveNamespaces", 113)
349 X("ec", 114)
350 X("SecurityContextToken", 115)
351 X("Generation", 116)
352 X("Label", 117)
353 X("Offset", 118)
354 X("Properties", 119)
355 X("Cookie", 120)
356 X("wsc", 121)
357 X("http://schemas.xmlsoap.org/ws/2004/04/sc", 122)
358 X("http://schemas.xmlsoap.org/ws/2004/04/security/sc/dk", 123)
359 X("http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct", 124)
360 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RST/SCT", 125)
361 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RSTR/SCT", 126)
362 X("RenewNeeded", 127)
363 X("BadContextToken", 128)
364 X("c", 129)
365 X("http://schemas.xmlsoap.org/ws/2005/02/sc/dk", 130)
366 X("http://schemas.xmlsoap.org/ws/2005/02/sc/sct", 131)
367 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT", 132)
368 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT", 133)
369 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Renew", 134)
370 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT/Renew", 135)
371 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Cancel", 136)
372 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT/Cancel", 137)
373 X("http://www.w3.org/2001/04/xmlenc#aes128-cbc", 138)
374 X("http://www.w3.org/2001/04/xmlenc#kw-aes128", 139)
375 X("http://www.w3.org/2001/04/xmlenc#aes192-cbc", 140)
376 X("http://www.w3.org/2001/04/xmlenc#kw-aes192", 141)
377 X("http://www.w3.org/2001/04/xmlenc#aes256-cbc", 142)
378 X("http://www.w3.org/2001/04/xmlenc#kw-aes256", 143)
379 X("http://www.w3.org/2001/04/xmlenc#des-cbc", 144)
380 X("http://www.w3.org/2000/09/xmldsig#dsa-sha1", 145)
381 X("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", 146)
382 X("http://www.w3.org/2000/09/xmldsig#hmac-sha1", 147)
383 X("http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", 148)
384 X("http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1", 149)
385 X("http://www.w3.org/2001/04/xmlenc#ripemd160", 150)
386 X("http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p", 151)
387 X("http://www.w3.org/2000/09/xmldsig#rsa-sha1", 152)
388 X("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", 153)
389 X("http://www.w3.org/2001/04/xmlenc#rsa-1_5", 154)
390 X("http://www.w3.org/2000/09/xmldsig#sha1", 155)
391 X("http://www.w3.org/2001/04/xmlenc#sha256", 156)
392 X("http://www.w3.org/2001/04/xmlenc#sha512", 157)
393 X("http://www.w3.org/2001/04/xmlenc#tripledes-cbc", 158)
394 X("http://www.w3.org/2001/04/xmlenc#kw-tripledes", 159)
395 X("http://schemas.xmlsoap.org/2005/02/trust/tlsnego#TLS_Wrap", 160)
396 X("http://schemas.xmlsoap.org/2005/02/trust/spnego#GSS_Wrap", 161)
397 X("http://schemas.microsoft.com/ws/2006/05/security", 162)
398 X("dnse", 163)
399 X("o", 164)
400 X("Password", 165)
401 X("PasswordText", 166)
402 X("Username", 167)
403 X("UsernameToken", 168)
404 X("BinarySecurityToken", 169)
405 X("EncodingType", 170)
406 X("KeyIdentifier", 171)
407 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary", 172)
408 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#HexBinary", 173)
409 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Text", 174)
410 X("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier", 175)
411 X("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ", 176)
412 X("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ1510", 177)
413 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID", 178)
414 X("Assertion", 179)
415 X("urn:oasis:names:tc:SAML:1.0:assertion", 180)
416 X("http://docs.oasis-open.org/wss/oasis-wss-rel-token-profile-1.0.pdf#license", 181)
417 X("FailedAuthentication", 182)
418 X("InvalidSecurityToken", 183)
419 X("InvalidSecurity", 184)
420 X("k", 185)
421 X("SignatureConfirmation", 186)
422 X("TokenType", 187)
423 X("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1", 188)
424 X("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey", 189)
425 X("http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKeySHA1", 190)
426 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1", 191)
427 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0", 192)
428 X("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLID", 193)
429 X("AUTH-HASH", 194)
430 X("RequestSecurityTokenResponse", 195)
431 X("KeySize", 196)
432 X("RequestedTokenReference", 197)
433 X("AppliesTo", 198)
434 X("Authenticator", 199)
435 X("CombinedHash", 200)
436 X("BinaryExchange", 201)
437 X("Lifetime", 202)
438 X("RequestedSecurityToken", 203)
439 X("Entropy", 204)
440 X("RequestedProofToken", 205)
441 X("ComputedKey", 206)
442 X("RequestSecurityToken", 207)
443 X("RequestType", 208)
444 X("Context", 209)
445 X("BinarySecret", 210)
446 X("http://schemas.xmlsoap.org/ws/2005/02/trust/spnego", 211)
447 X("http://schemas.xmlsoap.org/ws/2005/02/trust/tlsnego", 212)
448 X("wst", 213)
449 X("http://schemas.xmlsoap.org/ws/2004/04/trust", 214)
450 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RST/Issue", 215)
451 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/RSTR/Issue", 216)
452 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue", 217)
453 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/CK/PSHA1", 218)
454 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/SymmetricKey", 219)
455 X("http://schemas.xmlsoap.org/ws/2004/04/security/trust/Nonce", 220)
456 X("KeyType", 221)
457 X("http://schemas.xmlsoap.org/ws/2004/04/trust/SymmetricKey", 222)
458 X("http://schemas.xmlsoap.org/ws/2004/04/trust/PublicKey", 223)
459 X("Claims", 224)
460 X("InvalidRequest", 225)
461 X("RequestFailed", 226)
462 X("SignWith", 227)
463 X("EncryptWith", 228)
464 X("EncryptionAlgorithm", 229)
465 X("CanonicalizationAlgorithm", 230)
466 X("ComputedKeyAlgorithm", 231)
467 X("UseKey", 232)
468 X("http://schemas.microsoft.com/net/2004/07/secext/WS-SPNego", 233)
469 X("http://schemas.microsoft.com/net/2004/07/secext/TLSNego", 234)
470 X("t", 235)
471 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue", 236)
472 X("http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue", 237)
473 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Issue", 238)
474 X("http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey", 239)
475 X("http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1", 240)
476 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce", 241)
477 X("RenewTarget", 242)
478 X("CancelTarget", 243)
479 X("RequestedTokenCancelled", 244)
480 X("RequestedAttachedReference", 245)
481 X("RequestedUnattachedReference", 246)
482 X("IssuedTokens", 247)
483 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Renew", 248)
484 X("http://schemas.xmlsoap.org/ws/2005/02/trust/Cancel", 249)
485 X("http://schemas.xmlsoap.org/ws/2005/02/trust/PublicKey", 250)
486 X("Access", 251)
487 X("AccessDecision", 252)
488 X("Advice", 253)
489 X("AssertionID", 254)
490 X("AssertionIDReference", 255)
491 X("Attribute", 256)
492 X("AttributeName", 257)
493 X("AttributeNamespace", 258)
494 X("AttributeStatement", 259)
495 X("AttributeValue", 260)
496 X("Audience", 261)
497 X("AudienceRestrictionCondition", 262)
498 X("AuthenticationInstant", 263)
499 X("AuthenticationMethod", 264)
500 X("AuthenticationStatement", 265)
501 X("AuthorityBinding", 266)
502 X("AuthorityKind", 267)
503 X("AuthorizationDecisionStatement", 268)
504 X("Binding", 269)
505 X("Condition", 270)
506 X("Conditions", 271)
507 X("Decision", 272)
508 X("DoNotCacheCondition", 273)
509 X("Evidence", 274)
510 X("IssueInstant", 275)
511 X("Issuer", 276)
512 X("Location", 277)
513 X("MajorVersion", 278)
514 X("MinorVersion", 279)
515 X("NameIdentifier", 280)
516 X("Format", 281)
517 X("NameQualifier", 282)
518 X("Namespace", 283)
519 X("NotBefore", 284)
520 X("NotOnOrAfter", 285)
521 X("saml", 286)
522 X("Statement", 287)
523 X("Subject", 288)
524 X("SubjectConfirmation", 289)
525 X("SubjectConfirmationData", 290)
526 X("ConfirmationMethod", 291)
527 X("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key", 292)
528 X("urn:oasis:names:tc:SAML:1.0:cm:sender-vouches", 293)
529 X("SubjectLocality", 294)
530 X("DNSAddress", 295)
531 X("IPAddress", 296)
532 X("SubjectStatement", 297)
533 X("urn:oasis:names:tc:SAML:1.0:am:unspecified", 298)
534 X("xmlns", 299)
535 X("Resource", 300)
536 X("UserName", 301)
537 X("urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName", 302)
538 X("EmailName", 303)
539 X("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", 304)
540 X("u", 305)
541 X("ChannelInstance", 306)
542 X("http://schemas.microsoft.com/ws/2005/02/duplex", 307)
543 X("Encoding", 308)
544 X("MimeType", 309)
545 X("CarriedKeyName", 310)
546 X("Recipient", 311)
547 X("EncryptedKey", 312)
548 X("KeyReference", 313)
549 X("e", 314)
550 X("http://www.w3.org/2001/04/xmlenc#Element", 315)
551 X("http://www.w3.org/2001/04/xmlenc#Content", 316)
552 X("KeyName", 317)
553 X("MgmtData", 318)
554 X("KeyValue", 319)
555 X("RSAKeyValue", 320)
556 X("Modulus", 321)
557 X("Exponent", 322)
558 X("X509Data", 323)
559 X("X509IssuerSerial", 324)
560 X("X509IssuerName", 325)
561 X("X509SerialNumber", 326)
562 X("X509Certificate", 327)
563 X("AckRequested", 328)
564 X("http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested", 329)
565 X("AcksTo", 330)
566 X("Accept", 331)
567 X("CreateSequence", 332)
568 X("http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence", 333)
569 X("CreateSequenceRefused", 334)
570 X("CreateSequenceResponse", 335)
571 X("http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse", 336)
572 X("FaultCode", 337)
573 X("InvalidAcknowledgement", 338)
574 X("LastMessage", 339)
575 X("http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage", 340)
576 X("LastMessageNumberExceeded", 341)
577 X("MessageNumberRollover", 342)
578 X("Nack", 343)
579 X("netrm", 344)
580 X("Offer", 345)
581 X("r", 346)
582 X("SequenceFault", 347)
583 X("SequenceTerminated", 348)
584 X("TerminateSequence", 349)
585 X("http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence", 350)
586 X("UnknownSequence", 351)
587 X("http://schemas.microsoft.com/ws/2006/02/tx/oletx", 352)
588 X("oletx", 353)
589 X("OleTxTransaction", 354)
590 X("PropagationToken", 355)
591 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor", 356)
592 X("wscoor", 357)
593 X("CreateCoordinationContext", 358)
594 X("CreateCoordinationContextResponse", 359)
595 X("CoordinationContext", 360)
596 X("CurrentContext", 361)
597 X("CoordinationType", 362)
598 X("RegistrationService", 363)
599 X("Register", 364)
600 X("RegisterResponse", 365)
601 X("ProtocolIdentifier", 366)
602 X("CoordinatorProtocolService", 367)
603 X("ParticipantProtocolService", 368)
604 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/CreateCoordinationContext", 369)
605 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/CreateCoordinationContextResponse", 370)
606 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/Register", 371)
607 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/RegisterResponse", 372)
608 X("http://schemas.xmlsoap.org/ws/2004/10/wscoor/fault", 373)
609 X("ActivationCoordinatorPortType", 374)
610 X("RegistrationCoordinatorPortType", 375)
611 X("InvalidState", 376)
612 X("InvalidProtocol", 377)
613 X("InvalidParameters", 378)
614 X("NoActivity", 379)
615 X("ContextRefused", 380)
616 X("AlreadyRegistered", 381)
617 X("http://schemas.xmlsoap.org/ws/2004/10/wsat", 382)
618 X("wsat", 383)
619 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Completion", 384)
620 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Durable2PC", 385)
621 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Volatile2PC", 386)
622 X("Prepare", 387)
623 X("Prepared", 388)
624 X("ReadOnly", 389)
625 X("Commit", 390)
626 X("Rollback", 391)
627 X("Committed", 392)
628 X("Aborted", 393)
629 X("Replay", 394)
630 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Commit", 395)
631 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Rollback", 396)
632 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Committed", 397)
633 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Aborted", 398)
634 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepare", 399)
635 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepared", 400)
636 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/ReadOnly", 401)
637 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/Replay", 402)
638 X("http://schemas.xmlsoap.org/ws/2004/10/wsat/fault", 403)
639 X("CompletionCoordinatorPortType", 404)
640 X("CompletionParticipantPortType", 405)
641 X("CoordinatorPortType", 406)
642 X("ParticipantPortType", 407)
643 X("InconsistentInternalState", 408)
644 X("mstx", 409)
645 X("Enlistment", 410)
646 X("protocol", 411)
647 X("LocalTransactionId", 412)
648 X("IsolationLevel", 413)
649 X("IsolationFlags", 414)
650 X("Description", 415)
651 X("Loopback", 416)
652 X("RegisterInfo", 417)
653 X("ContextId", 418)
654 X("TokenId", 419)
655 X("AccessDenied", 420)
656 X("InvalidPolicy", 421)
657 X("CoordinatorRegistrationFailed", 422)
658 X("TooManyEnlistments", 423)
659 X("Disabled", 424)
660 X("ActivityId", 425)
661 X("http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics", 426)
662 X("http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#Kerberosv5APREQSHA1", 427)
663 X("http://schemas.xmlsoap.org/ws/2002/12/policy", 428)
664 X("FloodMessage", 429)
665 X("LinkUtility", 430)
666 X("Hops", 431)
667 X("http://schemas.microsoft.com/net/2006/05/peer/HopCount", 432)
668 X("PeerVia", 433)
669 X("http://schemas.microsoft.com/net/2006/05/peer", 434)
670 X("PeerFlooder", 435)
671 X("PeerTo", 436)
672 X("http://schemas.microsoft.com/ws/2005/05/routing", 437)
673 X("PacketRoutable", 438)
674 X("http://schemas.microsoft.com/ws/2005/05/addressing/none", 439)
675 X("http://schemas.microsoft.com/ws/2005/05/envelope/none", 440)
676 X("http://www.w3.org/2001/XMLSchema-instance", 441)
677 X("http://www.w3.org/2001/XMLSchema", 442)
678 X("nil", 443)
679 X("type", 444)
680 X("char", 445)
681 X("boolean", 446)
682 X("byte", 447)
683 X("unsignedByte", 448)
684 X("short", 449)
685 X("unsignedShort", 450)
686 X("int", 451)
687 X("unsignedInt", 452)
688 X("long", 453)
689 X("unsignedLong", 454)
690 X("float", 455)
691 X("double", 456)
692 X("decimal", 457)
693 X("dateTime", 458)
694 X("string", 459)
695 X("base64Binary", 460)
696 X("anyType", 461)
697 X("duration", 462)
698 X("guid", 463)
699 X("anyURI", 464)
700 X("QName", 465)
701 X("time", 466)
702 X("date", 467)
703 X("hexBinary", 468)
704 X("gYearMonth", 469)
705 X("gYear", 470)
706 X("gMonthDay", 471)
707 X("gDay", 472)
708 X("gMonth", 473)
709 X("integer", 474)
710 X("positiveInteger", 475)
711 X("negativeInteger", 476)
712 X("nonPositiveInteger", 477)
713 X("nonNegativeInteger", 478)
714 X("normalizedString", 479)
715 X("ConnectionLimitReached", 480)
716 X("http://schemas.xmlsoap.org/soap/envelope/", 481)
717 X("actor", 482)
718 X("faultcode", 483)
719 X("faultstring", 484)
720 X("faultactor", 485)
721 X("detail", 486)
722 X("urn:oasis:names:tc:SAML:1.0:cm:bearer", 487)
723 #undef X
726 static const ULONG dict_sorted[] =
728 81, 91, 129, 314, 185, 164, 346, 66, 235, 305, 14, 6, 114, 97, 96, 94, 11, 95, 110, 451,
729 443, 121, 213, 7, 71, 82, 431, 343, 74, 75, 73, 59, 447, 445, 467, 163, 472, 463, 453, 409,
730 69, 286, 466, 444, 383, 67, 117, 26, 40, 345, 465, 90, 25, 77, 482, 455, 470, 344, 353, 80,
731 70, 449, 299, 331, 251, 330, 5, 253, 224, 390, 120, 76, 281, 4, 276, 56, 118, 436, 72, 394,
732 232, 464, 486, 456, 473, 459, 357, 393, 21, 269, 209, 54, 204, 55, 83, 35, 317, 196, 221, 321,
733 433, 387, 22, 78, 288, 419, 461, 446, 457, 474, 261, 272, 424, 308, 1, 274, 322, 93, 319, 202,
734 277, 416, 104, 318, 309, 165, 87, 85, 388, 389, 364, 300, 391, 52, 31, 227, 301, 167, 323, 458,
735 462, 411, 194, 8, 198, 179, 256, 392, 270, 418, 303, 337, 296, 13, 283, 284, 311, 12, 9, 41,
736 287, 53, 187, 18, 58, 483, 471, 468, 425, 49, 271, 295, 410, 116, 15, 379, 112, 119, 109, 42,
737 17, 485, 469, 254, 50, 206, 415, 20, 228, 339, 430, 435, 320, 127, 242, 208, 86, 484, 452, 420,
738 328, 210, 243, 200, 19, 170, 312, 429, 376, 275, 247, 313, 278, 279, 285, 166, 417, 460, 448, 454,
739 257, 199, 267, 46, 47, 421, 171, 32, 282, 79, 57, 226, 347, 168, 450, 252, 260, 201, 310, 380,
740 332, 361, 225, 414, 413, 68, 280, 438, 45, 325, 0, 128, 27, 306, 39, 60, 377, 184, 44, 294,
741 351, 327, 476, 475, 266, 362, 48, 354, 355, 365, 89, 297, 324, 326, 479, 381, 84, 378, 349, 98,
742 258, 259, 291, 412, 366, 348, 423, 478, 477, 169, 360, 406, 273, 229, 113, 407, 100, 88, 363, 205,
743 289, 24, 255, 264, 231, 182, 183, 101, 207, 115, 263, 334, 342, 186, 43, 480, 335, 338, 203, 30,
744 265, 244, 197, 23, 290, 230, 358, 408, 341, 367, 368, 245, 262, 195, 246, 374, 404, 405, 422, 268,
745 375, 442, 359, 37, 33, 3, 180, 487, 62, 155, 156, 157, 111, 2, 122, 16, 38, 316, 315, 144,
746 154, 481, 441, 103, 28, 382, 145, 152, 139, 141, 143, 150, 99, 102, 298, 214, 130, 63, 147, 138,
747 140, 142, 428, 356, 131, 292, 434, 159, 293, 307, 158, 10, 437, 151, 352, 162, 105, 403, 395, 402,
748 238, 241, 248, 153, 108, 398, 399, 373, 149, 249, 211, 148, 400, 401, 396, 132, 212, 146, 65, 123,
749 397, 340, 240, 133, 440, 124, 223, 384, 385, 371, 329, 250, 236, 34, 432, 107, 386, 237, 304, 234,
750 439, 333, 161, 222, 64, 239, 92, 233, 160, 134, 217, 220, 350, 136, 135, 137, 125, 426, 218, 126,
751 372, 215, 216, 106, 336, 29, 219, 61, 302, 193, 369, 191, 192, 181, 370, 178, 189, 36, 188, 51,
752 190, 174, 427, 176, 173, 177, 172, 175,
755 const struct dictionary dict_builtin_static =
757 {{0xf93578f8,0x5852,0x4eb7,{0xa6,0xfc,0xe7,0x2b,0xb7,0x1d,0xb6,0x22}},
758 (WS_XML_STRING *)dict_strings, sizeof(dict_strings)/sizeof(dict_strings[0]), TRUE},
759 (ULONG *)dict_sorted
762 /**************************************************************************
763 * WsGetDictionary [webservices.@]
765 HRESULT WINAPI WsGetDictionary( WS_ENCODING encoding, WS_XML_DICTIONARY **dict, WS_ERROR *error )
767 TRACE( "%u %p %p\n", encoding, dict, error );
768 if (error) FIXME( "ignoring error parameter\n" );
770 if (!dict) return E_INVALIDARG;
772 if (encoding == WS_ENCODING_XML_BINARY_1 || encoding == WS_ENCODING_XML_BINARY_SESSION_1)
773 *dict = (WS_XML_DICTIONARY *)&dict_builtin_static;
774 else
775 *dict = NULL;
777 return S_OK;
780 /**************************************************************************
781 * WsXmlStringEquals [webservices.@]
783 HRESULT WINAPI WsXmlStringEquals( const WS_XML_STRING *str1, const WS_XML_STRING *str2, WS_ERROR *error )
785 TRACE( "%s %s %p\n", debugstr_xmlstr(str1), debugstr_xmlstr(str2), error );
786 if (error) FIXME( "ignoring error parameter\n" );
788 if (!str1 || !str2) return E_INVALIDARG;
790 if (str1->length != str2->length) return S_FALSE;
791 if (!memcmp( str1->bytes, str2->bytes, str1->length )) return S_OK;
792 return S_FALSE;