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 "wsseu_AttributedDateTime.h"
26
27 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
28 xsd_QName wsseu_AttributedDateTime_qname =
29 {
30     WSSEU_ATTRIBUTEDDATETIME_NS,
31     WSSEU_ATTRIBUTEDDATETIME_LOCAL
32 };
33 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
34
35 globus_result_t
36 wsseu_AttributedDateTime_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 wsseu_AttributedDateTime_serialize(
43         element_qname,
44         (const wsseu_AttributedDateTime *) instance,
45         message_handle, options);
46 }
47
48 globus_result_t
49 wsseu_AttributedDateTime_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 wsseu_AttributedDateTime_deserialize_pointer(
56         element_qname,
57         (wsseu_AttributedDateTime **) ip,
58         message_handle, options);
59 }
60
61 globus_result_t
62 wsseu_AttributedDateTime_init_wrapper(void **object)
63 0 {
64 0     return wsseu_AttributedDateTime_init(
65         (wsseu_AttributedDateTime **) object);
66 }
67
68 void
69 wsseu_AttributedDateTime_destroy_wrapper(
70     void *                          object)
71 0 {
72 0     wsseu_AttributedDateTime_destroy(
73         (wsseu_AttributedDateTime *) object);
74 }
75
76 globus_result_t
77 wsseu_AttributedDateTime_copy_wrapper(
78     void **                         dest_obj,
79     const void *                    src_obj)
80 0 {
81 0     return wsseu_AttributedDateTime_copy(
82         (wsseu_AttributedDateTime **) dest_obj,
83         (wsseu_AttributedDateTime *) src_obj);
84 }
85
86 globus_result_t
87 wsseu_AttributedDateTime_init_contents_wrapper(void *object)
88 0 {
89 0     return wsseu_AttributedDateTime_init_contents(
90         (wsseu_AttributedDateTime *) object);
91 }
92
93 void
94 wsseu_AttributedDateTime_destroy_contents_wrapper(
95     void *                          object)
96 0 {
97 0     wsseu_AttributedDateTime_destroy_contents(
98         (wsseu_AttributedDateTime *) object);
99 }
100
101 globus_result_t
102 wsseu_AttributedDateTime_copy_contents_wrapper(
103     void *                          dest_obj,
104     const void *                    src_obj)
105 0 {
106 0     return wsseu_AttributedDateTime_copy_contents(
107         (wsseu_AttributedDateTime *) dest_obj,
108         (const wsseu_AttributedDateTime *) src_obj);
109 }
110
111 globus_result_t
112 wsseu_AttributedDateTime_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 wsseu_AttributedDateTime_serialize_contents(
119         element_qname,
120         (wsseu_AttributedDateTime *) instance,
121         message_handle, options);
122 }
123
124 globus_result_t
125 wsseu_AttributedDateTime_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(wsseu_AttributedDateTime_deserialize_contents_wrapper);
133 0     GlobusSoapMessageDebugEnter();
134
135 0     if(!*instance)
136     {
137 0         result = wsseu_AttributedDateTime_init(
138             (wsseu_AttributedDateTime **)instance);
139 0         if(result != GLOBUS_SUCCESS)
140         {
141 0             goto error;
142         }
143     }
144
145 0     result = wsseu_AttributedDateTime_deserialize_contents(
146         element_qname,
147         *(wsseu_AttributedDateTime **)instance,
148         message_handle, options);
149 error:
150 0     GlobusSoapMessageDebugExit();
151 0     return result;
152 }
153
154 globus_result_t
155 wsseu_AttributedDateTime_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 wsseu_AttributedDateTime_array_serialize(
162         element,
163         (wsseu_AttributedDateTime_array *) instance,
164         message, options);
165 }
166
167 globus_result_t
168 wsseu_AttributedDateTime_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 = wsseu_AttributedDateTime_array_init(
179             (wsseu_AttributedDateTime_array **)inst);
180 0         if(result != GLOBUS_SUCCESS)
181         {
182 0             return result;
183         }
184     }
185
186 0     return wsseu_AttributedDateTime_array_deserialize(
187         element_qname,
188         *(wsseu_AttributedDateTime_array **) inst,
189         message, options);
190 }
191
192 globus_result_t
193 wsseu_AttributedDateTime_array_init_wrapper(
194     void **                             arr)
195 0 {
196 0     return wsseu_AttributedDateTime_array_init(
197         (wsseu_AttributedDateTime_array **) arr);
198 }
199
200 void
201 wsseu_AttributedDateTime_array_destroy_wrapper(
202     void *                              arr)
203 0 {
204 0     wsseu_AttributedDateTime_array_destroy(
205         (wsseu_AttributedDateTime_array *) arr);
206 }
207
208 globus_result_t
209 wsseu_AttributedDateTime_array_copy_wrapper(
210     void **                             dest_arr,
211     const void *                        src_arr)
212 0 {
213 0     return wsseu_AttributedDateTime_array_copy(
214         (wsseu_AttributedDateTime_array **) dest_arr,
215         (const wsseu_AttributedDateTime_array *) src_arr);
216 }
217
218 globus_result_t
219 wsseu_AttributedDateTime_array_init_contents_wrapper(
220     void *                              arr)
221 0 {
222 0     return wsseu_AttributedDateTime_array_init_contents(
223         (wsseu_AttributedDateTime_array *) arr);
224 }
225
226 void
227 wsseu_AttributedDateTime_array_destroy_contents_wrapper(
228     void *                              arr)
229 0 {
230 0     wsseu_AttributedDateTime_array_destroy_contents(
231         (wsseu_AttributedDateTime_array *) arr);
232 }
233
234 globus_result_t
235 wsseu_AttributedDateTime_array_copy_contents_wrapper(
236     void *                              dest_arr,
237     const void *                        src_arr)
238 0 {
239 0     return wsseu_AttributedDateTime_array_copy_contents(
240         (wsseu_AttributedDateTime_array *) dest_arr,
241         (const wsseu_AttributedDateTime_array *) src_arr);
242 }
243
244 struct globus_xsd_type_info_s wsseu_AttributedDateTime_contents_info =
245 {
246     &wsseu_AttributedDateTime_qname,
247     wsseu_AttributedDateTime_serialize_contents_wrapper,
248     wsseu_AttributedDateTime_deserialize_contents_wrapper,
249     wsseu_AttributedDateTime_init_wrapper,
250     wsseu_AttributedDateTime_destroy_wrapper,
251     wsseu_AttributedDateTime_copy_wrapper,
252     wsseu_AttributedDateTime_init_contents_wrapper,
253     wsseu_AttributedDateTime_destroy_contents_wrapper,
254     wsseu_AttributedDateTime_copy_contents_wrapper,
255     sizeof(wsseu_AttributedDateTime),
256     NULL,
257     NULL,
258     NULL
259 };
260
261 struct globus_xsd_type_info_s wsseu_AttributedDateTime_array_info =
262 {
263     &wsseu_AttributedDateTime_qname,
264     wsseu_AttributedDateTime_array_serialize_wrapper,
265     wsseu_AttributedDateTime_array_deserialize_wrapper,
266     wsseu_AttributedDateTime_array_init_wrapper,
267     wsseu_AttributedDateTime_array_destroy_wrapper,
268     wsseu_AttributedDateTime_array_copy_wrapper,
269     wsseu_AttributedDateTime_array_init_contents_wrapper,
270     wsseu_AttributedDateTime_array_destroy_contents_wrapper,
271     wsseu_AttributedDateTime_array_copy_contents_wrapper,
272     sizeof(wsseu_AttributedDateTime),
273     wsseu_AttributedDateTime_array_push_wrapper,
274     NULL,
275     NULL
276 };
277
278 struct globus_xsd_type_info_s wsseu_AttributedDateTime_info =
279 {
280     &wsseu_AttributedDateTime_qname,
281     wsseu_AttributedDateTime_serialize_wrapper,
282     wsseu_AttributedDateTime_deserialize_pointer_wrapper,
283     wsseu_AttributedDateTime_init_wrapper,
284     wsseu_AttributedDateTime_destroy_wrapper,
285     wsseu_AttributedDateTime_copy_wrapper,
286     wsseu_AttributedDateTime_init_contents_wrapper,
287     wsseu_AttributedDateTime_destroy_contents_wrapper,
288     wsseu_AttributedDateTime_copy_contents_wrapper,
289     sizeof(wsseu_AttributedDateTime),
290     NULL,
291     &wsseu_AttributedDateTime_contents_info,
292     &wsseu_AttributedDateTime_array_info
293 };
294
295 globus_result_t
296 wsseu_AttributedDateTime_init_contents(
297     wsseu_AttributedDateTime * instance)
298 0 {
299 0     globus_result_t                     result = GLOBUS_SUCCESS;
300 0     GlobusFuncName(wsseu_AttributedDateTime_init_contents);
301 0     GlobusSoapMessageDebugEnter();
302
303 0     memset(instance, 0, sizeof(wsseu_AttributedDateTime));
304
305 0     GlobusSoapMessageDebugExit();
306 0     return result;
307 }
308
309 globus_result_t
310 wsseu_AttributedDateTime_init(
311     wsseu_AttributedDateTime ** object)
312 0 {
313 0     wsseu_AttributedDateTime * instance;
314 0     globus_result_t                     result = GLOBUS_SUCCESS;
315 0     GlobusFuncName(wsseu_AttributedDateTime_init);
316 0     GlobusSoapMessageDebugEnter();
317
318 0     instance = globus_malloc(sizeof(wsseu_AttributedDateTime));
319 0     if(!instance)
320     {
321 0         result = GlobusSoapMessageErrorOutOfMemory;
322 0         goto exit;
323     }
324
325 0     memset(instance, 0, sizeof(wsseu_AttributedDateTime));
326
327 0     *object = instance;
328
329  exit:
330 0     GlobusSoapMessageDebugExit();
331 0     return result;
332 }
333
334 void
335 wsseu_AttributedDateTime_destroy(
336     wsseu_AttributedDateTime * instance)
337 0 {
338 0     GlobusFuncName(wsseu_AttributedDateTime_destroy);
339 0     GlobusSoapMessageDebugEnter();
340
341 0     if(!instance)
342     {
343 0         goto exit;
344     }
345
346 0     wsseu_AttributedDateTime_destroy_contents(instance);
347 0     globus_free(instance);
348
349  exit:
350
351 0     GlobusSoapMessageDebugExit();
352 }
353
354
355 void
356 wsseu_AttributedDateTime_destroy_contents(
357     wsseu_AttributedDateTime * instance)
358 0 {
359 0     GlobusFuncName(wsseu_AttributedDateTime_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     if(instance->_Id)
370     {
371 0         xsd_ID_destroy(
372             instance->_Id);
373 0         instance->_Id = NULL;
374     }
375
376 0         xsd_anyAttributes_destroy(instance->anyAttributes);
377 0         instance->anyAttributes = NULL;
378
379     }
380
381 0     GlobusSoapMessageDebugExit();
382 }
383
384
385 globus_result_t
386 wsseu_AttributedDateTime_copy(
387     wsseu_AttributedDateTime ** dest_obj,
388     const wsseu_AttributedDateTime * src_obj)
389 0 {
390 0     globus_result_t                     result = GLOBUS_SUCCESS;
391 0     wsseu_AttributedDateTime * instance;
392 0     GlobusFuncName(wsseu_AttributedDateTime_copy);
393
394 0     GlobusSoapMessageDebugEnter();
395
396 0     instance = calloc(1, sizeof(wsseu_AttributedDateTime));
397 0     if (instance == NULL)
398     {
399 0         GlobusSoapMessageDebugExit();
400 0         return GlobusSoapMessageErrorOutOfMemory;
401     }
402
403 0     result = wsseu_AttributedDateTime_copy_contents(instance, src_obj);
404 0     if(result != GLOBUS_SUCCESS)
405     {
406 0         globus_free(instance);
407 0         GlobusSoapMessageDebugExit();
408 0         return GlobusSoapMessageErrorOutOfMemory;
409     }
410
411 0     *dest_obj = instance;
412 0     GlobusSoapMessageDebugExit();
413 0     return result;
414 }
415
416 globus_result_t
417 wsseu_AttributedDateTime_copy_contents(
418     wsseu_AttributedDateTime * instance,
419     const wsseu_AttributedDateTime * src_obj)
420 0 {
421 0     globus_result_t                     result = GLOBUS_SUCCESS;
422 0     GlobusFuncName(wsseu_AttributedDateTime_copy_contents);
423
424 0     GlobusSoapMessageDebugEnter();
425
426 0     if(src_obj->_Id)
427     {
428 0         result = xsd_ID_copy(
429             &instance->_Id,
430             src_obj->_Id);
431 0         if(result != GLOBUS_SUCCESS)
432         {
433 0             result = GlobusSoapMessageErrorCopyFailed(
434                 result, NULL, &xsd_ID_qname);
435 0             goto _Id_destroy;
436         }
437     }
438     else
439     {
440 0         instance->_Id = NULL;
441     }
442
443 0     if(src_obj->anyAttributes)
444     {
445 0         result = xsd_anyAttributes_copy(&instance->anyAttributes, 
446                                         src_obj->anyAttributes);
447 0         if(result != GLOBUS_SUCCESS)
448         {
449 0             result = GlobusSoapMessageErrorCopyAnyAttrsFailed(
450                 result, NULL);
451 0             goto xsd_anyAttributes_after_destroy;
452         }
453     }
454     else
455     {
456 0         instance->anyAttributes = NULL;
457     }
458
459 0     result = xsd_string_copy_contents(
460         &instance->base_value,
461         &src_obj->base_value);
462 0     if(result != GLOBUS_SUCCESS)
463     {
464 0         result = GlobusSoapMessageErrorCopyFailed(
465             result, NULL,  &xsd_string_qname);
466 0         goto base_value_destroy;
467     }
468
469 0     goto exit;
470
471  fail_deserialize:
472
473  xsd_anyAttributes_destroy:
474 0         xsd_anyAttributes_destroy(instance->anyAttributes);
475 0         instance->anyAttributes = NULL;
476  xsd_anyAttributes_after_destroy:
477 0         xsd_string_destroy_contents(
478             &instance->base_value);
479
480  base_value_destroy:
481
482  _Id_destroy:
483
484 0     if(instance->_Id)
485     {
486 0         xsd_ID_destroy(
487             instance->_Id);
488 0         instance->_Id = NULL;
489     }
490
491
492  exit:
493
494 0     GlobusSoapMessageDebugExit();
495 0     return result;
496 }
497
498
499
500 globus_result_t
501 wsseu_AttributedDateTime_serialize_contents(
502     const xsd_QName *                   element_qname, /* ignored */
503     const wsseu_AttributedDateTime *              inst,
504     globus_soap_message_handle_t        message_handle,
505     globus_xsd_element_options_t        options)
506 0 {
507 0     globus_result_t                     result = GLOBUS_SUCCESS;
508 0     GlobusFuncName(wsseu_AttributedDateTime_serialize_contents);
509 0     GlobusSoapMessageDebugEnter();
510
511 0     result = wsseu_AttributedDateTime_serialize(
512         NULL,
513         inst,
514         message_handle,
515         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
516 0     if(result != GLOBUS_SUCCESS)
517     {
518 0         result = GlobusSoapMessageErrorSerializeFailed(
519             result, NULL, element_qname);
520         goto exit;
521     }
522
523  exit:
524
525 0     GlobusSoapMessageDebugExit();
526 0     return result;
527 }
528
529
530
531 globus_result_t
532 wsseu_AttributedDateTime_serialize(
533     const xsd_QName *                   element_qname,
534     const wsseu_AttributedDateTime *              instance,
535     globus_soap_message_handle_t        message_handle,
536     globus_xsd_element_options_t        options)
537 0 {
538 0     globus_result_t                     result = GLOBUS_SUCCESS;
539 0     xsd_QName                           subelement;
540 0     globus_list_t *                     any_attr_keys = NULL;
541 0     globus_list_t *                     any_attr_keys_iterator = NULL;
542 0     xsd_QName *                         type_attr = NULL;
543
544 0     char *                              prefix = NULL;
545 0     int                                 prefix_created;
546 0     int                                 define_prefix = 0;
547 0     int                                 save_options = options;
548
549 0     GlobusFuncName(wsseu_AttributedDateTime_serialize);
550 0     GlobusSoapMessageDebugEnter();
551
552
553 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
554     {
555         /* serialize wsseu_AttributedDateTime element */
556 0 result = globus_soap_message_element_ns_set(
557             message_handle,
558             element_qname,
559             element_qname->Namespace,
560             &options);
561 0         if(result != GLOBUS_SUCCESS)
562         {
563 0             result = GlobusSoapMessageErrorSerializeFailed(
564                 result, NULL, element_qname);
565 0             goto exit;
566         }
567
568 0         if(instance->_Id)
569         {
570
571 0         result = globus_soap_message_attribute_ns_set(
572             message_handle,
573             element_qname,
574             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
575              &options);
576
577 0         if(result != GLOBUS_SUCCESS)
578         {
579 0             xsd_QName               error_qname;
580 0             error_qname.local = prefix;
581 0             error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
582 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
583                                                            NULL, 
584                                                            &error_qname);
585 0             goto exit;
586         }
587
588
589         }
590
591 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
592    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
593         {
594 0             result = globus_soap_message_attribute_ns_set(
595                 message_handle,
596                 element_qname,
597                 "http://www.w3.org/2001/XMLSchema-instance",
598                 &options);
599 0             if(result != GLOBUS_SUCCESS)
600             {
601 0                 result = GlobusSoapMessageErrorSerializeFailed(
602                     result, NULL, element_qname);
603 0                 goto exit;
604             }
605         }
606
607 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
608    !globus_soap_message_serialize_is_c14n_subset(message_handle))
609         {
610
611 0             result = globus_soap_message_attribute_ns_set(
612                 message_handle,
613                 element_qname,
614                 wsseu_AttributedDateTime_qname.Namespace,
615                 &options);
616 0             if(result != GLOBUS_SUCCESS)
617             {
618 0                 result = GlobusSoapMessageErrorSerializeFailed(
619                     result, NULL, element_qname);
620 0                 goto exit;
621             }
622         }
623
624 0         result = xsd_anyAttributes_namespace_set(
625             message_handle, element_qname, instance->anyAttributes, &options);
626 0         if(result != GLOBUS_SUCCESS)
627         {
628 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
629                 result, "Failed to set namespace");
630 0             goto exit;
631         }
632
633 0         result = globus_soap_message_serialize_element(
634             message_handle,
635             element_qname,
636             options,
637             &wsseu_AttributedDateTime_qname);
638 0         if(result != GLOBUS_SUCCESS)
639         {
640 0             result = GlobusSoapMessageErrorSerializeFailed(
641                 result, NULL, element_qname);
642 0             goto exit;
643         }
644
645 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
646    !globus_soap_message_serialize_is_c14n_subset(message_handle))
647         {
648 0            xsd_QName_init(&type_attr);
649        
650 0            type_attr->local = globus_libc_strdup("type");
651 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
652         }
653
654
655         /* serialize namespaces */
656 0 result = globus_soap_message_element_ns_add(
657             message_handle,
658             element_qname,
659             element_qname->Namespace,
660             &options);
661 0         if(result != GLOBUS_SUCCESS)
662         {
663 0             result = GlobusSoapMessageErrorSerializeFailed(
664                 result, NULL, element_qname);
665 0             goto exit;
666         }
667
668 0         if(instance->_Id)
669         {
670
671 0         result = globus_soap_message_attribute_ns_add(
672             message_handle,
673             element_qname,
674             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
675              &options);
676
677 0         if(result != GLOBUS_SUCCESS)
678         {
679 0             xsd_QName               error_qname;
680 0             error_qname.local = prefix;
681 0             error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
682 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
683                                                            NULL, 
684                                                            &error_qname);
685 0             goto exit;
686         }
687
688
689         }
690
691 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
692    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
693         {
694 0             result = globus_soap_message_attribute_ns_add(
695                 message_handle,
696                 element_qname,
697                 "http://www.w3.org/2001/XMLSchema-instance",
698                 &options);
699 0             if(result != GLOBUS_SUCCESS)
700             {
701 0                 result = GlobusSoapMessageErrorSerializeFailed(
702                     result, NULL, element_qname);
703 0                 goto exit;
704             }
705         }
706 0         if ((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
707    !globus_soap_message_serialize_is_c14n_subset(message_handle))
708         {
709
710 0             result = globus_soap_message_attribute_ns_add(
711                 message_handle,
712                 element_qname,
713                 wsseu_AttributedDateTime_qname.Namespace,
714                 &options);
715 0             if(result != GLOBUS_SUCCESS)
716             {
717 0                 result = GlobusSoapMessageErrorSerializeFailed(
718                     result, NULL, element_qname);
719 0                 goto exit;
720             }
721         }
722
723 0         result = xsd_anyAttributes_namespace_add(
724             message_handle, element_qname, instance->anyAttributes, &options);
725 0         if(result != GLOBUS_SUCCESS)
726         {
727 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
728                 result, "Failed to add namespace");
729 0             goto exit;
730         }
731
732         /* serialize attributes */
733
734 0         subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
735 0         subelement.local = "Id";
736
737 0         if(instance->_Id)
738         {
739
740 0         result = xsd_ID_serialize_attribute(
741             &subelement,
742             instance->_Id,
743             message_handle,
744             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
745 0         if(result != GLOBUS_SUCCESS)
746         {
747 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
748                                                            NULL, 
749                                                            element_qname);
750 0             goto exit;
751         }
752
753         }
754
755 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
756    !globus_soap_message_serialize_is_c14n_subset(message_handle))
757         {
758 0             result = globus_soap_message_serialize_QName_attribute(
759                 message_handle,
760                 type_attr,
761                 &wsseu_AttributedDateTime_qname);
762 0             if(result != GLOBUS_SUCCESS)
763             {
764 0                 result = GlobusSoapMessageErrorSerializeFailed(
765                     result, NULL, element_qname);
766 0                 goto exit;
767             }
768         }
769
770 0         if(instance->anyAttributes)
771         {
772 0             any_attr_keys = xsd_anyAttributes_lex_sort(
773                 instance->anyAttributes);
774 0             any_attr_keys_iterator = any_attr_keys;
775         }
776
777
778     }
779
780 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
781     {
782 0         result = globus_soap_message_serialize_element_begin_close(
783             message_handle, element_qname);
784 0         if(result != GLOBUS_SUCCESS)
785         {
786 0             result = GlobusSoapMessageErrorSerializeFailed(
787                 result, NULL, element_qname);
788 0             goto exit;
789         }
790     }
791 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
792
793
794     /* serialize contents of type */
795
796 0     subelement.local = "base_value";
797 0     subelement.Namespace = NULL;
798
799 0     result = xsd_string_serialize(
800         &subelement,
801         &instance->base_value,
802         message_handle,
803         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
804 0     if(result != GLOBUS_SUCCESS)
805     {
806 0         result = GlobusSoapMessageErrorSerializeFailed(
807             result, NULL,  &xsd_string_qname);
808 0         goto exit;
809     }
810
811 0     options = save_options;
812
813 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
814     {
815         /* add end element */
816 0         result = globus_soap_message_serialize_element_end(
817             message_handle,
818             element_qname,
819             options,
820             &wsseu_AttributedDateTime_qname);
821 0         if(result != GLOBUS_SUCCESS)
822         {
823 0             result = GlobusSoapMessageErrorSerializeFailed(
824                 result, NULL, element_qname);
825 0             goto exit;
826         }
827
828 0         globus_soap_message_element_ns_remove(
829             message_handle,
830             element_qname->Namespace,
831             &options);
832
833     /* remove namespace/prefix mappings for these types */
834
835 0         if(instance->_Id)
836         {
837
838 0         globus_soap_message_attribute_ns_remove(
839             message_handle,
840             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
841              &options);
842
843         }
844
845 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
846    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
847         {
848 0             globus_soap_message_attribute_ns_remove(
849                 message_handle,
850                 "http://www.w3.org/2001/XMLSchema-instance",
851                 &options);
852         }           
853 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
854    !globus_soap_message_serialize_is_c14n_subset(message_handle))
855         {
856 0             globus_soap_message_attribute_ns_remove(
857                 message_handle,
858                 wsseu_AttributedDateTime_qname.Namespace,
859                 &options);
860         }           
861
862 0         result = xsd_anyAttributes_namespace_remove(
863             message_handle, instance->anyAttributes, &options);
864 0         if(result != GLOBUS_SUCCESS)
865         {
866 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
867                 result, "Failed to remove namespace");
868             goto exit;
869         }
870
871     }
872
873  exit:
874 0     if (type_attr)
875     {
876 0         xsd_QName_destroy(type_attr);
877     }
878
879
880 0     if(any_attr_keys)
881     {
882 0         globus_list_free(any_attr_keys);
883     }
884
885 0     GlobusSoapMessageDebugExit();
886 0     return result;
887 }
888
889
890
891 globus_result_t
892 wsseu_AttributedDateTime_deserialize_contents(
893     const xsd_QName *                   element_qname, /* ignored */
894     wsseu_AttributedDateTime *                    inst,
895     globus_soap_message_handle_t        message_handle,
896     globus_xsd_element_options_t        options)
897 0 {
898 0     globus_result_t                     result = GLOBUS_SUCCESS;
899 0     GlobusFuncName(wsseu_AttributedDateTime_deserialize_contents);
900 0     GlobusSoapMessageDebugEnter();
901
902 0     result = wsseu_AttributedDateTime_deserialize(
903         NULL,
904         inst,
905         message_handle,
906         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
907 0     if(result != GLOBUS_SUCCESS)
908     {
909 0         result = GlobusSoapMessageErrorDeserializeFailed(
910             result, element_qname);
911         goto exit;
912     }
913
914  exit:
915
916 0     GlobusSoapMessageDebugExit();
917 0     return result;
918 }
919
920
921
922 globus_result_t
923 wsseu_AttributedDateTime_deserialize(
924     const xsd_QName *                   element_qname,
925     wsseu_AttributedDateTime *                    instance,
926     globus_soap_message_handle_t        message_handle,
927     globus_xsd_element_options_t        options)
928 0 {
929 0     globus_result_t                     result = GLOBUS_SUCCESS;
930 0     xsd_QName                           subelement;
931 0     GlobusFuncName(wsseu_AttributedDateTime_deserialize);
932 0     GlobusSoapMessageDebugEnter();
933
934
935 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
936     {
937 0         result = globus_soap_message_deserialize_element(
938             message_handle, element_qname);
939 0         if(result != GLOBUS_SUCCESS)
940         {
941 0             result = GlobusSoapMessageErrorDeserializeFailed(
942                 result, element_qname);
943 0             goto exit;
944         }
945
946 0     subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
947 0     subelement.local = "Id";
948
949 0     result = xsd_ID_deserialize_attribute_pointer(
950         &subelement,
951         &instance->_Id,
952         message_handle,
953         0);
954 0     if(result != GLOBUS_SUCCESS)
955     {
956 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
957 0         goto _Id_destroy;
958     }
959
960
961 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
962 0         if(result != GLOBUS_SUCCESS)
963         {
964 0             result = GlobusSoapMessageErrorDeserializeFailed(
965                 result, element_qname);
966 0             goto xsd_anyAttributes_after_destroy;
967         }
968
969 0         result = xsd_anyAttributes_deserialize(
970             message_handle,
971             instance->anyAttributes);
972 0         if(result != GLOBUS_SUCCESS)
973         {
974 0             result = GlobusSoapMessageErrorDeserializeFailed(
975                 result, element_qname);
976 0             goto xsd_anyAttributes_destroy;
977         }
978
979
980 0         result = globus_soap_message_deserialize_element_begin_close(
981             message_handle);
982 0         if(result != GLOBUS_SUCCESS)
983         {
984 0             result = GlobusSoapMessageErrorDeserializeFailed(
985                 result, element_qname);
986 0             goto fail_deserialize;
987         }
988     }
989
990 0     subelement.local = "base_value";
991 0     subelement.Namespace = NULL;
992
993 0     result = xsd_string_deserialize(
994         &subelement,
995         &instance->base_value,
996         message_handle,
997         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
998 0     if(result != GLOBUS_SUCCESS)
999     {
1000 0         result = GlobusSoapMessageErrorDeserializeFailed(
1001             result,
1002             &xsd_string_qname);
1003 0         goto base_value_destroy;
1004     }
1005
1006 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1007     {
1008 0         result = globus_soap_message_deserialize_element_end(
1009             message_handle,
1010             element_qname);
1011 0         if(result != GLOBUS_SUCCESS)
1012         {
1013 0             result = GlobusSoapMessageErrorDeserializeFailed(
1014                 result, element_qname);
1015             goto fail_deserialize;
1016         }
1017     }
1018
1019 0     goto exit;
1020
1021  fail_deserialize:
1022
1023  xsd_anyAttributes_destroy:
1024 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1025 0         instance->anyAttributes = NULL;
1026  xsd_anyAttributes_after_destroy:
1027 0         xsd_string_destroy_contents(
1028             &instance->base_value);
1029
1030  base_value_destroy:
1031
1032  _Id_destroy:
1033     /* output_fail_destroy_attribute() */
1034
1035 0     if(instance->_Id)
1036     {
1037 0         xsd_ID_destroy(
1038             instance->_Id);
1039 0         instance->_Id = NULL;
1040     }
1041
1042
1043  exit:
1044
1045 0     GlobusSoapMessageDebugExit();
1046 0     return result;
1047 }
1048
1049
1050
1051 globus_result_t
1052 wsseu_AttributedDateTime_deserialize_pointer(
1053     const xsd_QName *                   element_qname,
1054     wsseu_AttributedDateTime **                   ip,
1055     globus_soap_message_handle_t        message_handle,
1056     globus_xsd_element_options_t        options)
1057 0 {
1058 0     wsseu_AttributedDateTime * instance = NULL;
1059 0     globus_result_t                     result = GLOBUS_SUCCESS;
1060 0     xsd_QName                           subelement;
1061 0     int                                 found_attrs = 0;
1062 0     int                                 empty_element = 0;
1063 0     GlobusFuncName(wsseu_AttributedDateTime_deserialize_pointer);
1064 0     GlobusSoapMessageDebugEnter();
1065
1066 0     *ip = NULL;
1067
1068 0     result = globus_soap_message_deserialize_element(
1069         message_handle, element_qname);
1070 0     if(result != GLOBUS_SUCCESS &&
1071        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1072         GlobusSoapMessageStatusFailedElementCheck(result) ||
1073         GlobusSoapMessageStatusFailedWithTextCheck(result)))
1074     {
1075 0         result = GLOBUS_SUCCESS;
1076 0         goto exit;
1077     }
1078
1079 0     if(result != GLOBUS_SUCCESS)
1080     {
1081 0         result = GlobusSoapMessageErrorDeserializeFailed(
1082             result, element_qname);
1083 0         goto exit;
1084     }
1085
1086 0     if(globus_soap_message_deserialize_element_is_empty(
1087            message_handle))
1088     {
1089 0         empty_element = 1;
1090     }
1091
1092 0     result = wsseu_AttributedDateTime_init(&instance);
1093 0     if(result != GLOBUS_SUCCESS)
1094     {
1095 0         result = GlobusSoapMessageErrorDeserializeFailed(
1096             result, element_qname);
1097 0         goto exit;
1098     }
1099
1100
1101 0     subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
1102 0     subelement.local = "Id";
1103
1104 0     result = xsd_ID_deserialize_attribute_pointer(
1105         &subelement,
1106         &instance->_Id,
1107         message_handle,
1108         0);
1109 0     if(result != GLOBUS_SUCCESS)
1110     {
1111 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1112 0         goto _Id_destroy;
1113     }
1114
1115
1116 0     if(instance->_Id)
1117     {
1118 0         found_attrs++;
1119     }
1120
1121 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1122 0         if(result != GLOBUS_SUCCESS)
1123         {
1124 0             result = GlobusSoapMessageErrorDeserializeFailed(
1125                 result, element_qname);
1126 0             goto xsd_anyAttributes_after_destroy;
1127         }
1128
1129 0         result = xsd_anyAttributes_deserialize(
1130             message_handle,
1131             instance->anyAttributes);
1132 0         if(result != GLOBUS_SUCCESS)
1133         {
1134 0             result = GlobusSoapMessageErrorDeserializeFailed(
1135                 result, element_qname);
1136 0             goto xsd_anyAttributes_destroy;
1137         }
1138
1139 0         if(instance->anyAttributes &&
1140            xsd_anyAttributes_size(instance->anyAttributes) > 0)
1141         {
1142 0             found_attrs++;
1143         }
1144
1145
1146 0     if(empty_element)
1147     {
1148 0         result = globus_soap_message_deserialize_element_end(
1149             message_handle,
1150             element_qname);
1151 0         if(result != GLOBUS_SUCCESS)
1152         {
1153 0             result = GlobusSoapMessageErrorDeserializeFailed(
1154                 result, element_qname);
1155 0             goto fail_deserialize;
1156         }
1157
1158 0         *ip = instance;
1159 0         goto exit;
1160     }
1161
1162 0     result = globus_soap_message_deserialize_element_begin_close(
1163         message_handle);
1164 0     if(result != GLOBUS_SUCCESS)
1165     {
1166 0         result = GlobusSoapMessageErrorDeserializeFailed(
1167             result, element_qname);
1168 0         goto exit;
1169     }
1170
1171 0     result = wsseu_AttributedDateTime_deserialize(
1172             element_qname,
1173             instance,
1174             message_handle,
1175             options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1176
1177 0     result = globus_soap_message_deserialize_element_end(
1178         message_handle,
1179         element_qname);
1180 0     if(result != GLOBUS_SUCCESS)
1181     {
1182 0         result = GlobusSoapMessageErrorDeserializeFailed(
1183             result, element_qname);
1184 0         goto fail_deserialize;
1185     }
1186
1187 0     *ip = instance;
1188
1189 0     goto exit;
1190
1191  fail_deserialize:
1192
1193  xsd_anyAttributes_destroy:
1194 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1195 0         instance->anyAttributes = NULL;
1196  xsd_anyAttributes_after_destroy:
1197 0         xsd_string_destroy_contents(
1198             &instance->base_value);
1199
1200  base_value_destroy:
1201
1202  _Id_destroy:
1203     /* output_fail_destroy_attribute() */
1204
1205 0     if(instance->_Id)
1206     {
1207 0         xsd_ID_destroy(
1208             instance->_Id);
1209 0         instance->_Id = NULL;
1210     }
1211
1212  exit:
1213
1214 0     GlobusSoapMessageDebugExit();
1215 0     return result;
1216 }
1217
1218
1219 globus_result_t
1220 wsseu_AttributedDateTime_array_init_contents(
1221     wsseu_AttributedDateTime_array * array)
1222 0 {
1223 0     return globus_xsd_generic_array_init_contents(
1224         (globus_xsd_generic_array_t *) array,
1225         &wsseu_AttributedDateTime_info);
1226 }
1227 /* wsseu_AttributedDateTime_array_init_contents() */
1228
1229 globus_result_t
1230 wsseu_AttributedDateTime_array_init(
1231     wsseu_AttributedDateTime_array ** arr)
1232 0 {
1233 0     return globus_xsd_generic_array_init(
1234         (globus_xsd_generic_array_t **) arr,
1235         &wsseu_AttributedDateTime_info);
1236 }
1237 /* wsseu_AttributedDateTime_array_init() */
1238
1239 void
1240 wsseu_AttributedDateTime_array_destroy_contents(
1241     wsseu_AttributedDateTime_array * array)
1242 0 {
1243 0     globus_xsd_generic_array_destroy_contents(
1244         (globus_xsd_generic_array_t *) array);
1245 }
1246 /* wsseu_AttributedDateTime_array_destroy_contents() */
1247
1248 void
1249 wsseu_AttributedDateTime_array_destroy(
1250     wsseu_AttributedDateTime_array * array)
1251 0 {
1252 0     globus_xsd_generic_array_destroy(
1253         (globus_xsd_generic_array_t *) array);
1254 }
1255 /* wsseu_AttributedDateTime_array_destroy() */
1256
1257 globus_result_t
1258 wsseu_AttributedDateTime_array_copy(
1259     wsseu_AttributedDateTime_array ** dest_arr,
1260     const wsseu_AttributedDateTime_array * src_arr)
1261 0 {
1262 0     return globus_xsd_generic_array_copy(
1263         (globus_xsd_generic_array_t **) dest_arr,
1264         (globus_xsd_generic_array_t *) src_arr);
1265 }
1266 /* wsseu_AttributedDateTime_array_copy() */
1267
1268 globus_result_t
1269 wsseu_AttributedDateTime_array_copy_contents(
1270     wsseu_AttributedDateTime_array * dest_arr,
1271     const wsseu_AttributedDateTime_array * src_arr)
1272 0 {
1273 0     return globus_xsd_generic_array_copy_contents(
1274         (globus_xsd_generic_array_t *) dest_arr,
1275         (globus_xsd_generic_array_t *) src_arr);
1276 }
1277 /* wsseu_AttributedDateTime_array_copy_contents() */
1278
1279 wsseu_AttributedDateTime *
1280 wsseu_AttributedDateTime_array_push(
1281     wsseu_AttributedDateTime_array * array)
1282 0 {
1283     /* Some contents initializers don't initialize subelments but to set their
1284      * values to be NULL
1285      */
1286 0     if (array->type_info == NULL)
1287     {
1288 0         array->type_info = &wsseu_AttributedDateTime_info;
1289     }
1290
1291 0     return globus_xsd_generic_array_push(
1292         (globus_xsd_generic_array_t *) array);
1293 }
1294 /* wsseu_AttributedDateTime_array_push() */
1295
1296 void *
1297 wsseu_AttributedDateTime_array_push_wrapper(
1298     void * array)
1299 0 {
1300 0     return (void *) wsseu_AttributedDateTime_array_push((wsseu_AttributedDateTime_array *) array);
1301 }
1302
1303 globus_result_t
1304 wsseu_AttributedDateTime_array_serialize(
1305     const xsd_QName *                   element_qname,
1306     const wsseu_AttributedDateTime_array *        array,
1307     globus_soap_message_handle_t        message,
1308     globus_xsd_element_options_t        options)
1309 0 {
1310 0     return globus_xsd_generic_array_serialize(
1311         element_qname,
1312         (const globus_xsd_generic_array_t *) array,
1313         message,
1314         options);
1315 }
1316 /* wsseu_AttributedDateTime_array_serialize() */
1317
1318 globus_result_t
1319 wsseu_AttributedDateTime_array_deserialize(
1320     const xsd_QName *                   element_qname,
1321     wsseu_AttributedDateTime_array * array,
1322     globus_soap_message_handle_t        message,
1323     globus_xsd_element_options_t        options)
1324 0 {
1325     /* Some initializers set the array's contents to NULL */
1326 0     if (array->type_info == NULL)
1327     {
1328 0         array->type_info = &wsseu_AttributedDateTime_info;
1329     }
1330 0     return globus_xsd_generic_array_deserialize(
1331         element_qname,
1332         (globus_xsd_generic_array_t *) array,
1333         message,
1334         options);