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