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