1 /*
2  * Portions of this file Copyright 1999-2005 University of Chicago
3  * Portions of this file Copyright 1999-2005 The University of Southern California.
4  *
5  * This file or a portion of this file is licensed under the
6  * terms of the Globus Toolkit Public License, found at
7  * http://www.globus.org/toolkit/download/license.html.
8  * If you redistribute this file, with or without
9  * modifications, you must include this notice in the file.
10  */
11
12
13 /*
14  * This file is automatically generated by the Globus WSDLtoC converter
15  */
16
17 #include "xsd_QName.h"
18 #include "globus_soap_message.h"
19 #include "globus_xsd_type_info.h"
20 #include "wst_AuthenticatorType.h"
21
22 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
23 xsd_QName wst_AuthenticatorType_qname =
24 {
25     WST_AUTHENTICATORTYPE_NS,
26     WST_AUTHENTICATORTYPE_LOCAL
27 };
28 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
29
30 globus_result_t
31 wst_AuthenticatorType_serialize_wrapper(
32     xsd_QName *                         element_qname,
33     void *                              instance,
34     globus_soap_message_handle_t        message_handle,
35     globus_xsd_element_options_t        options)
36 0 {
37 0     return wst_AuthenticatorType_serialize(
38         element_qname,
39         (wst_AuthenticatorType *) instance,
40         message_handle, options);
41 }
42
43 globus_result_t
44 wst_AuthenticatorType_deserialize_pointer_wrapper(
45     xsd_QName *                         element_qname,
46     void **                             ip,
47     globus_soap_message_handle_t        message_handle,
48     globus_xsd_element_options_t        options)
49 0 {
50 0     return wst_AuthenticatorType_deserialize_pointer(
51         element_qname,
52         (wst_AuthenticatorType **) ip,
53         message_handle, options);
54 }
55
56 globus_result_t
57 wst_AuthenticatorType_init_wrapper(void **object)
58 0 {
59 0     return wst_AuthenticatorType_init(
60         (wst_AuthenticatorType **) object);
61 }
62
63 void
64 wst_AuthenticatorType_destroy_wrapper(
65     void *                          object)
66 0 {
67 0     wst_AuthenticatorType_destroy(
68         (wst_AuthenticatorType *) object);
69 }
70
71 globus_result_t
72 wst_AuthenticatorType_copy_wrapper(
73     void **                         dest_obj,
74     void *                          src_obj)
75 0 {
76 0     return wst_AuthenticatorType_copy(
77         (wst_AuthenticatorType **) dest_obj,
78         (wst_AuthenticatorType *) src_obj);
79 }
80
81 globus_result_t
82 wst_AuthenticatorType_init_contents_wrapper(void *object)
83 0 {
84 0     return wst_AuthenticatorType_init_contents(
85         (wst_AuthenticatorType *) object);
86 }
87
88 void
89 wst_AuthenticatorType_destroy_contents_wrapper(
90     void *                          object)
91 0 {
92 0     wst_AuthenticatorType_destroy_contents(
93         (wst_AuthenticatorType *) object);
94 }
95
96 globus_result_t
97 wst_AuthenticatorType_copy_contents_wrapper(
98     void *                          dest_obj,
99     void *                          src_obj)
100 0 {
101 0     return wst_AuthenticatorType_copy_contents(
102         (wst_AuthenticatorType *) dest_obj,
103         (wst_AuthenticatorType *) src_obj);
104 }
105
106 globus_result_t
107 wst_AuthenticatorType_serialize_contents_wrapper(
108     xsd_QName *                         element_qname,
109     void *                              instance,
110     globus_soap_message_handle_t        message_handle,
111     globus_xsd_element_options_t        options)
112 0 {
113 0     return wst_AuthenticatorType_serialize_contents(
114         element_qname,
115         (wst_AuthenticatorType *) instance,
116         message_handle, options);
117 }
118
119 globus_result_t
120 wst_AuthenticatorType_deserialize_contents_wrapper(
121     xsd_QName *                         element_qname,
122     void **                             instance,
123     globus_soap_message_handle_t        message_handle,
124     globus_xsd_element_options_t        options)
125 0 {
126 0     globus_result_t                     result;
127 0     GlobusFuncName(wst_AuthenticatorType_deserialize_contents_wrapper);
128 0     GlobusSoapMessageDebugEnter();
129
130 0     if(!*instance)
131     {
132 0         result = wst_AuthenticatorType_init(
133             (wst_AuthenticatorType **)instance);
134 0         if(result != GLOBUS_SUCCESS)
135         {
136 0             goto error;
137         }
138     }
139
140 0     result = wst_AuthenticatorType_deserialize_contents(
141         element_qname,
142         *(wst_AuthenticatorType **)instance,
143         message_handle, options);
144 error:
145 0     GlobusSoapMessageDebugExit();
146 0     return result;
147 }
148
149 globus_result_t
150 wst_AuthenticatorType_array_serialize_wrapper(
151     xsd_QName *                     element,
152     void *                          instance,
153     globus_soap_message_handle_t    message,
154     globus_xsd_element_options_t    options)
155 0 {
156 0     return wst_AuthenticatorType_array_serialize(
157         element,
158         (wst_AuthenticatorType_array *) instance,
159         message, options);
160 }
161
162 globus_result_t
163 wst_AuthenticatorType_array_deserialize_wrapper(
164     xsd_QName *                         element_qname,
165     void **                             inst,
166     globus_soap_message_handle_t        message,
167     globus_xsd_element_options_t        options)
168 0 {
169 0     if(!*inst)
170     {
171 0         globus_result_t                 result;
172
173 0         result = wst_AuthenticatorType_array_init(
174             (wst_AuthenticatorType_array **)inst);
175 0         if(result != GLOBUS_SUCCESS)
176         {
177 0             return result;
178         }
179     }
180
181 0     return wst_AuthenticatorType_array_deserialize(
182         element_qname,
183         *(wst_AuthenticatorType_array **) inst,
184         message, options);
185 }
186
187 globus_result_t
188 wst_AuthenticatorType_array_init_wrapper(
189     void **                             arr)
190 0 {
191 0     return wst_AuthenticatorType_array_init(
192         (wst_AuthenticatorType_array **) arr);
193 }
194
195 void
196 wst_AuthenticatorType_array_destroy_wrapper(
197     void *                              arr)
198 0 {
199 0     wst_AuthenticatorType_array_destroy(
200         (wst_AuthenticatorType_array *) arr);
201 }
202
203 globus_result_t
204 wst_AuthenticatorType_array_copy_wrapper(
205     void **                             dest_arr,
206     void *                              src_arr)
207 0 {
208 0     return wst_AuthenticatorType_array_copy(
209         (wst_AuthenticatorType_array **) dest_arr,
210         (wst_AuthenticatorType_array *) src_arr);
211 }
212
213 globus_result_t
214 wst_AuthenticatorType_array_init_contents_wrapper(
215     void *                              arr)
216 0 {
217 0     return wst_AuthenticatorType_array_init_contents(
218         (wst_AuthenticatorType_array *) arr);
219 }
220
221 void
222 wst_AuthenticatorType_array_destroy_contents_wrapper(
223     void *                              arr)
224 0 {
225 0     wst_AuthenticatorType_array_destroy_contents(
226         (wst_AuthenticatorType_array *) arr);
227 }
228
229 globus_result_t
230 wst_AuthenticatorType_array_copy_contents_wrapper(
231     void *                              dest_arr,
232     void *                              src_arr)
233 0 {
234 0     return wst_AuthenticatorType_array_copy_contents(
235         (wst_AuthenticatorType_array *) dest_arr,
236         (wst_AuthenticatorType_array *) src_arr);
237 }
238
239 struct globus_xsd_type_info_s wst_AuthenticatorType_contents_info =
240 {
241     &wst_AuthenticatorType_qname,
242     wst_AuthenticatorType_serialize_contents_wrapper,
243     wst_AuthenticatorType_deserialize_contents_wrapper,
244     wst_AuthenticatorType_init_wrapper,
245     wst_AuthenticatorType_destroy_wrapper,
246     wst_AuthenticatorType_copy_wrapper,
247     wst_AuthenticatorType_init_contents_wrapper,
248     wst_AuthenticatorType_destroy_contents_wrapper,
249     wst_AuthenticatorType_copy_contents_wrapper,
250     sizeof(wst_AuthenticatorType),
251     NULL,
252     NULL,
253     NULL
254 };
255
256 struct globus_xsd_type_info_s wst_AuthenticatorType_array_info =
257 {
258     &wst_AuthenticatorType_qname,
259     wst_AuthenticatorType_array_serialize_wrapper,
260     wst_AuthenticatorType_array_deserialize_wrapper,
261     wst_AuthenticatorType_array_init_wrapper,
262     wst_AuthenticatorType_array_destroy_wrapper,
263     wst_AuthenticatorType_array_copy_wrapper,
264     wst_AuthenticatorType_array_init_contents_wrapper,
265     wst_AuthenticatorType_array_destroy_contents_wrapper,
266     wst_AuthenticatorType_array_copy_contents_wrapper,
267     sizeof(wst_AuthenticatorType),
268     wst_AuthenticatorType_array_push_wrapper,
269     NULL,
270     NULL
271 };
272
273 struct globus_xsd_type_info_s wst_AuthenticatorType_info =
274 {
275     &wst_AuthenticatorType_qname,
276     wst_AuthenticatorType_serialize_wrapper,
277     wst_AuthenticatorType_deserialize_pointer_wrapper,
278     wst_AuthenticatorType_init_wrapper,
279     wst_AuthenticatorType_destroy_wrapper,
280     wst_AuthenticatorType_copy_wrapper,
281     wst_AuthenticatorType_init_contents_wrapper,
282     wst_AuthenticatorType_destroy_contents_wrapper,
283     wst_AuthenticatorType_copy_contents_wrapper,
284     sizeof(wst_AuthenticatorType),
285     NULL,
286     &wst_AuthenticatorType_contents_info,
287     &wst_AuthenticatorType_array_info
288 };
289
290 globus_result_t
291 wst_AuthenticatorType_init_contents(
292     wst_AuthenticatorType * instance)
293 0 {
294 0     globus_result_t                     result = GLOBUS_SUCCESS;
295 0     GlobusFuncName(wst_AuthenticatorType_init_contents);
296 0     GlobusSoapMessageDebugEnter();
297
298 0     memset(instance, 0, sizeof(wst_AuthenticatorType));
299
300 0     GlobusSoapMessageDebugExit();
301 0     return result;
302 }
303
304 globus_result_t
305 wst_AuthenticatorType_init(
306     wst_AuthenticatorType ** object)
307 0 {
308 0     wst_AuthenticatorType * instance;
309 0     globus_result_t                     result = GLOBUS_SUCCESS;
310 0     GlobusFuncName(wst_AuthenticatorType_init);
311 0     GlobusSoapMessageDebugEnter();
312
313 0     instance = globus_malloc(sizeof(wst_AuthenticatorType));
314 0     if(!instance)
315     {
316 0         result = GlobusSoapMessageErrorOutOfMemory;
317 0         goto exit;
318     }
319
320 0     memset(instance, 0, sizeof(wst_AuthenticatorType));
321
322 0     *object = instance;
323
324  exit:
325 0     GlobusSoapMessageDebugExit();
326 0     return result;
327 }
328
329 void
330 wst_AuthenticatorType_destroy(
331     wst_AuthenticatorType * instance)
332 0 {
333 0     GlobusFuncName(wst_AuthenticatorType_destroy);
334 0     GlobusSoapMessageDebugEnter();
335
336 0     if(!instance)
337     {
338 0         goto exit;
339     }
340
341 0     wst_AuthenticatorType_destroy_contents(instance);
342 0     globus_free(instance);
343
344  exit:
345
346 0     GlobusSoapMessageDebugExit();
347 }
348
349 void
350 wst_AuthenticatorType_destroy_contents(
351     wst_AuthenticatorType * instance)
352 0 {
353 0     GlobusFuncName(wst_AuthenticatorType_destroy_contents);
354 0     GlobusSoapMessageDebugEnter();
355
356 0     if(instance)
357     {
358
359
360 0     xsd_base64Binary_destroy(instance->CombinedHash);
361 0     instance->CombinedHash = NULL;
362
363 0     xsd_any_array_destroy_contents(&instance->any);
364
365     }
366
367 0     GlobusSoapMessageDebugExit();
368 }
369
370 globus_result_t
371 wst_AuthenticatorType_copy(
372     wst_AuthenticatorType ** dest_obj,
373     const wst_AuthenticatorType * src_obj)
374 0 {
375 0     globus_result_t                     result = GLOBUS_SUCCESS;
376 0     wst_AuthenticatorType * instance;
377 0     GlobusFuncName(wst_AuthenticatorType_copy);
378
379 0     GlobusSoapMessageDebugEnter();
380
381 0     instance = malloc(sizeof(wst_AuthenticatorType));
382 0     if (instance == NULL)
383     {
384 0         GlobusSoapMessageDebugExit();
385 0         return GlobusSoapMessageErrorOutOfMemory;
386     }
387
388 0     result = wst_AuthenticatorType_copy_contents(instance, src_obj);
389 0     if(result != GLOBUS_SUCCESS)
390     {
391 0         globus_free(instance);
392 0         GlobusSoapMessageDebugExit();
393 0         return GlobusSoapMessageErrorOutOfMemory;
394     }
395
396 0     *dest_obj = instance;
397 0     GlobusSoapMessageDebugExit();
398 0     return result;
399 }
400
401 globus_result_t
402 wst_AuthenticatorType_copy_contents(
403     wst_AuthenticatorType * instance,
404     const wst_AuthenticatorType * src_obj)
405 0 {
406 0     globus_result_t                     result = GLOBUS_SUCCESS;
407 0     GlobusFuncName(wst_AuthenticatorType_copy_contents);
408
409 0     GlobusSoapMessageDebugEnter();
410
411
412 0     if(src_obj->CombinedHash)
413     {
414 0         result = xsd_base64Binary_copy(
415             &instance->CombinedHash,
416             src_obj->CombinedHash);
417 0         if(result != GLOBUS_SUCCESS)
418         {
419 0             result = GlobusSoapMessageErrorCopyFailed(
420                 result, NULL, &xsd_base64Binary_qname);
421 0             goto CombinedHash_destroy_pointer;
422         }
423     }
424     else
425     {
426 0         instance->CombinedHash = NULL;
427     }
428     
429 0      result = xsd_any_array_copy_contents(
430          &instance->any,
431          &src_obj->any);
432 0      if(result != GLOBUS_SUCCESS)
433      {
434 0          result = GlobusSoapMessageErrorCopyFailed(
435              result, NULL, &xsd_any_qname);
436          goto any_destroy_array;
437      }
438
439 0     goto exit;
440
441  fail_deserialize:
442 0         xsd_any_array_destroy_contents(
443             &instance->any);
444
445  any_destroy_array:
446 0         xsd_base64Binary_destroy(
447             instance->CombinedHash);
448 0          instance->CombinedHash = NULL;
449
450  CombinedHash_destroy_pointer:
451
452
453  exit:
454
455 0     GlobusSoapMessageDebugExit();
456 0     return result;
457 }
458
459
460
461 globus_result_t
462 wst_AuthenticatorType_serialize_contents(
463     xsd_QName *                         element_qname, /* ignored */
464     wst_AuthenticatorType * inst,
465     globus_soap_message_handle_t        message_handle,
466     globus_xsd_element_options_t        options)
467 0 {
468 0     globus_result_t                     result = GLOBUS_SUCCESS;
469 0     GlobusFuncName(wst_AuthenticatorType_serialize_contents);
470 0     GlobusSoapMessageDebugEnter();
471
472 0     result = wst_AuthenticatorType_serialize(
473         NULL,
474         inst,
475         message_handle,
476         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
477 0     if(result != GLOBUS_SUCCESS)
478     {
479 0         result = GlobusSoapMessageErrorSerializeFailed(
480             result, NULL, element_qname);
481         goto exit;
482     }
483
484  exit:
485
486 0     GlobusSoapMessageDebugExit();
487 0     return result;
488 }
489
490
491
492 globus_result_t
493 wst_AuthenticatorType_serialize(
494     xsd_QName *                         element_qname,
495     wst_AuthenticatorType * instance,
496     globus_soap_message_handle_t        message_handle,
497     globus_xsd_element_options_t        options)
498 0 {
499 0     globus_result_t                     result = GLOBUS_SUCCESS;
500 0     xsd_QName                           subelement;
501 0     globus_list_t *                     any_attr_keys = NULL;
502 0     globus_list_t *                     any_attr_keys_iterator = NULL;
503 0     xsd_QName *                         type_attr = NULL;
504 0     char *                              prefix = NULL;
505 0     int                                 prefix_created;
506 0     int                                 define_prefix = 0;
507 0     int                                 save_options = options;
508
509 0     GlobusFuncName(wst_AuthenticatorType_serialize);
510 0     GlobusSoapMessageDebugEnter();
511
512
513 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
514     {
515         /* serialize wst_AuthenticatorType element */
516
517 0         result = globus_soap_message_invoke_ns_callouts(
518             message_handle,
519             element_qname,
520             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_SET,
521             &options);
522 0         if(result != GLOBUS_SUCCESS)
523         {
524 0             result = GlobusSoapMessageErrorSerializeFailed(
525                 result, NULL, element_qname);
526 0             goto exit;
527         }
528
529 0 result = globus_soap_message_element_ns_set(
530             message_handle,
531             element_qname->Namespace,
532             &options);
533 0         if(result != GLOBUS_SUCCESS)
534         {
535 0             result = GlobusSoapMessageErrorSerializeFailed(
536                 result, NULL, element_qname);
537 0             goto exit;
538         }
539
540 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
541    !globus_soap_message_serialize_is_c14n_subset(message_handle))
542         {
543 0             result = globus_soap_message_attribute_ns_set(
544                 message_handle,
545                 "http://www.w3.org/2001/XMLSchema-instance",
546                 &options);
547 0             if(result != GLOBUS_SUCCESS)
548             {
549 0                 result = GlobusSoapMessageErrorSerializeFailed(
550                     result, NULL, element_qname);
551 0                 goto exit;
552             }
553
554 0             result = globus_soap_message_attribute_ns_set(
555                 message_handle,
556                 wst_AuthenticatorType_qname.Namespace,
557                 &options);
558 0             if(result != GLOBUS_SUCCESS)
559             {
560 0                 result = GlobusSoapMessageErrorSerializeFailed(
561                     result, NULL, element_qname);
562 0                 goto exit;
563             }
564         }
565
566 0         result = globus_soap_message_invoke_callouts(
567             message_handle,
568             element_qname,
569             GLOBUS_SOAP_MESSAGE_CALLOUT_BEGIN);
570 0         if(result != GLOBUS_SUCCESS)
571         {
572 0             result = GlobusSoapMessageErrorSerializeFailed(
573                 result, NULL, element_qname);
574 0             goto exit;
575         }
576
577 0         result = globus_soap_message_serialize_element(
578             message_handle,
579             element_qname,
580             options,
581             &wst_AuthenticatorType_qname);
582 0         if(result != GLOBUS_SUCCESS)
583         {
584 0             result = GlobusSoapMessageErrorSerializeFailed(
585                 result, NULL, element_qname);
586 0             goto exit;
587         }
588
589 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
590    !globus_soap_message_serialize_is_c14n_subset(message_handle))
591         {
592 0            xsd_QName_init(&type_attr);
593        
594 0            type_attr->local = globus_libc_strdup("type");
595 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
596         }
597
598         /* serialize namespaces */
599         
600 0 result = globus_soap_message_invoke_ns_callouts(
601             message_handle,
602             element_qname,
603             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_ADD,
604             &options);
605 0         if(result != GLOBUS_SUCCESS)
606         {
607 0             result = GlobusSoapMessageErrorSerializeFailed(
608                 result, NULL, element_qname);
609 0             goto exit;
610         }
611
612 0 result = globus_soap_message_element_ns_add(
613             message_handle,
614             element_qname->Namespace,
615             &options);
616 0         if(result != GLOBUS_SUCCESS)
617         {
618 0             result = GlobusSoapMessageErrorSerializeFailed(
619                 result, NULL, element_qname);
620 0             goto exit;
621         }
622
623 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
624    !globus_soap_message_serialize_is_c14n_subset(message_handle))
625         {
626 0             result = globus_soap_message_attribute_ns_add(
627                 message_handle,
628                 "http://www.w3.org/2001/XMLSchema-instance",
629                 &options);
630 0             if(result != GLOBUS_SUCCESS)
631             {
632 0                 result = GlobusSoapMessageErrorSerializeFailed(
633                     result, NULL, element_qname);
634 0                 goto exit;
635             }
636
637 0             result = globus_soap_message_attribute_ns_add(
638                 message_handle,
639                 wst_AuthenticatorType_qname.Namespace,
640                 &options);
641 0             if(result != GLOBUS_SUCCESS)
642             {
643 0                 result = GlobusSoapMessageErrorSerializeFailed(
644                     result, NULL, element_qname);
645 0                 goto exit;
646             }
647         }
648
649         /* serialize attributes */
650
651 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
652    !globus_soap_message_serialize_is_c14n_subset(message_handle))
653         {
654 0             result = globus_soap_message_serialize_QName_attribute(
655                 message_handle,
656                 type_attr,
657                 &wst_AuthenticatorType_qname);
658 0             if(result != GLOBUS_SUCCESS)
659             {
660 0                 result = GlobusSoapMessageErrorSerializeFailed(
661                     result, NULL, element_qname);
662 0                 goto exit;
663             }
664         }
665
666
667 0         result = globus_soap_message_invoke_callouts(
668             message_handle,
669             element_qname,
670             GLOBUS_SOAP_MESSAGE_CALLOUT_ATTR);
671 0         if(result != GLOBUS_SUCCESS)
672         {
673 0             result = GlobusSoapMessageErrorSerializeFailed(
674                 result, NULL, element_qname);
675 0             goto exit;
676         }
677     }
678
679 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
680     {
681 0         result = globus_soap_message_serialize_element_begin_close(
682             message_handle);
683 0         if(result != GLOBUS_SUCCESS)
684         {
685 0             result = GlobusSoapMessageErrorSerializeFailed(
686                 result, NULL, element_qname);
687 0             goto exit;
688         }
689     }
690 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
691
692     /* serialize contents of type */
693
694 0     subelement.local = "CombinedHash";
695 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2004/04/trust";
696
697 0     if(instance->CombinedHash)
698     {
699 0         result = xsd_base64Binary_serialize(
700             &subelement,
701             instance->CombinedHash,
702             message_handle,
703             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
704 0         if(result != GLOBUS_SUCCESS)
705         {
706 0             result = GlobusSoapMessageErrorSerializeFailed(
707                 result, NULL, &xsd_base64Binary_qname);
708 0             goto exit;
709         }
710     }
711
712 0     subelement.local = "any";
713 0     subelement.Namespace = "http://www.w3.org/2001/XMLSchema";
714     
715 0      result = xsd_any_array_serialize(
716          &subelement,
717          &instance->any,
718          message_handle,
719          options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
720 0      if(result != GLOBUS_SUCCESS)
721      {
722 0          result = GlobusSoapMessageErrorSerializeFailed(
723              result, NULL, &xsd_any_qname);
724 0          goto exit;
725      }
726
727 0     options = save_options;
728
729 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
730     {
731         /* add end element */
732 0         result = globus_soap_message_serialize_element_end(
733             message_handle,
734             element_qname,
735             options,
736             &wst_AuthenticatorType_qname);
737 0         if(result != GLOBUS_SUCCESS)
738         {
739 0             result = GlobusSoapMessageErrorSerializeFailed(
740                 result, NULL, element_qname);
741 0             goto exit;
742         }
743
744 0         globus_soap_message_element_ns_remove(
745             message_handle,
746             element_qname->Namespace,
747             &options);
748
749     /* remove namespace/prefix mappings for these types */
750
751 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
752    !globus_soap_message_serialize_is_c14n_subset(message_handle))
753         {
754 0             globus_soap_message_attribute_ns_remove(
755                 message_handle,
756                 "http://www.w3.org/2001/XMLSchema-instance",
757                 &options);
758            
759 0             globus_soap_message_attribute_ns_remove(
760                 message_handle,
761                 wst_AuthenticatorType_qname.Namespace,
762                 &options);
763         }           
764
765 0         result = globus_soap_message_invoke_ns_callouts(
766             message_handle,
767             element_qname,
768             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_REMOVE,
769             &options);
770 0         if(result != GLOBUS_SUCCESS)
771         {
772 0             result  = GlobusSoapMessageErrorSerializeFailed(
773                 result, NULL, element_qname);
774 0             goto exit;
775         }
776
777 0         result = globus_soap_message_invoke_callouts(
778             message_handle,
779             element_qname,
780             GLOBUS_SOAP_MESSAGE_CALLOUT_END);
781 0         if(result != GLOBUS_SUCCESS)
782         {
783 0             result = GlobusSoapMessageErrorSerializeFailed(
784                 result, NULL, element_qname);
785             goto exit;
786         }
787     }
788
789  exit:
790 0     if (type_attr)
791     {
792 0         xsd_QName_destroy(type_attr);
793     }
794
795 0     if(any_attr_keys)
796     {
797 0         globus_list_free(any_attr_keys);
798     }
799
800 0     GlobusSoapMessageDebugExit();
801 0     return result;
802 }
803
804
805
806 globus_result_t
807 wst_AuthenticatorType_deserialize_contents(
808     xsd_QName *                         element_qname, /* ignored */
809     wst_AuthenticatorType * inst,
810     globus_soap_message_handle_t        message_handle,
811     globus_xsd_element_options_t        options)
812 0 {
813 0     globus_result_t                     result = GLOBUS_SUCCESS;
814 0     GlobusFuncName(wst_AuthenticatorType_deserialize_contents);
815 0     GlobusSoapMessageDebugEnter();
816
817 0     result = wst_AuthenticatorType_deserialize(
818         NULL,
819         inst,
820         message_handle,
821         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
822 0     if(result != GLOBUS_SUCCESS)
823     {
824 0         result = GlobusSoapMessageErrorDeserializeFailed(
825             result, element_qname);
826         goto exit;
827     }
828
829  exit:
830
831 0     GlobusSoapMessageDebugExit();
832 0     return result;
833 }
834
835
836
837 globus_result_t
838 wst_AuthenticatorType_deserialize(
839     xsd_QName *                         element_qname,
840     wst_AuthenticatorType * instance,
841     globus_soap_message_handle_t        message_handle,
842     globus_xsd_element_options_t        options)
843 0 {
844 0     globus_result_t                     result = GLOBUS_SUCCESS;
845 0     xsd_QName                           subelement;
846 0     GlobusFuncName(wst_AuthenticatorType_deserialize);
847 0     GlobusSoapMessageDebugEnter();
848
849
850 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
851     {
852 0         result = globus_soap_message_deserialize_element(
853             message_handle, element_qname);
854 0         if(result != GLOBUS_SUCCESS)
855         {
856 0             result = GlobusSoapMessageErrorDeserializeFailed(
857                 result, element_qname);
858 0             goto exit;
859         }
860
861
862 0         result = globus_soap_message_deserialize_element_begin_close(
863             message_handle);
864 0         if(result != GLOBUS_SUCCESS)
865         {
866 0             result = GlobusSoapMessageErrorDeserializeFailed(
867                 result, element_qname);
868 0             goto fail_deserialize;
869         }
870     }
871
872 0     subelement.local = "CombinedHash";
873 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2004/04/trust";
874
875 0     result = xsd_base64Binary_deserialize_pointer(
876         &subelement,
877         &instance->CombinedHash,
878         message_handle,
879         0);
880 0     if(result != GLOBUS_SUCCESS)
881     {
882 0         result = GlobusSoapMessageErrorDeserializeFailed(
883             result, 
884             (&subelement));
885 0         goto CombinedHash_destroy_pointer;
886     }
887
888 0     subelement.local = "any";
889 0     subelement.Namespace = "http://www.w3.org/2001/XMLSchema";
890     
891 0     result = xsd_any_array_deserialize(
892         &subelement,
893         &instance->any,
894         message_handle,
895         0);
896 0     if(result != GLOBUS_SUCCESS)
897     {
898 0         result = GlobusSoapMessageErrorDeserializeFailed(
899             result, 
900             (&subelement));
901 0         goto any_destroy_array;
902     }
903
904 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
905     {
906 0         result = globus_soap_message_deserialize_element_end(
907             message_handle,
908             element_qname);
909 0         if(result != GLOBUS_SUCCESS)
910         {
911 0             result = GlobusSoapMessageErrorDeserializeFailed(
912                 result, element_qname);
913             goto fail_deserialize;
914         }
915     }
916
917 0     goto exit;
918
919  fail_deserialize:
920 0         xsd_any_array_destroy_contents(
921             &instance->any);
922
923  any_destroy_array:
924 0         xsd_base64Binary_destroy(
925             instance->CombinedHash);
926 0          instance->CombinedHash = NULL;
927
928  CombinedHash_destroy_pointer:
929
930
931  exit:
932
933 0     GlobusSoapMessageDebugExit();
934 0     return result;
935 }
936
937
938
939 globus_result_t
940 wst_AuthenticatorType_deserialize_pointer(
941     xsd_QName *                         element_qname,
942     wst_AuthenticatorType ** ip,
943     globus_soap_message_handle_t        message_handle,
944     globus_xsd_element_options_t        options)
945 0 {
946 0     wst_AuthenticatorType * instance = NULL;
947 0     globus_result_t                     result = GLOBUS_SUCCESS;
948 0     xsd_QName                           subelement;
949 0     int                                 found_attrs = 0;
950 0     int                                 empty_element = 0;
951 0     GlobusFuncName(wst_AuthenticatorType_deserialize_pointer);
952 0     GlobusSoapMessageDebugEnter();
953
954 0     *ip = NULL;
955
956 0     result = globus_soap_message_deserialize_element(
957         message_handle, element_qname);
958 0     if(result != GLOBUS_SUCCESS &&
959        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
960         GlobusSoapMessageStatusFailedElementCheck(result) ||
961         GlobusSoapMessageStatusFailedWithTextCheck(result)))
962     {
963 0         *ip = NULL;
964 0         result = GLOBUS_SUCCESS;
965 0         goto exit;
966     }
967
968 0     if(result != GLOBUS_SUCCESS)
969     {
970 0         result = GlobusSoapMessageErrorDeserializeFailed(
971             result, element_qname);
972 0         goto exit;
973     }
974
975 0     if(globus_soap_message_deserialize_element_is_empty(
976            message_handle))
977     {
978 0         empty_element = 1;
979     }
980
981
982
983 0     result = wst_AuthenticatorType_init(&instance);
984 0     if(result != GLOBUS_SUCCESS)
985     {
986 0         result = GlobusSoapMessageErrorDeserializeFailed(
987             result, element_qname);
988 0         goto exit;
989     }
990
991
992 0     if(found_attrs == 0 && 
993        globus_soap_message_deserialize_element_is_nil(message_handle))
994     {
995 0         wst_AuthenticatorType_destroy(instance);
996         
997 0         result = globus_soap_message_deserialize_element_end(
998                 message_handle,
999                 element_qname);
1000 0         if(result != GLOBUS_SUCCESS)
1001         {
1002 0             result = GlobusSoapMessageErrorDeserializeFailed(
1003                 result, element_qname);
1004 0             goto exit;
1005         }
1006
1007 0         *ip = NULL;
1008 0         globus_object_free(globus_error_get(result));
1009 0         result = GLOBUS_SUCCESS;
1010 0         goto exit;
1011     }
1012
1013
1014 0     if(empty_element)
1015     {
1016 0         result = globus_soap_message_deserialize_element_end(
1017             message_handle,
1018             element_qname);
1019 0         if(result != GLOBUS_SUCCESS)
1020         {
1021 0             result = GlobusSoapMessageErrorDeserializeFailed(
1022                 result, element_qname);
1023 0             goto fail_deserialize;
1024         }
1025
1026 0         *ip = instance;
1027 0         goto exit;
1028     }
1029
1030 0     result = globus_soap_message_deserialize_element_begin_close(
1031         message_handle);
1032 0     if(result != GLOBUS_SUCCESS)
1033     {
1034 0         result = GlobusSoapMessageErrorDeserializeFailed(
1035             result, element_qname);
1036 0         goto exit;
1037     }
1038
1039
1040 0     subelement.local = "CombinedHash";
1041 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2004/04/trust";
1042
1043 0     result = xsd_base64Binary_deserialize_pointer(
1044         &subelement,
1045         &instance->CombinedHash,
1046         message_handle,
1047         0);
1048 0     if(result != GLOBUS_SUCCESS)
1049     {
1050 0         result = GlobusSoapMessageErrorDeserializeFailed(
1051             result, 
1052             (&subelement));
1053 0         goto CombinedHash_destroy_pointer;
1054     }
1055
1056 0     subelement.local = "any";
1057 0     subelement.Namespace = "http://www.w3.org/2001/XMLSchema";
1058     
1059 0     result = xsd_any_array_deserialize(
1060         &subelement,
1061         &instance->any,
1062         message_handle,
1063         0);
1064 0     if(result != GLOBUS_SUCCESS)
1065     {
1066 0         result = GlobusSoapMessageErrorDeserializeFailed(
1067             result, 
1068             (&subelement));
1069 0         goto any_destroy_array;
1070     }
1071
1072
1073 0     result = globus_soap_message_deserialize_element_end(
1074         message_handle,
1075         element_qname);
1076 0     if(result != GLOBUS_SUCCESS)
1077     {
1078 0         result = GlobusSoapMessageErrorDeserializeFailed(
1079             result, element_qname);
1080 0         goto fail_deserialize;
1081     }
1082
1083 0     *ip = instance;
1084
1085 0     goto exit;
1086
1087  fail_deserialize:
1088 0         xsd_any_array_destroy_contents(
1089             &instance->any);
1090
1091  any_destroy_array:
1092 0         xsd_base64Binary_destroy(
1093             instance->CombinedHash);
1094 0          instance->CombinedHash = NULL;
1095
1096  CombinedHash_destroy_pointer:
1097
1098  exit:
1099
1100 0     GlobusSoapMessageDebugExit();
1101 0     return result;
1102 }
1103
1104
1105 globus_result_t
1106 wst_AuthenticatorType_array_init_contents(
1107     wst_AuthenticatorType_array * array)
1108 0 {
1109 0     GlobusFuncName(wst_AuthenticatorType_array_init_contents);
1110 0     GlobusSoapMessageDebugEnter();
1111
1112 0     memset(array, 0, sizeof(wst_AuthenticatorType_array));
1113
1114 0     GlobusSoapMessageDebugExit();
1115 0     return GLOBUS_SUCCESS;
1116 }
1117
1118 globus_result_t
1119 wst_AuthenticatorType_array_init(
1120     wst_AuthenticatorType_array ** arr)
1121 0 {
1122 0     wst_AuthenticatorType_array * array;
1123 0     globus_result_t                     result;
1124 0     GlobusFuncName(wst_AuthenticatorType_array_init);
1125 0     GlobusSoapMessageDebugEnter();
1126
1127 0     array = (wst_AuthenticatorType_array *)
1128         globus_malloc(sizeof(wst_AuthenticatorType_array));
1129 0     if(!array)
1130     {
1131 0         result = GlobusSoapMessageErrorOutOfMemory;
1132 0         goto exit;
1133     }
1134
1135 0     result = wst_AuthenticatorType_array_init_contents(array);
1136 0     if(result != GLOBUS_SUCCESS)
1137     {
1138 0         globus_free(array);
1139 0         array = NULL;
1140
1141     }
1142
1143 0     *arr = array;
1144
1145  exit:
1146 0     GlobusSoapMessageDebugExit();
1147 0     return result;
1148 }
1149
1150 void
1151 wst_AuthenticatorType_array_destroy_contents(
1152     wst_AuthenticatorType_array * array)
1153 0 {
1154 0     int                                 i = 0;
1155 0     GlobusFuncName(wst_AuthenticatorType_array_destroy_contents);
1156 0     GlobusSoapMessageDebugEnter();
1157
1158 0     for(; i < array->length; ++i)
1159     {
1160 0         wst_AuthenticatorType_destroy_contents(&array->elements[i]);
1161     }
1162
1163 0     if(array->elements)
1164     {
1165 0         globus_free(array->elements);
1166 0         array->elements = NULL;
1167     }
1168 0     array->length = 0;
1169
1170 0     GlobusSoapMessageDebugExit();
1171 }
1172
1173 void
1174 wst_AuthenticatorType_array_destroy(
1175     wst_AuthenticatorType_array * array)
1176 0 {
1177 0     GlobusFuncName(wst_AuthenticatorType_array_destroy);
1178 0     GlobusSoapMessageDebugEnter();
1179
1180 0     wst_AuthenticatorType_array_destroy_contents(array);
1181 0     globus_free(array);
1182
1183 0     GlobusSoapMessageDebugExit();
1184 }
1185
1186 globus_result_t
1187 wst_AuthenticatorType_array_copy(
1188     wst_AuthenticatorType_array ** dest_arr,
1189     const wst_AuthenticatorType_array * src_arr)
1190 0 {
1191 0     wst_AuthenticatorType_array * array;
1192 0     globus_result_t                     result;
1193 0     GlobusFuncName(wst_AuthenticatorType_array_copy);
1194 0     GlobusSoapMessageDebugEnter();
1195
1196 0     array = (wst_AuthenticatorType_array *) globus_malloc(
1197         sizeof(wst_AuthenticatorType_array));
1198 0     if(!array)
1199     {
1200 0         result = GlobusSoapMessageErrorOutOfMemory;
1201 0         GlobusSoapMessageDebugExit();
1202 0         return result;
1203     }
1204
1205 0     result = wst_AuthenticatorType_array_copy_contents(array, src_arr);
1206 0     if(result != GLOBUS_SUCCESS)
1207     {
1208 0         globus_free(array);
1209 0         GlobusSoapMessageDebugExit();
1210 0         return result;
1211     }
1212
1213 0     *dest_arr = array;
1214
1215 0     GlobusSoapMessageDebugExit();
1216 0     return GLOBUS_SUCCESS;
1217 }
1218
1219 globus_result_t
1220 wst_AuthenticatorType_array_copy_contents(
1221     wst_AuthenticatorType_array * dest_arr,
1222     const wst_AuthenticatorType_array * src_arr)
1223 0 {
1224 0     int                                 i;
1225 0     globus_result_t                     result = GLOBUS_SUCCESS;
1226 0     GlobusFuncName(wst_AuthenticatorType_array_copy_contents);
1227 0     GlobusSoapMessageDebugEnter();
1228
1229 0     dest_arr->length = src_arr->length;
1230 0     if(dest_arr->length > 0)
1231     {
1232 0         dest_arr->elements = (wst_AuthenticatorType *) malloc(
1233             sizeof(wst_AuthenticatorType) * dest_arr->length);
1234 0         if(!dest_arr->elements)
1235         {
1236 0             result = GlobusSoapMessageErrorOutOfMemory;
1237 0             GlobusSoapMessageDebugExit();
1238 0             return result;
1239         }
1240     }
1241     else
1242     {
1243 0         dest_arr->elements = NULL;
1244     }
1245     
1246 0     for(i = 0; i < dest_arr->length; i++)
1247     {
1248 0         result = wst_AuthenticatorType_copy_contents(
1249             &dest_arr->elements[i], &src_arr->elements[i]);
1250 0         if(result != GLOBUS_SUCCESS)
1251         {
1252 0             while(i--)
1253             {
1254 0                 wst_AuthenticatorType_destroy_contents(&dest_arr->elements[i]);
1255             }
1256
1257 0             globus_free(dest_arr->elements);
1258 0             dest_arr->elements = NULL;
1259 0             dest_arr->length = 0;
1260 0             break;
1261         }
1262     }
1263
1264 0     GlobusSoapMessageDebugExit();
1265 0     return result;
1266 }
1267
1268 wst_AuthenticatorType *
1269 wst_AuthenticatorType_array_push(
1270     wst_AuthenticatorType_array * array)
1271 0 {
1272 0     GlobusFuncName(wst_AuthenticatorType_array_push);
1273 0     GlobusSoapMessageDebugEnter();
1274
1275 0     array->elements = realloc(array->elements,
1276                               sizeof(wst_AuthenticatorType) *
1277                               (array->length + 1));
1278 0     memset(&array->elements[array->length], 0, sizeof(wst_AuthenticatorType));
1279 0     array->length++;
1280
1281 0     GlobusSoapMessageDebugExit();
1282 0     return (&array->elements[array->length - 1]);
1283 }
1284
1285 void *
1286 wst_AuthenticatorType_array_push_wrapper(
1287     void * array)
1288 0 {
1289 0     return (void *) wst_AuthenticatorType_array_push((wst_AuthenticatorType_array *) array);
1290 }
1291
1292 globus_result_t
1293 wst_AuthenticatorType_array_serialize(
1294     xsd_QName *                         element_qname,
1295     wst_AuthenticatorType_array * array,
1296     globus_soap_message_handle_t        message,
1297     globus_xsd_element_options_t        options)
1298 0 {
1299 0     globus_result_t                     result = GLOBUS_SUCCESS;
1300 0     int                                 i = 0;
1301 0     GlobusFuncName(wst_AuthenticatorType_array_serialize);
1302 0     GlobusSoapMessageDebugEnter();
1303
1304 0     for(; i < array->length; ++i)
1305     {
1306 0         result = wst_AuthenticatorType_serialize(
1307             element_qname,
1308             &array->elements[i],
1309             message,
1310             options);
1311 0         if(result != GLOBUS_SUCCESS)
1312         {
1313 0             goto exit;
1314         }
1315     }
1316
1317 exit:
1318
1319 0     GlobusSoapMessageDebugExit();
1320 0     return result;
1321 }
1322
1323 globus_result_t
1324 wst_AuthenticatorType_array_deserialize(
1325     xsd_QName *                         element_qname,
1326     wst_AuthenticatorType_array * array,
1327     globus_soap_message_handle_t        message,
1328     globus_xsd_element_options_t        options)
1329 0 {
1330 0     globus_result_t                     result = GLOBUS_SUCCESS;
1331 0     int                                 i = 0;
1332 0     int                                 pre_length;
1333 0     GlobusFuncName(wst_AuthenticatorType_array_deserialize);
1334 0     GlobusSoapMessageDebugEnter();
1335
1336 0     pre_length = array->length;
1337
1338 0     for(i = 0; i < pre_length; ++i)
1339     {
1340 0         result = wst_AuthenticatorType_deserialize(
1341             element_qname,
1342             &array->elements[i],
1343             message,
1344             options);
1345 0         if(result != GLOBUS_SUCCESS)
1346         {
1347 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1348                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1349                GlobusSoapMessageStatusFailedWithTextCheck(result))
1350             {
1351 0                 result = GLOBUS_SUCCESS;
1352 0                 break;
1353             }
1354
1355 0             result = GlobusSoapMessageErrorDeserializeFailed(
1356                 result, element_qname);
1357 0             goto exit;
1358         }
1359     }
1360
1361 0     while(result == GLOBUS_SUCCESS)
1362     {
1363 0         wst_AuthenticatorType                  next;
1364 0         memset(&next, 0, sizeof(wst_AuthenticatorType));
1365
1366 0         result = wst_AuthenticatorType_deserialize(
1367             element_qname,
1368             &next,
1369             message,
1370             options);
1371 0         if(result != GLOBUS_SUCCESS)
1372         {
1373 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1374                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1375                GlobusSoapMessageStatusFailedWithTextCheck(result))
1376             {
1377 0                 result = GLOBUS_SUCCESS;
1378 0                 break;
1379             }
1380
1381 0             result = GlobusSoapMessageErrorDeserializeFailed(
1382                 result, element_qname);
1383 0             goto exit;
1384         }
1385
1386 0         array->elements = realloc(
1387             array->elements,
1388             (array->length + 1) * sizeof(wst_AuthenticatorType));
1389 0         if(!array->elements)
1390         {
1391 0             result = GlobusSoapMessageErrorOutOfMemory;
1392 0             goto exit;
1393         }
1394 0         array->elements[array->length] = next;
1395 0         array->length++;
1396 0         ++i;
1397     }
1398
1399   exit:
1400
1401 0     if(result != GLOBUS_SUCCESS)
1402     {
1403 0         int                             di = 0;
1404 0         for(; di < i; ++di)
1405         {
1406 0             wst_AuthenticatorType_destroy_contents(
1407                 &array->elements[di]);
1408 0             memset(&array->elements[di], 0, sizeof(wst_AuthenticatorType));
1409         }
1410     }
1411
1412 0     GlobusSoapMessageDebugExit();
1413 0     return result;