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