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