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 "wsrl_TerminationNotificationType.h"
26
27 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
28 xsd_QName wsrl_TerminationNotificationType_qname =
29 {
30     WSRL_TERMINATIONNOTIFICATIONTYPE_NS,
31     WSRL_TERMINATIONNOTIFICATIONTYPE_LOCAL
32 };
33 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
34
35 globus_result_t
36 wsrl_TerminationNotificationType_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 wsrl_TerminationNotificationType_serialize(
43         element_qname,
44         (const wsrl_TerminationNotificationType *) instance,
45         message_handle, options);
46 }
47
48 globus_result_t
49 wsrl_TerminationNotificationType_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 wsrl_TerminationNotificationType_deserialize_pointer(
56         element_qname,
57         (wsrl_TerminationNotificationType **) ip,
58         message_handle, options);
59 }
60
61 globus_result_t
62 wsrl_TerminationNotificationType_init_wrapper(void **object)
63 0 {
64 0     return wsrl_TerminationNotificationType_init(
65         (wsrl_TerminationNotificationType **) object);
66 }
67
68 void
69 wsrl_TerminationNotificationType_destroy_wrapper(
70     void *                          object)
71 0 {
72 0     wsrl_TerminationNotificationType_destroy(
73         (wsrl_TerminationNotificationType *) object);
74 }
75
76 globus_result_t
77 wsrl_TerminationNotificationType_copy_wrapper(
78     void **                         dest_obj,
79     const void *                    src_obj)
80 0 {
81 0     return wsrl_TerminationNotificationType_copy(
82         (wsrl_TerminationNotificationType **) dest_obj,
83         (wsrl_TerminationNotificationType *) src_obj);
84 }
85
86 globus_result_t
87 wsrl_TerminationNotificationType_init_contents_wrapper(void *object)
88 0 {
89 0     return wsrl_TerminationNotificationType_init_contents(
90         (wsrl_TerminationNotificationType *) object);
91 }
92
93 void
94 wsrl_TerminationNotificationType_destroy_contents_wrapper(
95     void *                          object)
96 0 {
97 0     wsrl_TerminationNotificationType_destroy_contents(
98         (wsrl_TerminationNotificationType *) object);
99 }
100
101 globus_result_t
102 wsrl_TerminationNotificationType_copy_contents_wrapper(
103     void *                          dest_obj,
104     const void *                    src_obj)
105 0 {
106 0     return wsrl_TerminationNotificationType_copy_contents(
107         (wsrl_TerminationNotificationType *) dest_obj,
108         (const wsrl_TerminationNotificationType *) src_obj);
109 }
110
111 globus_result_t
112 wsrl_TerminationNotificationType_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 wsrl_TerminationNotificationType_serialize_contents(
119         element_qname,
120         (wsrl_TerminationNotificationType *) instance,
121         message_handle, options);
122 }
123
124 globus_result_t
125 wsrl_TerminationNotificationType_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(wsrl_TerminationNotificationType_deserialize_contents_wrapper);
133 0     GlobusSoapMessageDebugEnter();
134
135 0     if(!*instance)
136     {
137 0         result = wsrl_TerminationNotificationType_init(
138             (wsrl_TerminationNotificationType **)instance);
139 0         if(result != GLOBUS_SUCCESS)
140         {
141 0             goto error;
142         }
143     }
144
145 0     result = wsrl_TerminationNotificationType_deserialize_contents(
146         element_qname,
147         *(wsrl_TerminationNotificationType **)instance,
148         message_handle, options);
149 error:
150 0     GlobusSoapMessageDebugExit();
151 0     return result;
152 }
153
154 globus_result_t
155 wsrl_TerminationNotificationType_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 wsrl_TerminationNotificationType_array_serialize(
162         element,
163         (wsrl_TerminationNotificationType_array *) instance,
164         message, options);
165 }
166
167 globus_result_t
168 wsrl_TerminationNotificationType_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 = wsrl_TerminationNotificationType_array_init(
179             (wsrl_TerminationNotificationType_array **)inst);
180 0         if(result != GLOBUS_SUCCESS)
181         {
182 0             return result;
183         }
184     }
185
186 0     return wsrl_TerminationNotificationType_array_deserialize(
187         element_qname,
188         *(wsrl_TerminationNotificationType_array **) inst,
189         message, options);
190 }
191
192 globus_result_t
193 wsrl_TerminationNotificationType_array_init_wrapper(
194     void **                             arr)
195 0 {
196 0     return wsrl_TerminationNotificationType_array_init(
197         (wsrl_TerminationNotificationType_array **) arr);
198 }
199
200 void
201 wsrl_TerminationNotificationType_array_destroy_wrapper(
202     void *                              arr)
203 0 {
204 0     wsrl_TerminationNotificationType_array_destroy(
205         (wsrl_TerminationNotificationType_array *) arr);
206 }
207
208 globus_result_t
209 wsrl_TerminationNotificationType_array_copy_wrapper(
210     void **                             dest_arr,
211     const void *                        src_arr)
212 0 {
213 0     return wsrl_TerminationNotificationType_array_copy(
214         (wsrl_TerminationNotificationType_array **) dest_arr,
215         (const wsrl_TerminationNotificationType_array *) src_arr);
216 }
217
218 globus_result_t
219 wsrl_TerminationNotificationType_array_init_contents_wrapper(
220     void *                              arr)
221 0 {
222 0     return wsrl_TerminationNotificationType_array_init_contents(
223         (wsrl_TerminationNotificationType_array *) arr);
224 }
225
226 void
227 wsrl_TerminationNotificationType_array_destroy_contents_wrapper(
228     void *                              arr)
229 0 {
230 0     wsrl_TerminationNotificationType_array_destroy_contents(
231         (wsrl_TerminationNotificationType_array *) arr);
232 }
233
234 globus_result_t
235 wsrl_TerminationNotificationType_array_copy_contents_wrapper(
236     void *                              dest_arr,
237     const void *                        src_arr)
238 0 {
239 0     return wsrl_TerminationNotificationType_array_copy_contents(
240         (wsrl_TerminationNotificationType_array *) dest_arr,
241         (const wsrl_TerminationNotificationType_array *) src_arr);
242 }
243
244 struct globus_xsd_type_info_s wsrl_TerminationNotificationType_contents_info =
245 {
246     &wsrl_TerminationNotificationType_qname,
247     wsrl_TerminationNotificationType_serialize_contents_wrapper,
248     wsrl_TerminationNotificationType_deserialize_contents_wrapper,
249     wsrl_TerminationNotificationType_init_wrapper,
250     wsrl_TerminationNotificationType_destroy_wrapper,
251     wsrl_TerminationNotificationType_copy_wrapper,
252     wsrl_TerminationNotificationType_init_contents_wrapper,
253     wsrl_TerminationNotificationType_destroy_contents_wrapper,
254     wsrl_TerminationNotificationType_copy_contents_wrapper,
255     sizeof(wsrl_TerminationNotificationType),
256     NULL,
257     NULL,
258     NULL
259 };
260
261 struct globus_xsd_type_info_s wsrl_TerminationNotificationType_array_info =
262 {
263     &wsrl_TerminationNotificationType_qname,
264     wsrl_TerminationNotificationType_array_serialize_wrapper,
265     wsrl_TerminationNotificationType_array_deserialize_wrapper,
266     wsrl_TerminationNotificationType_array_init_wrapper,
267     wsrl_TerminationNotificationType_array_destroy_wrapper,
268     wsrl_TerminationNotificationType_array_copy_wrapper,
269     wsrl_TerminationNotificationType_array_init_contents_wrapper,
270     wsrl_TerminationNotificationType_array_destroy_contents_wrapper,
271     wsrl_TerminationNotificationType_array_copy_contents_wrapper,
272     sizeof(wsrl_TerminationNotificationType),
273     wsrl_TerminationNotificationType_array_push_wrapper,
274     NULL,
275     NULL
276 };
277
278 struct globus_xsd_type_info_s wsrl_TerminationNotificationType_info =
279 {
280     &wsrl_TerminationNotificationType_qname,
281     wsrl_TerminationNotificationType_serialize_wrapper,
282     wsrl_TerminationNotificationType_deserialize_pointer_wrapper,
283     wsrl_TerminationNotificationType_init_wrapper,
284     wsrl_TerminationNotificationType_destroy_wrapper,
285     wsrl_TerminationNotificationType_copy_wrapper,
286     wsrl_TerminationNotificationType_init_contents_wrapper,
287     wsrl_TerminationNotificationType_destroy_contents_wrapper,
288     wsrl_TerminationNotificationType_copy_contents_wrapper,
289     sizeof(wsrl_TerminationNotificationType),
290     NULL,
291     &wsrl_TerminationNotificationType_contents_info,
292     &wsrl_TerminationNotificationType_array_info
293 };
294
295 globus_result_t
296 wsrl_TerminationNotificationType_init_contents(
297     wsrl_TerminationNotificationType * instance)
298 0 {
299 0     globus_result_t                     result = GLOBUS_SUCCESS;
300 0     GlobusFuncName(wsrl_TerminationNotificationType_init_contents);
301 0     GlobusSoapMessageDebugEnter();
302
303 0     memset(instance, 0, sizeof(wsrl_TerminationNotificationType));
304
305 0     GlobusSoapMessageDebugExit();
306 0     return result;
307 }
308
309 globus_result_t
310 wsrl_TerminationNotificationType_init(
311     wsrl_TerminationNotificationType ** object)
312 0 {
313 0     wsrl_TerminationNotificationType * instance;
314 0     globus_result_t                     result = GLOBUS_SUCCESS;
315 0     GlobusFuncName(wsrl_TerminationNotificationType_init);
316 0     GlobusSoapMessageDebugEnter();
317
318 0     instance = globus_malloc(sizeof(wsrl_TerminationNotificationType));
319 0     if(!instance)
320     {
321 0         result = GlobusSoapMessageErrorOutOfMemory;
322 0         goto exit;
323     }
324
325 0     memset(instance, 0, sizeof(wsrl_TerminationNotificationType));
326
327 0     *object = instance;
328
329  exit:
330 0     GlobusSoapMessageDebugExit();
331 0     return result;
332 }
333
334 void
335 wsrl_TerminationNotificationType_destroy(
336     wsrl_TerminationNotificationType * instance)
337 0 {
338 0     GlobusFuncName(wsrl_TerminationNotificationType_destroy);
339 0     GlobusSoapMessageDebugEnter();
340
341 0     if(!instance)
342     {
343 0         goto exit;
344     }
345
346 0     wsrl_TerminationNotificationType_destroy_contents(instance);
347 0     globus_free(instance);
348
349  exit:
350
351 0     GlobusSoapMessageDebugExit();
352 }
353
354
355 void
356 wsrl_TerminationNotificationType_destroy_contents(
357     wsrl_TerminationNotificationType * instance)
358 0 {
359 0     GlobusFuncName(wsrl_TerminationNotificationType_destroy_contents);
360 0     GlobusSoapMessageDebugEnter();
361
362 0     if(instance)
363     {
364
365
366 0     xsd_dateTime_destroy_contents(
367          &instance->TerminationTime);
368
369 0     xsd_anyType_destroy(instance->TerminationReason);
370 0     instance->TerminationReason = NULL;
371
372     }
373
374 0     GlobusSoapMessageDebugExit();
375 }
376
377
378 globus_result_t
379 wsrl_TerminationNotificationType_copy(
380     wsrl_TerminationNotificationType ** dest_obj,
381     const wsrl_TerminationNotificationType * src_obj)
382 0 {
383 0     globus_result_t                     result = GLOBUS_SUCCESS;
384 0     wsrl_TerminationNotificationType * instance;
385 0     GlobusFuncName(wsrl_TerminationNotificationType_copy);
386
387 0     GlobusSoapMessageDebugEnter();
388
389 0     instance = calloc(1, sizeof(wsrl_TerminationNotificationType));
390 0     if (instance == NULL)
391     {
392 0         GlobusSoapMessageDebugExit();
393 0         return GlobusSoapMessageErrorOutOfMemory;
394     }
395
396 0     result = wsrl_TerminationNotificationType_copy_contents(instance, src_obj);
397 0     if(result != GLOBUS_SUCCESS)
398     {
399 0         globus_free(instance);
400 0         GlobusSoapMessageDebugExit();
401 0         return GlobusSoapMessageErrorOutOfMemory;
402     }
403
404 0     *dest_obj = instance;
405 0     GlobusSoapMessageDebugExit();
406 0     return result;
407 }
408
409 globus_result_t
410 wsrl_TerminationNotificationType_copy_contents(
411     wsrl_TerminationNotificationType * instance,
412     const wsrl_TerminationNotificationType * src_obj)
413 0 {
414 0     globus_result_t                     result = GLOBUS_SUCCESS;
415 0     GlobusFuncName(wsrl_TerminationNotificationType_copy_contents);
416
417 0     GlobusSoapMessageDebugEnter();
418
419 0     result = xsd_dateTime_copy_contents(
420         &instance->TerminationTime,
421         &src_obj->TerminationTime);
422 0     if(result != GLOBUS_SUCCESS)
423     {
424 0         result = GlobusSoapMessageErrorCopyFailed(
425                 result, NULL, &xsd_dateTime_qname);
426 0         goto TerminationTime_destroy;
427     }
428
429 0     if(src_obj->TerminationReason)
430     {
431 0         result = xsd_anyType_copy(
432             &instance->TerminationReason,
433             src_obj->TerminationReason);
434 0         if(result != GLOBUS_SUCCESS)
435         {
436 0             result = GlobusSoapMessageErrorCopyFailed(
437                 result, NULL, &xsd_anyType_qname);
438 0             goto TerminationReason_destroy_pointer;
439         }
440     }
441     else
442     {
443 0         instance->TerminationReason = NULL;
444     }
445
446 0     goto exit;
447
448  fail_deserialize:
449 0         xsd_anyType_destroy(
450             instance->TerminationReason);
451 0          instance->TerminationReason = NULL;
452
453  TerminationReason_destroy_pointer:
454 0         xsd_dateTime_destroy_contents(
455              &instance->TerminationTime);
456
457  TerminationTime_destroy:
458
459
460  exit:
461
462 0     GlobusSoapMessageDebugExit();
463 0     return result;
464 }
465
466
467
468 globus_result_t
469 wsrl_TerminationNotificationType_serialize_contents(
470     const xsd_QName *                   element_qname, /* ignored */
471     const wsrl_TerminationNotificationType *              inst,
472     globus_soap_message_handle_t        message_handle,
473     globus_xsd_element_options_t        options)
474 0 {
475 0     globus_result_t                     result = GLOBUS_SUCCESS;
476 0     GlobusFuncName(wsrl_TerminationNotificationType_serialize_contents);
477 0     GlobusSoapMessageDebugEnter();
478
479 0     result = wsrl_TerminationNotificationType_serialize(
480         NULL,
481         inst,
482         message_handle,
483         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
484 0     if(result != GLOBUS_SUCCESS)
485     {
486 0         result = GlobusSoapMessageErrorSerializeFailed(
487             result, NULL, element_qname);
488         goto exit;
489     }
490
491  exit:
492
493 0     GlobusSoapMessageDebugExit();
494 0     return result;
495 }
496
497
498
499 globus_result_t
500 wsrl_TerminationNotificationType_serialize(
501     const xsd_QName *                   element_qname,
502     const wsrl_TerminationNotificationType *              instance,
503     globus_soap_message_handle_t        message_handle,
504     globus_xsd_element_options_t        options)
505 0 {
506 0     globus_result_t                     result = GLOBUS_SUCCESS;
507 0     xsd_QName                           subelement;
508 0     globus_list_t *                     any_attr_keys = NULL;
509 0     globus_list_t *                     any_attr_keys_iterator = NULL;
510 0     xsd_QName *                         type_attr = NULL;
511
512 0     char *                              prefix = NULL;
513 0     int                                 prefix_created;
514 0     int                                 define_prefix = 0;
515 0     int                                 save_options = options;
516
517 0     GlobusFuncName(wsrl_TerminationNotificationType_serialize);
518 0     GlobusSoapMessageDebugEnter();
519
520
521 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
522     {
523         /* serialize wsrl_TerminationNotificationType element */
524 0 result = globus_soap_message_element_ns_set(
525             message_handle,
526             element_qname,
527             element_qname->Namespace,
528             &options);
529 0         if(result != GLOBUS_SUCCESS)
530         {
531 0             result = GlobusSoapMessageErrorSerializeFailed(
532                 result, NULL, element_qname);
533 0             goto exit;
534         }
535
536 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
537    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
538         {
539 0             result = globus_soap_message_attribute_ns_set(
540                 message_handle,
541                 element_qname,
542                 "http://www.w3.org/2001/XMLSchema-instance",
543                 &options);
544 0             if(result != GLOBUS_SUCCESS)
545             {
546 0                 result = GlobusSoapMessageErrorSerializeFailed(
547                     result, NULL, element_qname);
548 0                 goto exit;
549             }
550         }
551
552 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
553    !globus_soap_message_serialize_is_c14n_subset(message_handle))
554         {
555
556 0             result = globus_soap_message_attribute_ns_set(
557                 message_handle,
558                 element_qname,
559                 wsrl_TerminationNotificationType_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
569 0         result = globus_soap_message_serialize_element(
570             message_handle,
571             element_qname,
572             options,
573             &wsrl_TerminationNotificationType_qname);
574 0         if(result != GLOBUS_SUCCESS)
575         {
576 0             result = GlobusSoapMessageErrorSerializeFailed(
577                 result, NULL, element_qname);
578 0             goto exit;
579         }
580
581 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
582    !globus_soap_message_serialize_is_c14n_subset(message_handle))
583         {
584 0            xsd_QName_init(&type_attr);
585        
586 0            type_attr->local = globus_libc_strdup("type");
587 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
588         }
589
590
591         /* serialize namespaces */
592 0 result = globus_soap_message_element_ns_add(
593             message_handle,
594             element_qname,
595             element_qname->Namespace,
596             &options);
597 0         if(result != GLOBUS_SUCCESS)
598         {
599 0             result = GlobusSoapMessageErrorSerializeFailed(
600                 result, NULL, element_qname);
601 0             goto exit;
602         }
603
604 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
605    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
606         {
607 0             result = globus_soap_message_attribute_ns_add(
608                 message_handle,
609                 element_qname,
610                 "http://www.w3.org/2001/XMLSchema-instance",
611                 &options);
612 0             if(result != GLOBUS_SUCCESS)
613             {
614 0                 result = GlobusSoapMessageErrorSerializeFailed(
615                     result, NULL, element_qname);
616 0                 goto exit;
617             }
618         }
619 0         if ((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
620    !globus_soap_message_serialize_is_c14n_subset(message_handle))
621         {
622
623 0             result = globus_soap_message_attribute_ns_add(
624                 message_handle,
625                 element_qname,
626                 wsrl_TerminationNotificationType_qname.Namespace,
627                 &options);
628 0             if(result != GLOBUS_SUCCESS)
629             {
630 0                 result = GlobusSoapMessageErrorSerializeFailed(
631                     result, NULL, element_qname);
632 0                 goto exit;
633             }
634         }
635
636         /* serialize attributes */
637
638 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
639    !globus_soap_message_serialize_is_c14n_subset(message_handle))
640         {
641 0             result = globus_soap_message_serialize_QName_attribute(
642                 message_handle,
643                 type_attr,
644                 &wsrl_TerminationNotificationType_qname);
645 0             if(result != GLOBUS_SUCCESS)
646             {
647 0                 result = GlobusSoapMessageErrorSerializeFailed(
648                     result, NULL, element_qname);
649 0                 goto exit;
650             }
651         }
652
653
654     }
655
656 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
657     {
658 0         result = globus_soap_message_serialize_element_begin_close(
659             message_handle, element_qname);
660 0         if(result != GLOBUS_SUCCESS)
661         {
662 0             result = GlobusSoapMessageErrorSerializeFailed(
663                 result, NULL, element_qname);
664 0             goto exit;
665         }
666     }
667 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
668
669
670     /* serialize contents of type */
671
672 0     subelement.local = "TerminationTime";
673 0     subelement.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
674
675 0     result = xsd_dateTime_serialize(
676          &subelement,
677          &instance->TerminationTime,
678          message_handle,
679          options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
680 0     if(result != GLOBUS_SUCCESS)
681     {
682 0         result = GlobusSoapMessageErrorSerializeFailed(
683                 result, NULL, &xsd_dateTime_qname);
684 0         goto exit;
685     }
686
687 0     subelement.local = "TerminationReason";
688 0     subelement.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
689
690 0     if(instance->TerminationReason)
691     {
692 0         result = xsd_anyType_serialize(
693             &subelement,
694             instance->TerminationReason,
695             message_handle,
696             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
697 0         if(result != GLOBUS_SUCCESS)
698         {
699 0             result = GlobusSoapMessageErrorSerializeFailed(
700                 result, NULL, &xsd_anyType_qname);
701 0             goto exit;
702         }
703     }
704
705 0     options = save_options;
706
707 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
708     {
709         /* add end element */
710 0         result = globus_soap_message_serialize_element_end(
711             message_handle,
712             element_qname,
713             options,
714             &wsrl_TerminationNotificationType_qname);
715 0         if(result != GLOBUS_SUCCESS)
716         {
717 0             result = GlobusSoapMessageErrorSerializeFailed(
718                 result, NULL, element_qname);
719 0             goto exit;
720         }
721
722 0         globus_soap_message_element_ns_remove(
723             message_handle,
724             element_qname->Namespace,
725             &options);
726
727     /* remove namespace/prefix mappings for these types */
728
729 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
730    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
731         {
732 0             globus_soap_message_attribute_ns_remove(
733                 message_handle,
734                 "http://www.w3.org/2001/XMLSchema-instance",
735                 &options);
736         }           
737 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
738    !globus_soap_message_serialize_is_c14n_subset(message_handle))
739         {
740 0             globus_soap_message_attribute_ns_remove(
741                 message_handle,
742                 wsrl_TerminationNotificationType_qname.Namespace,
743                 &options);
744         }           
745
746     }
747
748  exit:
749 0     if (type_attr)
750     {
751 0         xsd_QName_destroy(type_attr);
752     }
753
754
755 0     if(any_attr_keys)
756     {
757 0         globus_list_free(any_attr_keys);
758     }
759
760 0     GlobusSoapMessageDebugExit();
761 0     return result;
762 }
763
764
765
766 globus_result_t
767 wsrl_TerminationNotificationType_deserialize_contents(
768     const xsd_QName *                   element_qname, /* ignored */
769     wsrl_TerminationNotificationType *                    inst,
770     globus_soap_message_handle_t        message_handle,
771     globus_xsd_element_options_t        options)
772 0 {
773 0     globus_result_t                     result = GLOBUS_SUCCESS;
774 0     GlobusFuncName(wsrl_TerminationNotificationType_deserialize_contents);
775 0     GlobusSoapMessageDebugEnter();
776
777 0     result = wsrl_TerminationNotificationType_deserialize(
778         NULL,
779         inst,
780         message_handle,
781         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
782 0     if(result != GLOBUS_SUCCESS)
783     {
784 0         result = GlobusSoapMessageErrorDeserializeFailed(
785             result, element_qname);
786         goto exit;
787     }
788
789  exit:
790
791 0     GlobusSoapMessageDebugExit();
792 0     return result;
793 }
794
795
796
797 globus_result_t
798 wsrl_TerminationNotificationType_deserialize(
799     const xsd_QName *                   element_qname,
800     wsrl_TerminationNotificationType *                    instance,
801     globus_soap_message_handle_t        message_handle,
802     globus_xsd_element_options_t        options)
803 0 {
804 0     globus_result_t                     result = GLOBUS_SUCCESS;
805 0     xsd_QName                           subelement;
806 0     GlobusFuncName(wsrl_TerminationNotificationType_deserialize);
807 0     GlobusSoapMessageDebugEnter();
808
809
810 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
811     {
812 0         result = globus_soap_message_deserialize_element(
813             message_handle, element_qname);
814 0         if(result != GLOBUS_SUCCESS)
815         {
816 0             result = GlobusSoapMessageErrorDeserializeFailed(
817                 result, element_qname);
818 0             goto exit;
819         }
820
821
822 0         result = globus_soap_message_deserialize_element_begin_close(
823             message_handle);
824 0         if(result != GLOBUS_SUCCESS)
825         {
826 0             result = GlobusSoapMessageErrorDeserializeFailed(
827                 result, element_qname);
828 0             goto fail_deserialize;
829         }
830     }
831
832 0     subelement.local = "TerminationTime";
833 0     subelement.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
834
835 0     result = xsd_dateTime_deserialize(
836          &subelement,
837          &instance->TerminationTime,
838          message_handle,
839          0);
840 0     if(result != GLOBUS_SUCCESS)
841     {
842 0         result = GlobusSoapMessageErrorDeserializeFailed(
843             result, 
844             &xsd_dateTime_qname);
845 0         goto TerminationTime_destroy;
846     }
847
848 0     subelement.local = "TerminationReason";
849 0     subelement.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
850
851 0     result = xsd_anyType_deserialize_pointer(
852         &subelement,
853         &instance->TerminationReason,
854         message_handle,
855         0);
856 0     if(result != GLOBUS_SUCCESS)
857     {
858 0         result = GlobusSoapMessageErrorDeserializeFailed(
859             result, 
860             (&subelement));
861 0         goto TerminationReason_destroy_pointer;
862     }
863
864 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
865     {
866 0         result = globus_soap_message_deserialize_element_end(
867             message_handle,
868             element_qname);
869 0         if(result != GLOBUS_SUCCESS)
870         {
871 0             result = GlobusSoapMessageErrorDeserializeFailed(
872                 result, element_qname);
873             goto fail_deserialize;
874         }
875     }
876
877 0     goto exit;
878
879  fail_deserialize:
880 0         xsd_anyType_destroy(
881             instance->TerminationReason);
882 0          instance->TerminationReason = NULL;
883
884  TerminationReason_destroy_pointer:
885 0         xsd_dateTime_destroy_contents(
886              &instance->TerminationTime);
887
888  TerminationTime_destroy:
889
890
891  exit:
892
893 0     GlobusSoapMessageDebugExit();
894 0     return result;
895 }
896
897
898
899 globus_result_t
900 wsrl_TerminationNotificationType_deserialize_pointer(
901     const xsd_QName *                   element_qname,
902     wsrl_TerminationNotificationType **                   ip,
903     globus_soap_message_handle_t        message_handle,
904     globus_xsd_element_options_t        options)
905 0 {
906 0     wsrl_TerminationNotificationType * instance = NULL;
907 0     globus_result_t                     result = GLOBUS_SUCCESS;
908 0     xsd_QName                           subelement;
909 0     int                                 found_attrs = 0;
910 0     int                                 empty_element = 0;
911 0     GlobusFuncName(wsrl_TerminationNotificationType_deserialize_pointer);
912 0     GlobusSoapMessageDebugEnter();
913
914 0     *ip = NULL;
915
916 0     result = globus_soap_message_deserialize_element(
917         message_handle, element_qname);
918 0     if(result != GLOBUS_SUCCESS &&
919        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
920         GlobusSoapMessageStatusFailedElementCheck(result) ||
921         GlobusSoapMessageStatusFailedWithTextCheck(result)))
922     {
923 0         result = GLOBUS_SUCCESS;
924 0         goto exit;
925     }
926
927 0     if(result != GLOBUS_SUCCESS)
928     {
929 0         result = GlobusSoapMessageErrorDeserializeFailed(
930             result, element_qname);
931 0         goto exit;
932     }
933
934 0     if(globus_soap_message_deserialize_element_is_empty(
935            message_handle))
936     {
937 0         empty_element = 1;
938     }
939
940 0     result = wsrl_TerminationNotificationType_init(&instance);
941 0     if(result != GLOBUS_SUCCESS)
942     {
943 0         result = GlobusSoapMessageErrorDeserializeFailed(
944             result, element_qname);
945 0         goto exit;
946     }
947
948
949 0     if(found_attrs == 0 && 
950        globus_soap_message_deserialize_element_is_nil(message_handle))
951     {
952 0         wsrl_TerminationNotificationType_destroy(instance);
953         
954 0         result = globus_soap_message_deserialize_element_end(
955                 message_handle,
956                 element_qname);
957 0         if(result != GLOBUS_SUCCESS)
958         {
959 0             result = GlobusSoapMessageErrorDeserializeFailed(
960                 result, element_qname);
961 0             goto exit;
962         }
963
964 0         *ip = NULL;
965 0         globus_object_free(globus_error_get(result));
966 0         result = GLOBUS_SUCCESS;
967 0         goto exit;
968     }
969
970
971 0     if(empty_element)
972     {
973 0         result = globus_soap_message_deserialize_element_end(
974             message_handle,
975             element_qname);
976 0         if(result != GLOBUS_SUCCESS)
977         {
978 0             result = GlobusSoapMessageErrorDeserializeFailed(
979                 result, element_qname);
980 0             goto fail_deserialize;
981         }
982
983 0         *ip = instance;
984 0         goto exit;
985     }
986
987 0     result = globus_soap_message_deserialize_element_begin_close(
988         message_handle);
989 0     if(result != GLOBUS_SUCCESS)
990     {
991 0         result = GlobusSoapMessageErrorDeserializeFailed(
992             result, element_qname);
993 0         goto exit;
994     }
995
996 0     result = wsrl_TerminationNotificationType_deserialize(
997             element_qname,
998             instance,
999             message_handle,
1000             options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1001
1002 0     result = globus_soap_message_deserialize_element_end(
1003         message_handle,
1004         element_qname);
1005 0     if(result != GLOBUS_SUCCESS)
1006     {
1007 0         result = GlobusSoapMessageErrorDeserializeFailed(
1008             result, element_qname);
1009 0         goto fail_deserialize;
1010     }
1011
1012 0     *ip = instance;
1013
1014 0     goto exit;
1015
1016  fail_deserialize:
1017 0         xsd_anyType_destroy(
1018             instance->TerminationReason);
1019 0          instance->TerminationReason = NULL;
1020
1021  TerminationReason_destroy_pointer:
1022 0         xsd_dateTime_destroy_contents(
1023              &instance->TerminationTime);
1024
1025  TerminationTime_destroy:
1026
1027  exit:
1028
1029 0     GlobusSoapMessageDebugExit();
1030 0     return result;
1031 }
1032
1033
1034 globus_result_t
1035 wsrl_TerminationNotificationType_array_init_contents(
1036     wsrl_TerminationNotificationType_array * array)
1037 0 {
1038 0     return globus_xsd_generic_array_init_contents(
1039         (globus_xsd_generic_array_t *) array,
1040         &wsrl_TerminationNotificationType_info);
1041 }
1042 /* wsrl_TerminationNotificationType_array_init_contents() */
1043
1044 globus_result_t
1045 wsrl_TerminationNotificationType_array_init(
1046     wsrl_TerminationNotificationType_array ** arr)
1047 0 {
1048 0     return globus_xsd_generic_array_init(
1049         (globus_xsd_generic_array_t **) arr,
1050         &wsrl_TerminationNotificationType_info);
1051 }
1052 /* wsrl_TerminationNotificationType_array_init() */
1053
1054 void
1055 wsrl_TerminationNotificationType_array_destroy_contents(
1056     wsrl_TerminationNotificationType_array * array)
1057 0 {
1058 0     globus_xsd_generic_array_destroy_contents(
1059         (globus_xsd_generic_array_t *) array);
1060 }
1061 /* wsrl_TerminationNotificationType_array_destroy_contents() */
1062
1063 void
1064 wsrl_TerminationNotificationType_array_destroy(
1065     wsrl_TerminationNotificationType_array * array)
1066 0 {
1067 0     globus_xsd_generic_array_destroy(
1068         (globus_xsd_generic_array_t *) array);
1069 }
1070 /* wsrl_TerminationNotificationType_array_destroy() */
1071
1072 globus_result_t
1073 wsrl_TerminationNotificationType_array_copy(
1074     wsrl_TerminationNotificationType_array ** dest_arr,
1075     const wsrl_TerminationNotificationType_array * src_arr)
1076 0 {
1077 0     return globus_xsd_generic_array_copy(
1078         (globus_xsd_generic_array_t **) dest_arr,
1079         (globus_xsd_generic_array_t *) src_arr);
1080 }
1081 /* wsrl_TerminationNotificationType_array_copy() */
1082
1083 globus_result_t
1084 wsrl_TerminationNotificationType_array_copy_contents(
1085     wsrl_TerminationNotificationType_array * dest_arr,
1086     const wsrl_TerminationNotificationType_array * src_arr)
1087 0 {
1088 0     return globus_xsd_generic_array_copy_contents(
1089         (globus_xsd_generic_array_t *) dest_arr,
1090         (globus_xsd_generic_array_t *) src_arr);
1091 }
1092 /* wsrl_TerminationNotificationType_array_copy_contents() */
1093
1094 wsrl_TerminationNotificationType *
1095 wsrl_TerminationNotificationType_array_push(
1096     wsrl_TerminationNotificationType_array * array)
1097 0 {
1098     /* Some contents initializers don't initialize subelments but to set their
1099      * values to be NULL
1100      */
1101 0     if (array->type_info == NULL)
1102     {
1103 0         array->type_info = &wsrl_TerminationNotificationType_info;
1104     }
1105
1106 0     return globus_xsd_generic_array_push(
1107         (globus_xsd_generic_array_t *) array);
1108 }
1109 /* wsrl_TerminationNotificationType_array_push() */
1110
1111 void *
1112 wsrl_TerminationNotificationType_array_push_wrapper(
1113     void * array)
1114 0 {
1115 0     return (void *) wsrl_TerminationNotificationType_array_push((wsrl_TerminationNotificationType_array *) array);
1116 }
1117
1118 globus_result_t
1119 wsrl_TerminationNotificationType_array_serialize(
1120     const xsd_QName *                   element_qname,
1121     const wsrl_TerminationNotificationType_array *        array,
1122     globus_soap_message_handle_t        message,
1123     globus_xsd_element_options_t        options)
1124 0 {
1125 0     return globus_xsd_generic_array_serialize(
1126         element_qname,
1127         (const globus_xsd_generic_array_t *) array,
1128         message,
1129         options);
1130 }
1131 /* wsrl_TerminationNotificationType_array_serialize() */
1132
1133 globus_result_t
1134 wsrl_TerminationNotificationType_array_deserialize(
1135     const xsd_QName *                   element_qname,
1136     wsrl_TerminationNotificationType_array * array,
1137     globus_soap_message_handle_t        message,
1138     globus_xsd_element_options_t        options)
1139 0 {
1140     /* Some initializers set the array's contents to NULL */
1141 0     if (array->type_info == NULL)
1142     {
1143 0         array->type_info = &wsrl_TerminationNotificationType_info;
1144     }
1145 0     return globus_xsd_generic_array_deserialize(
1146         element_qname,
1147         (globus_xsd_generic_array_t *) array,
1148         message,
1149         options);