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 "wsse_KeyIdentifierType.h"
21
22 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
23 xsd_QName wsse_KeyIdentifierType_qname =
24 {
25     WSSE_KEYIDENTIFIERTYPE_NS,
26     WSSE_KEYIDENTIFIERTYPE_LOCAL
27 };
28 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
29
30 globus_result_t
31 wsse_KeyIdentifierType_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 wsse_KeyIdentifierType_serialize(
38         element_qname,
39         (wsse_KeyIdentifierType *) instance,
40         message_handle, options);
41 }
42
43 globus_result_t
44 wsse_KeyIdentifierType_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 wsse_KeyIdentifierType_deserialize_pointer(
51         element_qname,
52         (wsse_KeyIdentifierType **) ip,
53         message_handle, options);
54 }
55
56 globus_result_t
57 wsse_KeyIdentifierType_init_wrapper(void **object)
58 0 {
59 0     return wsse_KeyIdentifierType_init(
60         (wsse_KeyIdentifierType **) object);
61 }
62
63 void
64 wsse_KeyIdentifierType_destroy_wrapper(
65     void *                          object)
66 0 {
67 0     wsse_KeyIdentifierType_destroy(
68         (wsse_KeyIdentifierType *) object);
69 }
70
71 globus_result_t
72 wsse_KeyIdentifierType_copy_wrapper(
73     void **                         dest_obj,
74     void *                          src_obj)
75 0 {
76 0     return wsse_KeyIdentifierType_copy(
77         (wsse_KeyIdentifierType **) dest_obj,
78         (wsse_KeyIdentifierType *) src_obj);
79 }
80
81 globus_result_t
82 wsse_KeyIdentifierType_init_contents_wrapper(void *object)
83 0 {
84 0     return wsse_KeyIdentifierType_init_contents(
85         (wsse_KeyIdentifierType *) object);
86 }
87
88 void
89 wsse_KeyIdentifierType_destroy_contents_wrapper(
90     void *                          object)
91 0 {
92 0     wsse_KeyIdentifierType_destroy_contents(
93         (wsse_KeyIdentifierType *) object);
94 }
95
96 globus_result_t
97 wsse_KeyIdentifierType_copy_contents_wrapper(
98     void *                          dest_obj,
99     void *                          src_obj)
100 0 {
101 0     return wsse_KeyIdentifierType_copy_contents(
102         (wsse_KeyIdentifierType *) dest_obj,
103         (wsse_KeyIdentifierType *) src_obj);
104 }
105
106 globus_result_t
107 wsse_KeyIdentifierType_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 wsse_KeyIdentifierType_serialize_contents(
114         element_qname,
115         (wsse_KeyIdentifierType *) instance,
116         message_handle, options);
117 }
118
119 globus_result_t
120 wsse_KeyIdentifierType_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(wsse_KeyIdentifierType_deserialize_contents_wrapper);
128 0     GlobusSoapMessageDebugEnter();
129
130 0     if(!*instance)
131     {
132 0         result = wsse_KeyIdentifierType_init(
133             (wsse_KeyIdentifierType **)instance);
134 0         if(result != GLOBUS_SUCCESS)
135         {
136 0             goto error;
137         }
138     }
139
140 0     result = wsse_KeyIdentifierType_deserialize_contents(
141         element_qname,
142         *(wsse_KeyIdentifierType **)instance,
143         message_handle, options);
144 error:
145 0     GlobusSoapMessageDebugExit();
146 0     return result;
147 }
148
149 globus_result_t
150 wsse_KeyIdentifierType_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 wsse_KeyIdentifierType_array_serialize(
157         element,
158         (wsse_KeyIdentifierType_array *) instance,
159         message, options);
160 }
161
162 globus_result_t
163 wsse_KeyIdentifierType_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 = wsse_KeyIdentifierType_array_init(
174             (wsse_KeyIdentifierType_array **)inst);
175 0         if(result != GLOBUS_SUCCESS)
176         {
177 0             return result;
178         }
179     }
180
181 0     return wsse_KeyIdentifierType_array_deserialize(
182         element_qname,
183         *(wsse_KeyIdentifierType_array **) inst,
184         message, options);
185 }
186
187 globus_result_t
188 wsse_KeyIdentifierType_array_init_wrapper(
189     void **                             arr)
190 0 {
191 0     return wsse_KeyIdentifierType_array_init(
192         (wsse_KeyIdentifierType_array **) arr);
193 }
194
195 void
196 wsse_KeyIdentifierType_array_destroy_wrapper(
197     void *                              arr)
198 0 {
199 0     wsse_KeyIdentifierType_array_destroy(
200         (wsse_KeyIdentifierType_array *) arr);
201 }
202
203 globus_result_t
204 wsse_KeyIdentifierType_array_copy_wrapper(
205     void **                             dest_arr,
206     void *                              src_arr)
207 0 {
208 0     return wsse_KeyIdentifierType_array_copy(
209         (wsse_KeyIdentifierType_array **) dest_arr,
210         (wsse_KeyIdentifierType_array *) src_arr);
211 }
212
213 globus_result_t
214 wsse_KeyIdentifierType_array_init_contents_wrapper(
215     void *                              arr)
216 0 {
217 0     return wsse_KeyIdentifierType_array_init_contents(
218         (wsse_KeyIdentifierType_array *) arr);
219 }
220
221 void
222 wsse_KeyIdentifierType_array_destroy_contents_wrapper(
223     void *                              arr)
224 0 {
225 0     wsse_KeyIdentifierType_array_destroy_contents(
226         (wsse_KeyIdentifierType_array *) arr);
227 }
228
229 globus_result_t
230 wsse_KeyIdentifierType_array_copy_contents_wrapper(
231     void *                              dest_arr,
232     void *                              src_arr)
233 0 {
234 0     return wsse_KeyIdentifierType_array_copy_contents(
235         (wsse_KeyIdentifierType_array *) dest_arr,
236         (wsse_KeyIdentifierType_array *) src_arr);
237 }
238
239 struct globus_xsd_type_info_s wsse_KeyIdentifierType_contents_info =
240 {
241     &wsse_KeyIdentifierType_qname,
242     wsse_KeyIdentifierType_serialize_contents_wrapper,
243     wsse_KeyIdentifierType_deserialize_contents_wrapper,
244     wsse_KeyIdentifierType_init_wrapper,
245     wsse_KeyIdentifierType_destroy_wrapper,
246     wsse_KeyIdentifierType_copy_wrapper,
247     wsse_KeyIdentifierType_init_contents_wrapper,
248     wsse_KeyIdentifierType_destroy_contents_wrapper,
249     wsse_KeyIdentifierType_copy_contents_wrapper,
250     sizeof(wsse_KeyIdentifierType),
251     NULL,
252     NULL,
253     NULL
254 };
255
256 struct globus_xsd_type_info_s wsse_KeyIdentifierType_array_info =
257 {
258     &wsse_KeyIdentifierType_qname,
259     wsse_KeyIdentifierType_array_serialize_wrapper,
260     wsse_KeyIdentifierType_array_deserialize_wrapper,
261     wsse_KeyIdentifierType_array_init_wrapper,
262     wsse_KeyIdentifierType_array_destroy_wrapper,
263     wsse_KeyIdentifierType_array_copy_wrapper,
264     wsse_KeyIdentifierType_array_init_contents_wrapper,
265     wsse_KeyIdentifierType_array_destroy_contents_wrapper,
266     wsse_KeyIdentifierType_array_copy_contents_wrapper,
267     sizeof(wsse_KeyIdentifierType),
268     wsse_KeyIdentifierType_array_push_wrapper,
269     NULL,
270     NULL
271 };
272
273 struct globus_xsd_type_info_s wsse_KeyIdentifierType_info =
274 {
275     &wsse_KeyIdentifierType_qname,
276     wsse_KeyIdentifierType_serialize_wrapper,
277     wsse_KeyIdentifierType_deserialize_pointer_wrapper,
278     wsse_KeyIdentifierType_init_wrapper,
279     wsse_KeyIdentifierType_destroy_wrapper,
280     wsse_KeyIdentifierType_copy_wrapper,
281     wsse_KeyIdentifierType_init_contents_wrapper,
282     wsse_KeyIdentifierType_destroy_contents_wrapper,
283     wsse_KeyIdentifierType_copy_contents_wrapper,
284     sizeof(wsse_KeyIdentifierType),
285     NULL,
286     &wsse_KeyIdentifierType_contents_info,
287     &wsse_KeyIdentifierType_array_info
288 };
289
290 globus_result_t
291 wsse_KeyIdentifierType_init_contents(
292     wsse_KeyIdentifierType * instance)
293 0 {
294 0     globus_result_t                     result = GLOBUS_SUCCESS;
295 0     GlobusFuncName(wsse_KeyIdentifierType_init_contents);
296 0     GlobusSoapMessageDebugEnter();
297
298 0     memset(instance, 0, sizeof(wsse_KeyIdentifierType));
299
300 0     GlobusSoapMessageDebugExit();
301 0     return result;
302 }
303
304 globus_result_t
305 wsse_KeyIdentifierType_init(
306     wsse_KeyIdentifierType ** object)
307 0 {
308 0     wsse_KeyIdentifierType * instance;
309 0     globus_result_t                     result = GLOBUS_SUCCESS;
310 0     GlobusFuncName(wsse_KeyIdentifierType_init);
311 0     GlobusSoapMessageDebugEnter();
312
313 0     instance = globus_malloc(sizeof(wsse_KeyIdentifierType));
314 0     if(!instance)
315     {
316 0         result = GlobusSoapMessageErrorOutOfMemory;
317 0         goto exit;
318     }
319
320 0     memset(instance, 0, sizeof(wsse_KeyIdentifierType));
321
322 0     *object = instance;
323
324  exit:
325 0     GlobusSoapMessageDebugExit();
326 0     return result;
327 }
328
329 void
330 wsse_KeyIdentifierType_destroy(
331     wsse_KeyIdentifierType * instance)
332 0 {
333 0     GlobusFuncName(wsse_KeyIdentifierType_destroy);
334 0     GlobusSoapMessageDebugEnter();
335
336 0     if(!instance)
337     {
338 0         goto exit;
339     }
340
341 0     wsse_KeyIdentifierType_destroy_contents(instance);
342 0     globus_free(instance);
343
344  exit:
345
346 0     GlobusSoapMessageDebugExit();
347 }
348
349 void
350 wsse_KeyIdentifierType_destroy_contents(
351     wsse_KeyIdentifierType * instance)
352 0 {
353 0     GlobusFuncName(wsse_KeyIdentifierType_destroy_contents);
354 0     GlobusSoapMessageDebugEnter();
355
356 0     if(instance)
357     {
358
359
360 0     xsd_string_destroy_contents(
361          &instance->base_value);
362
363 0         xsd_anyAttributes_destroy(instance->anyAttributes);
364 0         instance->anyAttributes = NULL;
365
366 0     if(instance->_Id)
367     {
368 0         xsd_ID_destroy(
369             instance->_Id);
370 0         instance->_Id = NULL;
371     }
372
373 0     if(instance->_EncodingType)
374     {
375 0         xsd_anyURI_destroy(
376             instance->_EncodingType);
377 0         instance->_EncodingType = NULL;
378     }
379
380 0     if(instance->_ValueType)
381     {
382 0         xsd_anyURI_destroy(
383             instance->_ValueType);
384 0         instance->_ValueType = NULL;
385     }
386
387     }
388
389 0     GlobusSoapMessageDebugExit();
390 }
391
392 globus_result_t
393 wsse_KeyIdentifierType_copy(
394     wsse_KeyIdentifierType ** dest_obj,
395     const wsse_KeyIdentifierType * src_obj)
396 0 {
397 0     globus_result_t                     result = GLOBUS_SUCCESS;
398 0     wsse_KeyIdentifierType * instance;
399 0     GlobusFuncName(wsse_KeyIdentifierType_copy);
400
401 0     GlobusSoapMessageDebugEnter();
402
403 0     instance = malloc(sizeof(wsse_KeyIdentifierType));
404 0     if (instance == NULL)
405     {
406 0         GlobusSoapMessageDebugExit();
407 0         return GlobusSoapMessageErrorOutOfMemory;
408     }
409
410 0     result = wsse_KeyIdentifierType_copy_contents(instance, src_obj);
411 0     if(result != GLOBUS_SUCCESS)
412     {
413 0         globus_free(instance);
414 0         GlobusSoapMessageDebugExit();
415 0         return GlobusSoapMessageErrorOutOfMemory;
416     }
417
418 0     *dest_obj = instance;
419 0     GlobusSoapMessageDebugExit();
420 0     return result;
421 }
422
423 globus_result_t
424 wsse_KeyIdentifierType_copy_contents(
425     wsse_KeyIdentifierType * instance,
426     const wsse_KeyIdentifierType * src_obj)
427 0 {
428 0     globus_result_t                     result = GLOBUS_SUCCESS;
429 0     GlobusFuncName(wsse_KeyIdentifierType_copy_contents);
430
431 0     GlobusSoapMessageDebugEnter();
432
433
434 0     if(src_obj->anyAttributes)
435     {
436 0         result = xsd_anyAttributes_copy(&instance->anyAttributes, 
437                                         src_obj->anyAttributes);
438 0         if(result != GLOBUS_SUCCESS)
439         {
440 0             result = GlobusSoapMessageErrorCopyAnyAttrsFailed(
441                 result, NULL);
442 0             goto xsd_anyAttributes_after_destroy;
443         }
444     }
445     else
446     {
447 0         instance->anyAttributes = NULL;
448     }
449
450 0     if(src_obj->_Id)
451     {
452 0         result = xsd_ID_copy(
453             &instance->_Id,
454             src_obj->_Id);
455 0         if(result != GLOBUS_SUCCESS)
456         {
457 0             result = GlobusSoapMessageErrorCopyFailed(
458                 result, NULL, &xsd_ID_qname);
459 0             goto _Id_destroy;
460         }
461     }
462     else
463     {
464 0         instance->_Id = NULL;
465     }
466
467 0     if(src_obj->_EncodingType)
468     {
469 0         result = xsd_anyURI_copy(
470             &instance->_EncodingType,
471             src_obj->_EncodingType);
472 0         if(result != GLOBUS_SUCCESS)
473         {
474 0             result = GlobusSoapMessageErrorCopyFailed(
475                 result, NULL, &xsd_anyURI_qname);
476 0             goto _EncodingType_destroy;
477         }
478     }
479     else
480     {
481 0         instance->_EncodingType = NULL;
482     }
483
484 0     if(src_obj->_ValueType)
485     {
486 0         result = xsd_anyURI_copy(
487             &instance->_ValueType,
488             src_obj->_ValueType);
489 0         if(result != GLOBUS_SUCCESS)
490         {
491 0             result = GlobusSoapMessageErrorCopyFailed(
492                 result, NULL, &xsd_anyURI_qname);
493 0             goto _ValueType_destroy;
494         }
495     }
496     else
497     {
498 0         instance->_ValueType = NULL;
499     }
500
501 0     result = xsd_string_copy_contents(
502         &instance->base_value,
503         &src_obj->base_value);
504 0     if(result != GLOBUS_SUCCESS)
505     {
506 0         result = GlobusSoapMessageErrorCopyFailed(
507             result, NULL,  &xsd_string_qname);
508 0         goto base_value_destroy;
509     }
510
511 0     goto exit;
512
513  fail_deserialize:
514
515  xsd_anyAttributes_destroy:
516 0         xsd_anyAttributes_destroy(instance->anyAttributes);
517 0         instance->anyAttributes = NULL;
518  xsd_anyAttributes_after_destroy:
519 0         xsd_string_destroy_contents(
520             &instance->base_value);
521
522  base_value_destroy:
523
524  _Id_destroy:
525
526 0     if(instance->_Id)
527     {
528 0         xsd_ID_destroy(
529             instance->_Id);
530 0         instance->_Id = NULL;
531     }
532
533  _EncodingType_destroy:
534
535 0     if(instance->_EncodingType)
536     {
537 0         xsd_anyURI_destroy(
538             instance->_EncodingType);
539 0         instance->_EncodingType = NULL;
540     }
541
542  _ValueType_destroy:
543
544 0     if(instance->_ValueType)
545     {
546 0         xsd_anyURI_destroy(
547             instance->_ValueType);
548 0         instance->_ValueType = NULL;
549     }
550
551
552  exit:
553
554 0     GlobusSoapMessageDebugExit();
555 0     return result;
556 }
557
558
559
560 globus_result_t
561 wsse_KeyIdentifierType_serialize_contents(
562     xsd_QName *                         element_qname, /* ignored */
563     wsse_KeyIdentifierType * inst,
564     globus_soap_message_handle_t        message_handle,
565     globus_xsd_element_options_t        options)
566 0 {
567 0     globus_result_t                     result = GLOBUS_SUCCESS;
568 0     GlobusFuncName(wsse_KeyIdentifierType_serialize_contents);
569 0     GlobusSoapMessageDebugEnter();
570
571 0     result = wsse_KeyIdentifierType_serialize(
572         NULL,
573         inst,
574         message_handle,
575         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
576 0     if(result != GLOBUS_SUCCESS)
577     {
578 0         result = GlobusSoapMessageErrorSerializeFailed(
579             result, NULL, element_qname);
580         goto exit;
581     }
582
583  exit:
584
585 0     GlobusSoapMessageDebugExit();
586 0     return result;
587 }
588
589
590
591 globus_result_t
592 wsse_KeyIdentifierType_serialize(
593     xsd_QName *                         element_qname,
594     wsse_KeyIdentifierType * instance,
595     globus_soap_message_handle_t        message_handle,
596     globus_xsd_element_options_t        options)
597 0 {
598 0     globus_result_t                     result = GLOBUS_SUCCESS;
599 0     xsd_QName                           subelement;
600 0     globus_list_t *                     any_attr_keys = NULL;
601 0     globus_list_t *                     any_attr_keys_iterator = NULL;
602 0     xsd_QName *                         type_attr = NULL;
603 0     char *                              prefix = NULL;
604 0     int                                 prefix_created;
605 0     int                                 define_prefix = 0;
606 0     int                                 save_options = options;
607
608 0     GlobusFuncName(wsse_KeyIdentifierType_serialize);
609 0     GlobusSoapMessageDebugEnter();
610
611
612 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
613     {
614         /* serialize wsse_KeyIdentifierType element */
615
616 0         result = globus_soap_message_invoke_ns_callouts(
617             message_handle,
618             element_qname,
619             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_SET,
620             &options);
621 0         if(result != GLOBUS_SUCCESS)
622         {
623 0             result = GlobusSoapMessageErrorSerializeFailed(
624                 result, NULL, element_qname);
625 0             goto exit;
626         }
627
628 0 result = globus_soap_message_element_ns_set(
629             message_handle,
630             element_qname->Namespace,
631             &options);
632 0         if(result != GLOBUS_SUCCESS)
633         {
634 0             result = GlobusSoapMessageErrorSerializeFailed(
635                 result, NULL, element_qname);
636 0             goto exit;
637         }
638
639 0         result = xsd_anyAttributes_namespace_set(
640             message_handle, instance->anyAttributes, &options);
641 0         if(result != GLOBUS_SUCCESS)
642         {
643 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
644                 result, "Failed to set namespace");
645 0             goto exit;
646         }
647
648 0         if(instance->_Id)
649         {
650
651 0         result = globus_soap_message_attribute_ns_set(
652             message_handle,
653             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
654              &options);
655
656 0         if(result != GLOBUS_SUCCESS)
657         {
658 0             xsd_QName               error_qname;
659 0             error_qname.local = prefix;
660 0             error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
661 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
662                                                            NULL, 
663                                                            &error_qname);
664 0             goto exit;
665         }
666
667
668         }
669
670 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
671    !globus_soap_message_serialize_is_c14n_subset(message_handle))
672         {
673 0             result = globus_soap_message_attribute_ns_set(
674                 message_handle,
675                 "http://www.w3.org/2001/XMLSchema-instance",
676                 &options);
677 0             if(result != GLOBUS_SUCCESS)
678             {
679 0                 result = GlobusSoapMessageErrorSerializeFailed(
680                     result, NULL, element_qname);
681 0                 goto exit;
682             }
683
684 0             result = globus_soap_message_attribute_ns_set(
685                 message_handle,
686                 wsse_KeyIdentifierType_qname.Namespace,
687                 &options);
688 0             if(result != GLOBUS_SUCCESS)
689             {
690 0                 result = GlobusSoapMessageErrorSerializeFailed(
691                     result, NULL, element_qname);
692 0                 goto exit;
693             }
694         }
695
696 0         if(instance->_EncodingType)
697         {
698
699 0         result = globus_soap_message_attribute_ns_set(
700             message_handle,
701             NULL,
702              &options);
703
704 0         if(result != GLOBUS_SUCCESS)
705         {
706 0             xsd_QName               error_qname;
707 0             error_qname.local = prefix;
708 0             error_qname.Namespace = "";
709 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
710                                                            NULL, 
711                                                            &error_qname);
712 0             goto exit;
713         }
714
715
716         }
717
718 0         if(instance->_ValueType)
719         {
720
721 0         result = globus_soap_message_attribute_ns_set(
722             message_handle,
723             NULL,
724              &options);
725
726 0         if(result != GLOBUS_SUCCESS)
727         {
728 0             xsd_QName               error_qname;
729 0             error_qname.local = prefix;
730 0             error_qname.Namespace = "";
731 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
732                                                            NULL, 
733                                                            &error_qname);
734 0             goto exit;
735         }
736
737
738         }
739
740 0         result = globus_soap_message_invoke_callouts(
741             message_handle,
742             element_qname,
743             GLOBUS_SOAP_MESSAGE_CALLOUT_BEGIN);
744 0         if(result != GLOBUS_SUCCESS)
745         {
746 0             result = GlobusSoapMessageErrorSerializeFailed(
747                 result, NULL, element_qname);
748 0             goto exit;
749         }
750
751 0         result = globus_soap_message_serialize_element(
752             message_handle,
753             element_qname,
754             options,
755             &wsse_KeyIdentifierType_qname);
756 0         if(result != GLOBUS_SUCCESS)
757         {
758 0             result = GlobusSoapMessageErrorSerializeFailed(
759                 result, NULL, element_qname);
760 0             goto exit;
761         }
762
763 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
764    !globus_soap_message_serialize_is_c14n_subset(message_handle))
765         {
766 0            xsd_QName_init(&type_attr);
767        
768 0            type_attr->local = globus_libc_strdup("type");
769 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
770         }
771
772         /* serialize namespaces */
773         
774 0 result = globus_soap_message_invoke_ns_callouts(
775             message_handle,
776             element_qname,
777             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_ADD,
778             &options);
779 0         if(result != GLOBUS_SUCCESS)
780         {
781 0             result = GlobusSoapMessageErrorSerializeFailed(
782                 result, NULL, element_qname);
783 0             goto exit;
784         }
785
786 0 result = globus_soap_message_element_ns_add(
787             message_handle,
788             element_qname->Namespace,
789             &options);
790 0         if(result != GLOBUS_SUCCESS)
791         {
792 0             result = GlobusSoapMessageErrorSerializeFailed(
793                 result, NULL, element_qname);
794 0             goto exit;
795         }
796
797 0         result = xsd_anyAttributes_namespace_add(
798             message_handle, instance->anyAttributes, &options);
799 0         if(result != GLOBUS_SUCCESS)
800         {
801 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
802                 result, "Failed to add namespace");
803 0             goto exit;
804         }
805
806 0         if(instance->_Id)
807         {
808
809 0         result = globus_soap_message_attribute_ns_add(
810             message_handle,
811             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
812              &options);
813
814 0         if(result != GLOBUS_SUCCESS)
815         {
816 0             xsd_QName               error_qname;
817 0             error_qname.local = prefix;
818 0             error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
819 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
820                                                            NULL, 
821                                                            &error_qname);
822 0             goto exit;
823         }
824
825
826         }
827
828 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
829    !globus_soap_message_serialize_is_c14n_subset(message_handle))
830         {
831 0             result = globus_soap_message_attribute_ns_add(
832                 message_handle,
833                 "http://www.w3.org/2001/XMLSchema-instance",
834                 &options);
835 0             if(result != GLOBUS_SUCCESS)
836             {
837 0                 result = GlobusSoapMessageErrorSerializeFailed(
838                     result, NULL, element_qname);
839 0                 goto exit;
840             }
841
842 0             result = globus_soap_message_attribute_ns_add(
843                 message_handle,
844                 wsse_KeyIdentifierType_qname.Namespace,
845                 &options);
846 0             if(result != GLOBUS_SUCCESS)
847             {
848 0                 result = GlobusSoapMessageErrorSerializeFailed(
849                     result, NULL, element_qname);
850 0                 goto exit;
851             }
852         }
853
854 0         if(instance->_EncodingType)
855         {
856
857 0         result = globus_soap_message_attribute_ns_add(
858             message_handle,
859             NULL,
860              &options);
861
862 0         if(result != GLOBUS_SUCCESS)
863         {
864 0             xsd_QName               error_qname;
865 0             error_qname.local = prefix;
866 0             error_qname.Namespace = "";
867 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
868                                                            NULL, 
869                                                            &error_qname);
870 0             goto exit;
871         }
872
873
874         }
875
876 0         if(instance->_ValueType)
877         {
878
879 0         result = globus_soap_message_attribute_ns_add(
880             message_handle,
881             NULL,
882              &options);
883
884 0         if(result != GLOBUS_SUCCESS)
885         {
886 0             xsd_QName               error_qname;
887 0             error_qname.local = prefix;
888 0             error_qname.Namespace = "";
889 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
890                                                            NULL, 
891                                                            &error_qname);
892 0             goto exit;
893         }
894
895
896         }
897
898         /* serialize attributes */
899
900 0         if(instance->anyAttributes)
901         {
902 0             any_attr_keys = xsd_anyAttributes_lex_sort(
903                 instance->anyAttributes);
904 0             any_attr_keys_iterator = any_attr_keys;
905         }
906
907 0         subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
908 0         subelement.local = "Id";
909
910 0         if(any_attr_keys_iterator)
911         {
912 0             result = xsd_anyAttributes_serialize_lex_before(
913                 message_handle,
914                 &any_attr_keys_iterator,
915                 instance->anyAttributes,
916                 &subelement);
917 0             if(result != GLOBUS_SUCCESS)
918             {
919 0                 result = GlobusSoapMessageErrorSerializeFailed(result, 
920                                                                NULL, 
921                                                                element_qname);
922 0                 goto exit;
923             }
924         }
925
926 0         if(instance->_Id)
927         {
928
929 0         result = xsd_ID_serialize_attribute(
930             &subelement,
931             instance->_Id,
932             message_handle,
933             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
934 0         if(result != GLOBUS_SUCCESS)
935         {
936 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
937                                                            NULL, 
938                                                            element_qname);
939 0             goto exit;
940         }
941
942         }
943
944 0         if(any_attr_keys_iterator)
945         {
946 0             result = xsd_anyAttributes_serialize_lex_before(
947                 message_handle,
948                 &any_attr_keys_iterator,
949                 instance->anyAttributes,
950                 &subelement);
951 0             if(result != GLOBUS_SUCCESS)
952             {
953 0                 result = GlobusSoapMessageErrorSerializeFailed(result, 
954                                                                NULL, 
955                                                                element_qname);
956 0                 goto exit;
957             }
958         }
959
960 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
961    !globus_soap_message_serialize_is_c14n_subset(message_handle))
962         {
963 0             result = globus_soap_message_serialize_QName_attribute(
964                 message_handle,
965                 type_attr,
966                 &wsse_KeyIdentifierType_qname);
967 0             if(result != GLOBUS_SUCCESS)
968             {
969 0                 result = GlobusSoapMessageErrorSerializeFailed(
970                     result, NULL, element_qname);
971 0                 goto exit;
972             }
973         }
974
975 0         subelement.Namespace = "";
976 0         subelement.local = "EncodingType";
977
978 0         if(instance->_EncodingType)
979         {
980
981 0         result = xsd_anyURI_serialize_attribute(
982             &subelement,
983             instance->_EncodingType,
984             message_handle,
985             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
986 0         if(result != GLOBUS_SUCCESS)
987         {
988 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
989                                                            NULL, 
990                                                            element_qname);
991 0             goto exit;
992         }
993
994         }
995
996 0         subelement.Namespace = "";
997 0         subelement.local = "ValueType";
998
999 0         if(instance->_ValueType)
1000         {
1001
1002 0         result = xsd_anyURI_serialize_attribute(
1003             &subelement,
1004             instance->_ValueType,
1005             message_handle,
1006             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
1007 0         if(result != GLOBUS_SUCCESS)
1008         {
1009 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
1010                                                            NULL, 
1011                                                            element_qname);
1012 0             goto exit;
1013         }
1014
1015         }
1016
1017
1018 0         result = globus_soap_message_invoke_callouts(
1019             message_handle,
1020             element_qname,
1021             GLOBUS_SOAP_MESSAGE_CALLOUT_ATTR);
1022 0         if(result != GLOBUS_SUCCESS)
1023         {
1024 0             result = GlobusSoapMessageErrorSerializeFailed(
1025                 result, NULL, element_qname);
1026 0             goto exit;
1027         }
1028     }
1029
1030 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1031     {
1032 0         result = globus_soap_message_serialize_element_begin_close(
1033             message_handle);
1034 0         if(result != GLOBUS_SUCCESS)
1035         {
1036 0             result = GlobusSoapMessageErrorSerializeFailed(
1037                 result, NULL, element_qname);
1038 0             goto exit;
1039         }
1040     }
1041 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
1042
1043     /* serialize contents of type */
1044
1045 0     subelement.local = "base_value";
1046 0     subelement.Namespace = NULL;
1047
1048 0     result = xsd_string_serialize(
1049         &subelement,
1050         &instance->base_value,
1051         message_handle,
1052         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1053 0     if(result != GLOBUS_SUCCESS)
1054     {
1055 0         result = GlobusSoapMessageErrorSerializeFailed(
1056             result, NULL,  &xsd_string_qname);
1057 0         goto exit;
1058     }
1059
1060 0     options = save_options;
1061
1062 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1063     {
1064         /* add end element */
1065 0         result = globus_soap_message_serialize_element_end(
1066             message_handle,
1067             element_qname,
1068             options,
1069             &wsse_KeyIdentifierType_qname);
1070 0         if(result != GLOBUS_SUCCESS)
1071         {
1072 0             result = GlobusSoapMessageErrorSerializeFailed(
1073                 result, NULL, element_qname);
1074 0             goto exit;
1075         }
1076
1077 0         globus_soap_message_element_ns_remove(
1078             message_handle,
1079             element_qname->Namespace,
1080             &options);
1081
1082     /* remove namespace/prefix mappings for these types */
1083
1084 0         result = xsd_anyAttributes_namespace_remove(
1085             message_handle, instance->anyAttributes, &options);
1086 0         if(result != GLOBUS_SUCCESS)
1087         {
1088 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
1089                 result, "Failed to remove namespace");
1090 0             goto exit;
1091         }
1092
1093 0         if(instance->_Id)
1094         {
1095
1096 0         globus_soap_message_attribute_ns_remove(
1097             message_handle,
1098             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
1099              &options);
1100
1101         }
1102
1103 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1104    !globus_soap_message_serialize_is_c14n_subset(message_handle))
1105         {
1106 0             globus_soap_message_attribute_ns_remove(
1107                 message_handle,
1108                 "http://www.w3.org/2001/XMLSchema-instance",
1109                 &options);
1110            
1111 0             globus_soap_message_attribute_ns_remove(
1112                 message_handle,
1113                 wsse_KeyIdentifierType_qname.Namespace,
1114                 &options);
1115         }           
1116
1117 0         if(instance->_EncodingType)
1118         {
1119
1120 0         globus_soap_message_attribute_ns_remove(
1121             message_handle,
1122             NULL,
1123              &options);
1124
1125         }
1126
1127 0         if(instance->_ValueType)
1128         {
1129
1130 0         globus_soap_message_attribute_ns_remove(
1131             message_handle,
1132             NULL,
1133              &options);
1134
1135         }
1136
1137 0         result = globus_soap_message_invoke_ns_callouts(
1138             message_handle,
1139             element_qname,
1140             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_REMOVE,
1141             &options);
1142 0         if(result != GLOBUS_SUCCESS)
1143         {
1144 0             result  = GlobusSoapMessageErrorSerializeFailed(
1145                 result, NULL, element_qname);
1146 0             goto exit;
1147         }
1148
1149 0         result = globus_soap_message_invoke_callouts(
1150             message_handle,
1151             element_qname,
1152             GLOBUS_SOAP_MESSAGE_CALLOUT_END);
1153 0         if(result != GLOBUS_SUCCESS)
1154         {
1155 0             result = GlobusSoapMessageErrorSerializeFailed(
1156                 result, NULL, element_qname);
1157             goto exit;
1158         }
1159     }
1160
1161  exit:
1162 0     if (type_attr)
1163     {
1164 0         xsd_QName_destroy(type_attr);
1165     }
1166
1167 0     if(any_attr_keys)
1168     {
1169 0         globus_list_free(any_attr_keys);
1170     }
1171
1172 0     GlobusSoapMessageDebugExit();
1173 0     return result;
1174 }
1175
1176
1177
1178 globus_result_t
1179 wsse_KeyIdentifierType_deserialize_contents(
1180     xsd_QName *                         element_qname, /* ignored */
1181     wsse_KeyIdentifierType * inst,
1182     globus_soap_message_handle_t        message_handle,
1183     globus_xsd_element_options_t        options)
1184 0 {
1185 0     globus_result_t                     result = GLOBUS_SUCCESS;
1186 0     GlobusFuncName(wsse_KeyIdentifierType_deserialize_contents);
1187 0     GlobusSoapMessageDebugEnter();
1188
1189 0     result = wsse_KeyIdentifierType_deserialize(
1190         NULL,
1191         inst,
1192         message_handle,
1193         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1194 0     if(result != GLOBUS_SUCCESS)
1195     {
1196 0         result = GlobusSoapMessageErrorDeserializeFailed(
1197             result, element_qname);
1198         goto exit;
1199     }
1200
1201  exit:
1202
1203 0     GlobusSoapMessageDebugExit();
1204 0     return result;
1205 }
1206
1207
1208
1209 globus_result_t
1210 wsse_KeyIdentifierType_deserialize(
1211     xsd_QName *                         element_qname,
1212     wsse_KeyIdentifierType * instance,
1213     globus_soap_message_handle_t        message_handle,
1214     globus_xsd_element_options_t        options)
1215 0 {
1216 0     globus_result_t                     result = GLOBUS_SUCCESS;
1217 0     xsd_QName                           subelement;
1218 0     GlobusFuncName(wsse_KeyIdentifierType_deserialize);
1219 0     GlobusSoapMessageDebugEnter();
1220
1221
1222 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1223     {
1224 0         result = globus_soap_message_deserialize_element(
1225             message_handle, element_qname);
1226 0         if(result != GLOBUS_SUCCESS)
1227         {
1228 0             result = GlobusSoapMessageErrorDeserializeFailed(
1229                 result, element_qname);
1230 0             goto exit;
1231         }
1232
1233 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1234 0         if(result != GLOBUS_SUCCESS)
1235         {
1236 0             result = GlobusSoapMessageErrorDeserializeFailed(
1237                 result, element_qname);
1238 0             goto xsd_anyAttributes_after_destroy;
1239         }
1240
1241 0         result = xsd_anyAttributes_deserialize(
1242             message_handle,
1243             instance->anyAttributes);
1244 0         if(result != GLOBUS_SUCCESS)
1245         {
1246 0             result = GlobusSoapMessageErrorDeserializeFailed(
1247                 result, element_qname);
1248 0             goto xsd_anyAttributes_destroy;
1249         }
1250
1251 0     subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
1252 0     subelement.local = "Id";
1253
1254 0     result = xsd_ID_deserialize_attribute_pointer(
1255         &subelement,
1256         &instance->_Id,
1257         message_handle,
1258         0);
1259 0     if(result != GLOBUS_SUCCESS)
1260     {
1261 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1262 0         goto _Id_destroy;
1263     }
1264
1265
1266 0     subelement.Namespace = "";
1267 0     subelement.local = "EncodingType";
1268
1269 0     result = xsd_anyURI_deserialize_attribute_pointer(
1270         &subelement,
1271         &instance->_EncodingType,
1272         message_handle,
1273         0);
1274 0     if(result != GLOBUS_SUCCESS)
1275     {
1276 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1277 0         goto _EncodingType_destroy;
1278     }
1279
1280
1281 0     subelement.Namespace = "";
1282 0     subelement.local = "ValueType";
1283
1284 0     result = xsd_anyURI_deserialize_attribute_pointer(
1285         &subelement,
1286         &instance->_ValueType,
1287         message_handle,
1288         0);
1289 0     if(result != GLOBUS_SUCCESS)
1290     {
1291 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1292 0         goto _ValueType_destroy;
1293     }
1294
1295
1296
1297 0         result = globus_soap_message_deserialize_element_begin_close(
1298             message_handle);
1299 0         if(result != GLOBUS_SUCCESS)
1300         {
1301 0             result = GlobusSoapMessageErrorDeserializeFailed(
1302                 result, element_qname);
1303 0             goto fail_deserialize;
1304         }
1305     }
1306
1307 0     subelement.local = "base_value";
1308 0     subelement.Namespace = NULL;
1309
1310 0     result = xsd_string_deserialize(
1311         &subelement,
1312         &instance->base_value,
1313         message_handle,
1314         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1315 0     if(result != GLOBUS_SUCCESS)
1316     {
1317 0         result = GlobusSoapMessageErrorDeserializeFailed(
1318             result,
1319             &xsd_string_qname);
1320 0         goto base_value_destroy;
1321     }
1322
1323 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1324     {
1325 0         result = globus_soap_message_deserialize_element_end(
1326             message_handle,
1327             element_qname);
1328 0         if(result != GLOBUS_SUCCESS)
1329         {
1330 0             result = GlobusSoapMessageErrorDeserializeFailed(
1331                 result, element_qname);
1332             goto fail_deserialize;
1333         }
1334     }
1335
1336 0     goto exit;
1337
1338  fail_deserialize:
1339
1340  xsd_anyAttributes_destroy:
1341 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1342 0         instance->anyAttributes = NULL;
1343  xsd_anyAttributes_after_destroy:
1344 0         xsd_string_destroy_contents(
1345             &instance->base_value);
1346
1347  base_value_destroy:
1348
1349  _Id_destroy:
1350
1351 0     if(instance->_Id)
1352     {
1353 0         xsd_ID_destroy(
1354             instance->_Id);
1355 0         instance->_Id = NULL;
1356     }
1357
1358  _EncodingType_destroy:
1359
1360 0     if(instance->_EncodingType)
1361     {
1362 0         xsd_anyURI_destroy(
1363             instance->_EncodingType);
1364 0         instance->_EncodingType = NULL;
1365     }
1366
1367  _ValueType_destroy:
1368
1369 0     if(instance->_ValueType)
1370     {
1371 0         xsd_anyURI_destroy(
1372             instance->_ValueType);
1373 0         instance->_ValueType = NULL;
1374     }
1375
1376
1377  exit:
1378
1379 0     GlobusSoapMessageDebugExit();
1380 0     return result;
1381 }
1382
1383
1384
1385 globus_result_t
1386 wsse_KeyIdentifierType_deserialize_pointer(
1387     xsd_QName *                         element_qname,
1388     wsse_KeyIdentifierType ** ip,
1389     globus_soap_message_handle_t        message_handle,
1390     globus_xsd_element_options_t        options)
1391 0 {
1392 0     wsse_KeyIdentifierType * instance = NULL;
1393 0     globus_result_t                     result = GLOBUS_SUCCESS;
1394 0     xsd_QName                           subelement;
1395 0     int                                 found_attrs = 0;
1396 0     int                                 empty_element = 0;
1397 0     GlobusFuncName(wsse_KeyIdentifierType_deserialize_pointer);
1398 0     GlobusSoapMessageDebugEnter();
1399
1400 0     *ip = NULL;
1401
1402 0     result = globus_soap_message_deserialize_element(
1403         message_handle, element_qname);
1404 0     if(result != GLOBUS_SUCCESS &&
1405        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1406         GlobusSoapMessageStatusFailedElementCheck(result) ||
1407         GlobusSoapMessageStatusFailedWithTextCheck(result)))
1408     {
1409 0         *ip = NULL;
1410 0         result = GLOBUS_SUCCESS;
1411 0         goto exit;
1412     }
1413
1414 0     if(result != GLOBUS_SUCCESS)
1415     {
1416 0         result = GlobusSoapMessageErrorDeserializeFailed(
1417             result, element_qname);
1418 0         goto exit;
1419     }
1420
1421 0     if(globus_soap_message_deserialize_element_is_empty(
1422            message_handle))
1423     {
1424 0         empty_element = 1;
1425     }
1426
1427
1428
1429 0     result = wsse_KeyIdentifierType_init(&instance);
1430 0     if(result != GLOBUS_SUCCESS)
1431     {
1432 0         result = GlobusSoapMessageErrorDeserializeFailed(
1433             result, element_qname);
1434 0         goto exit;
1435     }
1436
1437
1438 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1439 0         if(result != GLOBUS_SUCCESS)
1440         {
1441 0             result = GlobusSoapMessageErrorDeserializeFailed(
1442                 result, element_qname);
1443 0             goto xsd_anyAttributes_after_destroy;
1444         }
1445
1446 0         result = xsd_anyAttributes_deserialize(
1447             message_handle,
1448             instance->anyAttributes);
1449 0         if(result != GLOBUS_SUCCESS)
1450         {
1451 0             result = GlobusSoapMessageErrorDeserializeFailed(
1452                 result, element_qname);
1453 0             goto xsd_anyAttributes_destroy;
1454         }
1455
1456 0         if(instance->anyAttributes &&
1457            xsd_anyAttributes_size(instance->anyAttributes) > 0)
1458         {
1459 0             found_attrs++;
1460         }
1461
1462 0     subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
1463 0     subelement.local = "Id";
1464
1465 0     result = xsd_ID_deserialize_attribute_pointer(
1466         &subelement,
1467         &instance->_Id,
1468         message_handle,
1469         0);
1470 0     if(result != GLOBUS_SUCCESS)
1471     {
1472 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1473 0         goto _Id_destroy;
1474     }
1475
1476
1477 0     if(instance->_Id)
1478     {
1479 0         found_attrs++;
1480     }
1481
1482 0     subelement.Namespace = "";
1483 0     subelement.local = "EncodingType";
1484
1485 0     result = xsd_anyURI_deserialize_attribute_pointer(
1486         &subelement,
1487         &instance->_EncodingType,
1488         message_handle,
1489         0);
1490 0     if(result != GLOBUS_SUCCESS)
1491     {
1492 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1493 0         goto _EncodingType_destroy;
1494     }
1495
1496
1497 0     if(instance->_EncodingType)
1498     {
1499 0         found_attrs++;
1500     }
1501
1502 0     subelement.Namespace = "";
1503 0     subelement.local = "ValueType";
1504
1505 0     result = xsd_anyURI_deserialize_attribute_pointer(
1506         &subelement,
1507         &instance->_ValueType,
1508         message_handle,
1509         0);
1510 0     if(result != GLOBUS_SUCCESS)
1511     {
1512 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1513 0         goto _ValueType_destroy;
1514     }
1515
1516
1517 0     if(instance->_ValueType)
1518     {
1519 0         found_attrs++;
1520     }
1521
1522
1523 0     if(empty_element)
1524     {
1525 0         result = globus_soap_message_deserialize_element_end(
1526             message_handle,
1527             element_qname);
1528 0         if(result != GLOBUS_SUCCESS)
1529         {
1530 0             result = GlobusSoapMessageErrorDeserializeFailed(
1531                 result, element_qname);
1532 0             goto fail_deserialize;
1533         }
1534
1535 0         *ip = instance;
1536 0         goto exit;
1537     }
1538
1539 0     result = globus_soap_message_deserialize_element_begin_close(
1540         message_handle);
1541 0     if(result != GLOBUS_SUCCESS)
1542     {
1543 0         result = GlobusSoapMessageErrorDeserializeFailed(
1544             result, element_qname);
1545 0         goto exit;
1546     }
1547
1548
1549 0     subelement.local = "base_value";
1550 0     subelement.Namespace = NULL;
1551
1552 0     result = xsd_string_deserialize(
1553         &subelement,
1554         &instance->base_value,
1555         message_handle,
1556         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1557 0     if(result != GLOBUS_SUCCESS)
1558     {
1559 0         result = GlobusSoapMessageErrorDeserializeFailed(
1560             result,
1561             &xsd_string_qname);
1562 0         goto base_value_destroy;
1563     }
1564
1565
1566 0     result = globus_soap_message_deserialize_element_end(
1567         message_handle,
1568         element_qname);
1569 0     if(result != GLOBUS_SUCCESS)
1570     {
1571 0         result = GlobusSoapMessageErrorDeserializeFailed(
1572             result, element_qname);
1573 0         goto fail_deserialize;
1574     }
1575
1576 0     *ip = instance;
1577
1578 0     goto exit;
1579
1580  fail_deserialize:
1581
1582  xsd_anyAttributes_destroy:
1583 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1584 0         instance->anyAttributes = NULL;
1585  xsd_anyAttributes_after_destroy:
1586 0         xsd_string_destroy_contents(
1587             &instance->base_value);
1588
1589  base_value_destroy:
1590
1591  _Id_destroy:
1592
1593 0     if(instance->_Id)
1594     {
1595 0         xsd_ID_destroy(
1596             instance->_Id);
1597 0         instance->_Id = NULL;
1598     }
1599
1600  _EncodingType_destroy:
1601
1602 0     if(instance->_EncodingType)
1603     {
1604 0         xsd_anyURI_destroy(
1605             instance->_EncodingType);
1606 0         instance->_EncodingType = NULL;
1607     }
1608
1609  _ValueType_destroy:
1610
1611 0     if(instance->_ValueType)
1612     {
1613 0         xsd_anyURI_destroy(
1614             instance->_ValueType);
1615 0         instance->_ValueType = NULL;
1616     }
1617
1618  exit:
1619
1620 0     GlobusSoapMessageDebugExit();
1621 0     return result;
1622 }
1623
1624
1625 globus_result_t
1626 wsse_KeyIdentifierType_array_init_contents(
1627     wsse_KeyIdentifierType_array * array)
1628 0 {
1629 0     GlobusFuncName(wsse_KeyIdentifierType_array_init_contents);
1630 0     GlobusSoapMessageDebugEnter();
1631
1632 0     memset(array, 0, sizeof(wsse_KeyIdentifierType_array));
1633
1634 0     GlobusSoapMessageDebugExit();
1635 0     return GLOBUS_SUCCESS;
1636 }
1637
1638 globus_result_t
1639 wsse_KeyIdentifierType_array_init(
1640     wsse_KeyIdentifierType_array ** arr)
1641 0 {
1642 0     wsse_KeyIdentifierType_array * array;
1643 0     globus_result_t                     result;
1644 0     GlobusFuncName(wsse_KeyIdentifierType_array_init);
1645 0     GlobusSoapMessageDebugEnter();
1646
1647 0     array = (wsse_KeyIdentifierType_array *)
1648         globus_malloc(sizeof(wsse_KeyIdentifierType_array));
1649 0     if(!array)
1650     {
1651 0         result = GlobusSoapMessageErrorOutOfMemory;
1652 0         goto exit;
1653     }
1654
1655 0     result = wsse_KeyIdentifierType_array_init_contents(array);
1656 0     if(result != GLOBUS_SUCCESS)
1657     {
1658 0         globus_free(array);
1659 0         array = NULL;
1660
1661     }
1662
1663 0     *arr = array;
1664
1665  exit:
1666 0     GlobusSoapMessageDebugExit();
1667 0     return result;
1668 }
1669
1670 void
1671 wsse_KeyIdentifierType_array_destroy_contents(
1672     wsse_KeyIdentifierType_array * array)
1673 0 {
1674 0     int                                 i = 0;
1675 0     GlobusFuncName(wsse_KeyIdentifierType_array_destroy_contents);
1676 0     GlobusSoapMessageDebugEnter();
1677
1678 0     for(; i < array->length; ++i)
1679     {
1680 0         wsse_KeyIdentifierType_destroy_contents(&array->elements[i]);
1681     }
1682
1683 0     if(array->elements)
1684     {
1685 0         globus_free(array->elements);
1686 0         array->elements = NULL;
1687     }
1688 0     array->length = 0;
1689
1690 0     GlobusSoapMessageDebugExit();
1691 }
1692
1693 void
1694 wsse_KeyIdentifierType_array_destroy(
1695     wsse_KeyIdentifierType_array * array)
1696 0 {
1697 0     GlobusFuncName(wsse_KeyIdentifierType_array_destroy);
1698 0     GlobusSoapMessageDebugEnter();
1699
1700 0     wsse_KeyIdentifierType_array_destroy_contents(array);
1701 0     globus_free(array);
1702
1703 0     GlobusSoapMessageDebugExit();
1704 }
1705
1706 globus_result_t
1707 wsse_KeyIdentifierType_array_copy(
1708     wsse_KeyIdentifierType_array ** dest_arr,
1709     const wsse_KeyIdentifierType_array * src_arr)
1710 0 {
1711 0     wsse_KeyIdentifierType_array * array;
1712 0     globus_result_t                     result;
1713 0     GlobusFuncName(wsse_KeyIdentifierType_array_copy);
1714 0     GlobusSoapMessageDebugEnter();
1715
1716 0     array = (wsse_KeyIdentifierType_array *) globus_malloc(
1717         sizeof(wsse_KeyIdentifierType_array));
1718 0     if(!array)
1719     {
1720 0         result = GlobusSoapMessageErrorOutOfMemory;
1721 0         GlobusSoapMessageDebugExit();
1722 0         return result;
1723     }
1724
1725 0     result = wsse_KeyIdentifierType_array_copy_contents(array, src_arr);
1726 0     if(result != GLOBUS_SUCCESS)
1727     {
1728 0         globus_free(array);
1729 0         GlobusSoapMessageDebugExit();
1730 0         return result;
1731     }
1732
1733 0     *dest_arr = array;
1734
1735 0     GlobusSoapMessageDebugExit();
1736 0     return GLOBUS_SUCCESS;
1737 }
1738
1739 globus_result_t
1740 wsse_KeyIdentifierType_array_copy_contents(
1741     wsse_KeyIdentifierType_array * dest_arr,
1742     const wsse_KeyIdentifierType_array * src_arr)
1743 0 {
1744 0     int                                 i;
1745 0     globus_result_t                     result = GLOBUS_SUCCESS;
1746 0     GlobusFuncName(wsse_KeyIdentifierType_array_copy_contents);
1747 0     GlobusSoapMessageDebugEnter();
1748
1749 0     dest_arr->length = src_arr->length;
1750 0     if(dest_arr->length > 0)
1751     {
1752 0         dest_arr->elements = (wsse_KeyIdentifierType *) malloc(
1753             sizeof(wsse_KeyIdentifierType) * dest_arr->length);
1754 0         if(!dest_arr->elements)
1755         {
1756 0             result = GlobusSoapMessageErrorOutOfMemory;
1757 0             GlobusSoapMessageDebugExit();
1758 0             return result;
1759         }
1760     }
1761     else
1762     {
1763 0         dest_arr->elements = NULL;
1764     }
1765     
1766 0     for(i = 0; i < dest_arr->length; i++)
1767     {
1768 0         result = wsse_KeyIdentifierType_copy_contents(
1769             &dest_arr->elements[i], &src_arr->elements[i]);
1770 0         if(result != GLOBUS_SUCCESS)
1771         {
1772 0             while(i--)
1773             {
1774 0                 wsse_KeyIdentifierType_destroy_contents(&dest_arr->elements[i]);
1775             }
1776
1777 0             globus_free(dest_arr->elements);
1778 0             dest_arr->elements = NULL;
1779 0             dest_arr->length = 0;
1780 0             break;
1781         }
1782     }
1783
1784 0     GlobusSoapMessageDebugExit();
1785 0     return result;
1786 }
1787
1788 wsse_KeyIdentifierType *
1789 wsse_KeyIdentifierType_array_push(
1790     wsse_KeyIdentifierType_array * array)
1791 0 {
1792 0     GlobusFuncName(wsse_KeyIdentifierType_array_push);
1793 0     GlobusSoapMessageDebugEnter();
1794
1795 0     array->elements = realloc(array->elements,
1796                               sizeof(wsse_KeyIdentifierType) *
1797                               (array->length + 1));
1798 0     memset(&array->elements[array->length], 0, sizeof(wsse_KeyIdentifierType));
1799 0     array->length++;
1800
1801 0     GlobusSoapMessageDebugExit();
1802 0     return (&array->elements[array->length - 1]);
1803 }
1804
1805 void *
1806 wsse_KeyIdentifierType_array_push_wrapper(
1807     void * array)
1808 0 {
1809 0     return (void *) wsse_KeyIdentifierType_array_push((wsse_KeyIdentifierType_array *) array);
1810 }
1811
1812 globus_result_t
1813 wsse_KeyIdentifierType_array_serialize(
1814     xsd_QName *                         element_qname,
1815     wsse_KeyIdentifierType_array * array,
1816     globus_soap_message_handle_t        message,
1817     globus_xsd_element_options_t        options)
1818 0 {
1819 0     globus_result_t                     result = GLOBUS_SUCCESS;
1820 0     int                                 i = 0;
1821 0     GlobusFuncName(wsse_KeyIdentifierType_array_serialize);
1822 0     GlobusSoapMessageDebugEnter();
1823
1824 0     for(; i < array->length; ++i)
1825     {
1826 0         result = wsse_KeyIdentifierType_serialize(
1827             element_qname,
1828             &array->elements[i],
1829             message,
1830             options);
1831 0         if(result != GLOBUS_SUCCESS)
1832         {
1833 0             goto exit;
1834         }
1835     }
1836
1837 exit:
1838
1839 0     GlobusSoapMessageDebugExit();
1840 0     return result;
1841 }
1842
1843 globus_result_t
1844 wsse_KeyIdentifierType_array_deserialize(
1845     xsd_QName *                         element_qname,
1846     wsse_KeyIdentifierType_array * array,
1847     globus_soap_message_handle_t        message,
1848     globus_xsd_element_options_t        options)
1849 0 {
1850 0     globus_result_t                     result = GLOBUS_SUCCESS;
1851 0     int                                 i = 0;
1852 0     int                                 pre_length;
1853 0     GlobusFuncName(wsse_KeyIdentifierType_array_deserialize);
1854 0     GlobusSoapMessageDebugEnter();
1855
1856 0     pre_length = array->length;
1857
1858 0     for(i = 0; i < pre_length; ++i)
1859     {
1860 0         result = wsse_KeyIdentifierType_deserialize(
1861             element_qname,
1862             &array->elements[i],
1863             message,
1864             options);
1865 0         if(result != GLOBUS_SUCCESS)
1866         {
1867 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1868                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1869                GlobusSoapMessageStatusFailedWithTextCheck(result))
1870             {
1871 0                 result = GLOBUS_SUCCESS;
1872 0                 break;
1873             }
1874
1875 0             result = GlobusSoapMessageErrorDeserializeFailed(
1876                 result, element_qname);
1877 0             goto exit;
1878         }
1879     }
1880
1881 0     while(result == GLOBUS_SUCCESS)
1882     {
1883 0         wsse_KeyIdentifierType                  next;
1884 0         memset(&next, 0, sizeof(wsse_KeyIdentifierType));
1885
1886 0         result = wsse_KeyIdentifierType_deserialize(
1887             element_qname,
1888             &next,
1889             message,
1890             options);
1891 0         if(result != GLOBUS_SUCCESS)
1892         {
1893 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1894                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1895                GlobusSoapMessageStatusFailedWithTextCheck(result))
1896             {
1897 0                 result = GLOBUS_SUCCESS;
1898 0                 break;
1899             }
1900
1901 0             result = GlobusSoapMessageErrorDeserializeFailed(
1902                 result, element_qname);
1903 0             goto exit;
1904         }
1905
1906 0         array->elements = realloc(
1907             array->elements,
1908             (array->length + 1) * sizeof(wsse_KeyIdentifierType));
1909 0         if(!array->elements)
1910         {
1911 0             result = GlobusSoapMessageErrorOutOfMemory;
1912 0             goto exit;
1913         }
1914 0         array->elements[array->length] = next;
1915 0         array->length++;
1916 0         ++i;
1917     }
1918
1919   exit:
1920
1921 0     if(result != GLOBUS_SUCCESS)
1922     {
1923 0         int                             di = 0;
1924 0         for(; di < i; ++di)
1925         {
1926 0             wsse_KeyIdentifierType_destroy_contents(
1927                 &array->elements[di]);
1928 0             memset(&array->elements[di], 0, sizeof(wsse_KeyIdentifierType));
1929         }
1930     }
1931
1932 0     GlobusSoapMessageDebugExit();
1933 0     return result;