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