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