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