1 /*
2 * Portions of this file Copyright 1999-2005 University of Chicago
3 * Portions of this file Copyright 1999-2005 The University of Southern California.
4 *
5 * This file or a portion of this file is licensed under the
6 * terms of the Globus Toolkit Public License, found at
7 * http://www.globus.org/toolkit/download/license.html.
8 * If you redistribute this file, with or without
9 * modifications, you must include this notice in the file.
10 */
11
12
13 /*
14 * This file is automatically generated by the Globus WSDLtoC converter
15 */
16
17 #include "xsd_QName.h"
18 #include "globus_soap_message.h"
19 #include "globus_xsd_type_info.h"
20 #include "ds_KeyValueType.h"
21
22 xsd_QName ds_KeyValueType_choice_qname =
23 {
24 "http://www.w3.org/2000/09/xmldsig#",
25 "KeyValueType_choice"
26 };
27
28 globus_result_t
29 ds_KeyValueType_choice_serialize_wrapper(
30 xsd_QName * element_qname,
31 void * instance,
32 globus_soap_message_handle_t message_handle,
33 globus_xsd_element_options_t options)
34 0 {
35 0 return ds_KeyValueType_choice_serialize(
36 element_qname,
37 (ds_KeyValueType_choice *) instance,
38 message_handle, options);
39 }
40
41 globus_result_t
42 ds_KeyValueType_choice_deserialize_pointer_wrapper(
43 xsd_QName * element_qname,
44 void ** ip,
45 globus_soap_message_handle_t message_handle,
46 globus_xsd_element_options_t options)
47 0 {
48 0 return ds_KeyValueType_choice_deserialize_pointer(
49 element_qname,
50 (ds_KeyValueType_choice **) ip,
51 message_handle, options);
52 }
53
54 globus_result_t
55 ds_KeyValueType_choice_init_wrapper(void **object)
56 0 {
57 0 return ds_KeyValueType_choice_init(
58 (ds_KeyValueType_choice **) object);
59 }
60
61 void
62 ds_KeyValueType_choice_destroy_wrapper(
63 void * object)
64 0 {
65 0 ds_KeyValueType_choice_destroy(
66 (ds_KeyValueType_choice *) object);
67 }
68
69 globus_result_t
70 ds_KeyValueType_choice_copy_wrapper(
71 void ** dest_obj,
72 void * src_obj)
73 0 {
74 0 return ds_KeyValueType_choice_copy(
75 (ds_KeyValueType_choice **) dest_obj,
76 (ds_KeyValueType_choice *) src_obj);
77 }
78
79 globus_result_t
80 ds_KeyValueType_choice_init_contents_wrapper(void *object)
81 0 {
82 0 return ds_KeyValueType_choice_init_contents(
83 (ds_KeyValueType_choice *) object);
84 }
85
86 void
87 ds_KeyValueType_choice_destroy_contents_wrapper(
88 void * object)
89 0 {
90 0 ds_KeyValueType_choice_destroy_contents(
91 (ds_KeyValueType_choice *) object);
92 }
93
94 globus_result_t
95 ds_KeyValueType_choice_copy_contents_wrapper(
96 void * dest_obj,
97 void * src_obj)
98 0 {
99 0 return ds_KeyValueType_choice_copy_contents(
100 (ds_KeyValueType_choice *) dest_obj,
101 (ds_KeyValueType_choice *) src_obj);
102 }
103
104 globus_result_t
105 ds_KeyValueType_choice_serialize_contents_wrapper(
106 xsd_QName * element_qname,
107 void * instance,
108 globus_soap_message_handle_t message_handle,
109 globus_xsd_element_options_t options)
110 0 {
111 0 return ds_KeyValueType_choice_serialize_contents(
112 element_qname,
113 (ds_KeyValueType_choice *) instance,
114 message_handle, options);
115 }
116
117 globus_result_t
118 ds_KeyValueType_choice_deserialize_contents_wrapper(
119 xsd_QName * element_qname,
120 void ** instance,
121 globus_soap_message_handle_t message_handle,
122 globus_xsd_element_options_t options)
123 0 {
124 globus_result_t result;
125 GlobusFuncName(ds_KeyValueType_choice_deserialize_contents_wrapper);
126 0 GlobusSoapMessageDebugEnter();
127
128 0 if(!*instance)
129 {
130 0 result = ds_KeyValueType_choice_init(
131 (ds_KeyValueType_choice **)instance);
132 0 if(result != GLOBUS_SUCCESS)
133 {
134 0 goto error;
135 }
136 }
137
138 0 result = ds_KeyValueType_choice_deserialize_contents(
139 element_qname,
140 *(ds_KeyValueType_choice **)instance,
141 message_handle, options);
142 0 error:
143 0 GlobusSoapMessageDebugExit();
144 0 return result;
145 }
146
147 globus_result_t
148 ds_KeyValueType_choice_array_serialize_wrapper(
149 xsd_QName * element,
150 void * instance,
151 globus_soap_message_handle_t message,
152 globus_xsd_element_options_t options)
153 0 {
154 0 return ds_KeyValueType_choice_array_serialize(
155 element,
156 (ds_KeyValueType_choice_array *) instance,
157 message, options);
158 }
159
160 globus_result_t
161 ds_KeyValueType_choice_array_deserialize_wrapper(
162 xsd_QName * element_qname,
163 void ** inst,
164 globus_soap_message_handle_t message,
165 globus_xsd_element_options_t options)
166 0 {
167 0 if(!*inst)
168 {
169 globus_result_t result;
170
171 0 result = ds_KeyValueType_choice_array_init(
172 (ds_KeyValueType_choice_array **)inst);
173 0 if(result != GLOBUS_SUCCESS)
174 {
175 0 return result;
176 }
177 }
178
179 0 return ds_KeyValueType_choice_array_deserialize(
180 element_qname,
181 *(ds_KeyValueType_choice_array **) inst,
182 message, options);
183 }
184
185 globus_result_t
186 ds_KeyValueType_choice_array_init_wrapper(
187 void ** arr)
188 0 {
189 0 return ds_KeyValueType_choice_array_init(
190 (ds_KeyValueType_choice_array **) arr);
191 }
192
193 void
194 ds_KeyValueType_choice_array_destroy_wrapper(
195 void * arr)
196 0 {
197 0 ds_KeyValueType_choice_array_destroy(
198 (ds_KeyValueType_choice_array *) arr);
199 }
200
201 globus_result_t
202 ds_KeyValueType_choice_array_copy_wrapper(
203 void ** dest_arr,
204 void * src_arr)
205 0 {
206 0 return ds_KeyValueType_choice_array_copy(
207 (ds_KeyValueType_choice_array **) dest_arr,
208 (ds_KeyValueType_choice_array *) src_arr);
209 }
210
211 globus_result_t
212 ds_KeyValueType_choice_array_init_contents_wrapper(
213 void * arr)
214 0 {
215 0 return ds_KeyValueType_choice_array_init_contents(
216 (ds_KeyValueType_choice_array *) arr);
217 }
218
219 void
220 ds_KeyValueType_choice_array_destroy_contents_wrapper(
221 void * arr)
222 0 {
223 0 ds_KeyValueType_choice_array_destroy_contents(
224 (ds_KeyValueType_choice_array *) arr);
225 }
226
227 globus_result_t
228 ds_KeyValueType_choice_array_copy_contents_wrapper(
229 void * dest_arr,
230 void * src_arr)
231 0 {
232 0 return ds_KeyValueType_choice_array_copy_contents(
233 (ds_KeyValueType_choice_array *) dest_arr,
234 (ds_KeyValueType_choice_array *) src_arr);
235 }
236
237 struct globus_xsd_type_info_s ds_KeyValueType_choice_array_info =
238 {
239 &ds_KeyValueType_choice_qname,
240 ds_KeyValueType_choice_array_serialize_wrapper,
241 ds_KeyValueType_choice_array_deserialize_wrapper,
242 ds_KeyValueType_choice_array_init_wrapper,
243 ds_KeyValueType_choice_array_destroy_wrapper,
244 ds_KeyValueType_choice_array_copy_wrapper,
245 ds_KeyValueType_choice_array_init_contents_wrapper,
246 ds_KeyValueType_choice_array_destroy_contents_wrapper,
247 ds_KeyValueType_choice_array_copy_contents_wrapper,
248 sizeof(ds_KeyValueType_choice),
249 ds_KeyValueType_choice_array_push_wrapper,
250 NULL,
251 NULL
252 };
253
254 struct globus_xsd_type_info_s ds_KeyValueType_choice_contents_info =
255 {
256 &ds_KeyValueType_choice_qname,
257 ds_KeyValueType_choice_serialize_contents_wrapper,
258 ds_KeyValueType_choice_deserialize_contents_wrapper,
259 ds_KeyValueType_choice_init_wrapper,
260 ds_KeyValueType_choice_destroy_wrapper,
261 ds_KeyValueType_choice_copy_wrapper,
262 ds_KeyValueType_choice_init_contents_wrapper,
263 ds_KeyValueType_choice_destroy_contents_wrapper,
264 ds_KeyValueType_choice_copy_contents_wrapper,
265 sizeof(ds_KeyValueType_choice),
266 NULL,
267 NULL,
268 NULL
269 };
270
271 struct globus_xsd_type_info_s ds_KeyValueType_choice_info =
272 {
273 &ds_KeyValueType_choice_qname,
274 ds_KeyValueType_choice_serialize_wrapper,
275 ds_KeyValueType_choice_deserialize_pointer_wrapper,
276 ds_KeyValueType_choice_init_wrapper,
277 ds_KeyValueType_choice_destroy_wrapper,
278 ds_KeyValueType_choice_copy_wrapper,
279 ds_KeyValueType_choice_init_contents_wrapper,
280 ds_KeyValueType_choice_destroy_contents_wrapper,
281 ds_KeyValueType_choice_copy_contents_wrapper,
282 sizeof(ds_KeyValueType),
283 NULL,
284 &ds_KeyValueType_choice_contents_info,
285 &ds_KeyValueType_choice_array_info
286 };
287
288 globus_result_t
289 ds_KeyValueType_choice_init_contents(
290 ds_KeyValueType_choice * instance)
291 0 {
292 0 globus_result_t result = GLOBUS_SUCCESS;
293 GlobusFuncName(ds_KeyValueType_choice_init_contents);
294 0 GlobusSoapMessageDebugEnter();
295
296 0 memset(instance, 0, sizeof(ds_KeyValueType));
297
298 0 GlobusSoapMessageDebugExit();
299 0 return result;
300 }
301
302 globus_result_t
303 ds_KeyValueType_choice_init(
304 ds_KeyValueType_choice ** object)
305 0 {
306 ds_KeyValueType_choice * instance;
307 0 globus_result_t result = GLOBUS_SUCCESS;
308 GlobusFuncName(ds_KeyValueType_choice_init);
309 0 GlobusSoapMessageDebugEnter();
310
311 0 instance = globus_malloc(sizeof(ds_KeyValueType_choice));
312 0 if(!instance)
313 {
314 0 result = GlobusSoapMessageErrorOutOfMemory;
315 0 goto exit;
316 }
317
318 0 memset(instance, 0, sizeof(ds_KeyValueType_choice));
319
320 0 *object = instance;
321
322 0 exit:
323 0 GlobusSoapMessageDebugExit();
324 0 return result;
325 }
326
327 void
328 ds_KeyValueType_choice_destroy(
329 ds_KeyValueType_choice * instance)
330 0 {
331 GlobusFuncName(ds_KeyValueType_choice_destroy);
332 0 GlobusSoapMessageDebugEnter();
333
334 0 if(!instance)
335 {
336 0 goto exit;
337 }
338
339 0 ds_KeyValueType_choice_destroy_contents(instance);
340 0 free(instance);
341
342 0 exit:
343
344 0 GlobusSoapMessageDebugExit();
345 }
346
347
348
349 void
350 ds_KeyValueType_choice_destroy_contents(
351 ds_KeyValueType_choice * instance)
352 0 {
353 GlobusFuncName(ds_KeyValueType_choice_destroy_contents);
354 0 GlobusSoapMessageDebugEnter();
355
356 0 switch(instance->type)
357 {
358
359 case ds_KeyValueType_DSAKeyValue:
360
361 0 ds_DSAKeyValueType_destroy_contents(
362 &instance->value.DSAKeyValue);
363 0 break;
364
365 case ds_KeyValueType_RSAKeyValue:
366
367 0 ds_RSAKeyValueType_destroy_contents(
368 &instance->value.RSAKeyValue);
369 0 break;
370
371 case ds_KeyValueType_any:
372
373 0 xsd_any_destroy_contents(
374 &instance->value.any);
375 break;
376
377 default:
378 break;
379 }
380
381 0 instance->type = ds_KeyValueType_undefined;
382
383 0 GlobusSoapMessageDebugExit();
384 }
385
386 globus_result_t
387 ds_KeyValueType_choice_copy(
388 ds_KeyValueType_choice ** dest_obj,
389 const ds_KeyValueType_choice * src_obj)
390 0 {
391 0 globus_result_t result = GLOBUS_SUCCESS;
392 ds_KeyValueType_choice * instance;
393 GlobusFuncName(ds_KeyValueType_choice_copy);
394
395 0 GlobusSoapMessageDebugEnter();
396
397 0 instance = malloc(sizeof(ds_KeyValueType_choice));
398 0 if (instance == NULL)
399 {
400 0 GlobusSoapMessageDebugExit();
401 0 return GlobusSoapMessageErrorOutOfMemory;
402 }
403
404 0 result = ds_KeyValueType_choice_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
418
419 globus_result_t
420 ds_KeyValueType_choice_copy_contents(
421 ds_KeyValueType_choice * instance,
422 const ds_KeyValueType_choice * src_obj)
423 0 {
424 xsd_QName subelement;
425 0 globus_result_t result = GLOBUS_SUCCESS;
426 GlobusFuncName(ds_KeyValueType_choice_copy_contents);
427
428 0 GlobusSoapMessageDebugEnter();
429
430 0 switch(src_obj->type)
431 {
432
433 case ds_KeyValueType_DSAKeyValue:
434 0 instance->type = ds_KeyValueType_DSAKeyValue;
435 0 result = ds_DSAKeyValueType_copy_contents(
436 &instance->value.DSAKeyValue,
437 &src_obj->value.DSAKeyValue);
438 0 if(result != GLOBUS_SUCCESS)
439 {
440 0 result = GlobusSoapMessageErrorSerializeFailed(
441 result, NULL, &ds_KeyValueType_choice_qname);
442 0 goto exit;
443 }
444
445 break;
446
447 case ds_KeyValueType_RSAKeyValue:
448 0 instance->type = ds_KeyValueType_RSAKeyValue;
449 0 result = ds_RSAKeyValueType_copy_contents(
450 &instance->value.RSAKeyValue,
451 &src_obj->value.RSAKeyValue);
452 0 if(result != GLOBUS_SUCCESS)
453 {
454 0 result = GlobusSoapMessageErrorSerializeFailed(
455 result, NULL, &ds_KeyValueType_choice_qname);
456 0 goto exit;
457 }
458
459 break;
460
461 case ds_KeyValueType_any:
462 0 instance->type = ds_KeyValueType_any;
463 0 result = xsd_any_copy_contents(
464 &instance->value.any,
465 &src_obj->value.any);
466 0 if(result != GLOBUS_SUCCESS)
467 {
468 0 result = GlobusSoapMessageErrorSerializeFailed(
469 result, NULL, &ds_KeyValueType_choice_qname);
470 goto exit;
471 }
472
473 break;
474
475 default:
476 break;
477 }
478
479 0 exit:
480
481 0 GlobusSoapMessageDebugExit();
482 0 return result;
483 }
484
485
486
487
488
489 globus_result_t
490 ds_KeyValueType_choice_serialize_contents(
491 xsd_QName * element_qname, /* ignored */
492 ds_KeyValueType_choice * instance,
493 globus_soap_message_handle_t message_handle,
494 globus_xsd_element_options_t options)
495 0 {
496 xsd_QName subelement;
497 0 globus_result_t result = GLOBUS_SUCCESS;
498 GlobusFuncName(ds_KeyValueType_choice_serialize_contents);
499 0 GlobusSoapMessageDebugEnter();
500
501 0 switch(instance->type)
502 {
503
504 case ds_KeyValueType_DSAKeyValue:
505
506 0 subelement.local = "DSAKeyValue";
507 0 subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#";
508 0 result = ds_DSAKeyValueType_serialize(
509 &subelement,
510 &instance->value.DSAKeyValue,
511 message_handle,
512 options);
513 0 if(result != GLOBUS_SUCCESS)
514 {
515 0 result = GlobusSoapMessageErrorSerializeFailed(
516 result, NULL, &ds_KeyValueType_choice_qname);
517 0 goto exit;
518 }
519
520 break;
521
522 case ds_KeyValueType_RSAKeyValue:
523
524 0 subelement.local = "RSAKeyValue";
525 0 subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#";
526 0 result = ds_RSAKeyValueType_serialize(
527 &subelement,
528 &instance->value.RSAKeyValue,
529 message_handle,
530 options);
531 0 if(result != GLOBUS_SUCCESS)
532 {
533 0 result = GlobusSoapMessageErrorSerializeFailed(
534 result, NULL, &ds_KeyValueType_choice_qname);
535 0 goto exit;
536 }
537
538 break;
539
540 case ds_KeyValueType_any:
541
542 0 subelement.local = "any";
543 0 subelement.Namespace = "http://www.w3.org/2001/XMLSchema";
544 0 result = xsd_any_serialize(
545 &subelement,
546 &instance->value.any,
547 message_handle,
548 options);
549 0 if(result != GLOBUS_SUCCESS)
550 {
551 0 result = GlobusSoapMessageErrorSerializeFailed(
552 result, NULL, &ds_KeyValueType_choice_qname);
553 goto exit;
554 }
555
556 break;
557
558 default:
559 break;
560 }
561
562 0 exit:
563
564 0 GlobusSoapMessageDebugExit();
565 0 return result;
566 }
567
568
569
570 globus_result_t
571 ds_KeyValueType_choice_serialize(
572 xsd_QName * element_qname,
573 ds_KeyValueType_choice * instance,
574 globus_soap_message_handle_t message_handle,
575 globus_xsd_element_options_t options)
576 0 {
577 0 globus_result_t result = GLOBUS_SUCCESS;
578 GlobusFuncName(ds_KeyValueType_choice_serialize);
579 0 GlobusSoapMessageDebugEnter();
580
581 0 result = ds_KeyValueType_choice_serialize_contents(
582 element_qname,
583 instance,
584 message_handle,
585 options);
586 0 if(result != GLOBUS_SUCCESS)
587 {
588 0 result = GlobusSoapMessageErrorSerializeFailed(
589 result, NULL, &ds_KeyValueType_choice_qname);
590 goto exit;
591 }
592
593 0 exit:
594 0 GlobusSoapMessageDebugExit();
595 0 return result;
596 }
597
598
599
600
601
602 globus_result_t
603 ds_KeyValueType_choice_deserialize_contents(
604 xsd_QName * element_qname, /* ignored */
605 ds_KeyValueType_choice * instance,
606 globus_soap_message_handle_t message_handle,
607 globus_xsd_element_options_t options)
608 0 {
609 0 globus_result_t result = GLOBUS_SUCCESS;
610 GlobusFuncName(ds_KeyValueType_choice_deserialize_contents);
611 0 GlobusSoapMessageDebugEnter();
612
613 0 result = ds_KeyValueType_choice_deserialize(
614 NULL,
615 instance,
616 message_handle,
617 options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
618 0 if(result != GLOBUS_SUCCESS)
619 {
620 0 result = GlobusSoapMessageErrorDeserializeFailed(
621 result, element_qname);
622 goto exit;
623 }
624
625 0 exit:
626
627 0 GlobusSoapMessageDebugExit();
628 0 return result;
629 }
630
631
632
633 globus_result_t
634 ds_KeyValueType_choice_deserialize(
635 xsd_QName * element_qname,
636 ds_KeyValueType_choice * instance,
637 globus_soap_message_handle_t message_handle,
638 globus_xsd_element_options_t options)
639 0 {
640 0 globus_result_t result = GLOBUS_SUCCESS;
641 xsd_QName subelement;
642 0 xsd_QName deselem_qname = { NULL, NULL } ;
643 GlobusFuncName(ds_KeyValueType_choice_deserialize);
644 0 GlobusSoapMessageDebugEnter();
645
646 0 xsd_QName_init_contents(&deselem_qname);
647
648 do
649 {
650 0 result = globus_soap_message_deserialize_element_unknown(
651 message_handle, &deselem_qname);
652 0 if(result != GLOBUS_SUCCESS)
653 {
654 0 result = GlobusSoapMessageErrorDeserializeFailed(
655 result, &ds_KeyValueType_choice_qname);
656 0 goto exit;
657 }
658
659 0 if(globus_soap_message_deserialize_element_is_nil(message_handle))
660 {
661 0 xsd_QName_destroy_contents(&deselem_qname);
662 0 result = globus_soap_message_deserialize_element_end(
663 message_handle,
664 element_qname);
665 0 if(result != GLOBUS_SUCCESS)
666 {
667 0 result = GlobusSoapMessageErrorDeserializeFailed(
668 result, &ds_KeyValueType_choice_qname);
669 0 goto exit;
670 }
671 }
672 else
673 {
674 0 break;
675 }
676 } while(1);
677
678 0 globus_soap_message_deserialize_push_element(message_handle);
679
680 0 subelement.local = "DSAKeyValue";
681 0 subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#";
682 0 if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
683 {
684 0 instance->type=ds_KeyValueType_DSAKeyValue;
685 0 result = ds_DSAKeyValueType_deserialize(
686 &subelement,
687 &instance->value.DSAKeyValue,
688 message_handle,
689 options);
690 0 if(result != GLOBUS_SUCCESS)
691 {
692 0 result = GlobusSoapMessageErrorDeserializeFailed(
693 result, &ds_KeyValueType_choice_qname);
694 0 goto DSAKeyValue_destroy;
695 }
696
697 goto exit;
698 }
699
700 0 subelement.local = "RSAKeyValue";
701 0 subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#";
702 0 if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
703 {
704 0 instance->type=ds_KeyValueType_RSAKeyValue;
705 0 result = ds_RSAKeyValueType_deserialize(
706 &subelement,
707 &instance->value.RSAKeyValue,
708 message_handle,
709 options);
710 0 if(result != GLOBUS_SUCCESS)
711 {
712 0 result = GlobusSoapMessageErrorDeserializeFailed(
713 result, &ds_KeyValueType_choice_qname);
714 0 goto RSAKeyValue_destroy;
715 }
716
717 goto exit;
718 }
719
720 /* try to parse as any element */
721 0 result = xsd_any_deserialize(
722 &subelement,
723 &instance->value.any,
724 message_handle,
725 options);
726 0 if(result != GLOBUS_SUCCESS)
727 {
728 0 result = GlobusSoapMessageErrorDeserializeFailed(
729 result, &ds_KeyValueType_choice_qname);
730 0 goto any_destroy;
731 }
732 else
733 {
734 0 instance->type=ds_KeyValueType_any;
735 goto exit;
736 }
737
738 instance->type = ds_KeyValueType_undefined;
739
740 goto exit;
741
742 0 deserialize_failed:
743
744 0 any_destroy:
745
746 0 RSAKeyValue_destroy:
747
748 0 DSAKeyValue_destroy:
749
750 0 exit:
751
752 0 xsd_QName_destroy_contents(&deselem_qname);
753
754 0 if(result == GLOBUS_SUCCESS)
755 {
756 do
757 {
758 0 result = globus_soap_message_deserialize_element(
759 message_handle, NULL);
760 0 if(result != GLOBUS_SUCCESS &&
761 (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
762 GlobusSoapMessageStatusFailedElementCheck(result) ||
763 GlobusSoapMessageStatusFailedWithTextCheck(result)))
764 {
765 0 result = GLOBUS_SUCCESS;
766 0 break;
767 }
768
769 0 if(globus_soap_message_deserialize_element_is_nil(
770 message_handle))
771 {
772 0 result = globus_soap_message_deserialize_element_end(
773 message_handle,
774 element_qname);
775 0 if(result != GLOBUS_SUCCESS)
776 {
777 0 result = GlobusSoapMessageErrorDeserializeFailed(
778 result, &ds_KeyValueType_choice_qname);
779 break;
780 }
781 }
782 else
783 {
784 0 break;
785 }
786
787 } while(1);
788 }
789
790 0 xsd_QName_destroy_contents(&deselem_qname);
791
792 0 GlobusSoapMessageDebugExit();
793 0 return result;
794 }
795
796
797
798 globus_result_t
799 ds_KeyValueType_choice_deserialize_pointer(
800 xsd_QName * element_qname,
801 ds_KeyValueType_choice ** ip,
802 globus_soap_message_handle_t message_handle,
803 globus_xsd_element_options_t options)
804 0 {
805 0 ds_KeyValueType_choice * instance = NULL;
806 0 globus_result_t result = GLOBUS_SUCCESS;
807 xsd_QName subelement;
808 GlobusFuncName(ds_KeyValueType_choice_deserialize_pointer);
809 0 GlobusSoapMessageDebugEnter();
810
811 0 *ip = NULL;
812
813 0 result = ds_KeyValueType_choice_init(&instance);
814 0 if(result != GLOBUS_SUCCESS)
815 {
816 0 result = GlobusSoapMessageErrorDeserializeFailed(
817 result, element_qname);
818 0 goto exit;
819 }
820
821 0 result = ds_KeyValueType_choice_deserialize_contents(
822 element_qname,
823 instance,
824 message_handle,
825 options);
826 0 if(result != GLOBUS_SUCCESS)
827 {
828 0 goto exit;
829 }
830
831 0 *ip = instance;
832
833 0 exit:
834
835 0 GlobusSoapMessageDebugExit();
836 0 return result;
837 }
838
839
840
841 globus_result_t
842 ds_KeyValueType_choice_array_init_contents(
843 ds_KeyValueType_choice_array * array)
844 0 {
845 GlobusFuncName(ds_KeyValueType_choice_array_init_contents);
846 0 GlobusSoapMessageDebugEnter();
847
848 0 memset(array, 0, sizeof(ds_KeyValueType_choice_array));
849
850 0 GlobusSoapMessageDebugExit();
851 0 return GLOBUS_SUCCESS;
852 }
853
854 globus_result_t
855 ds_KeyValueType_choice_array_init(
856 ds_KeyValueType_choice_array ** arr)
857 0 {
858 ds_KeyValueType_choice_array * array;
859 globus_result_t result;
860 GlobusFuncName(ds_KeyValueType_choice_array_init);
861 0 GlobusSoapMessageDebugEnter();
862
863 0 array = (ds_KeyValueType_choice_array *)
864 globus_malloc(sizeof(ds_KeyValueType_choice_array));
865 0 if(!array)
866 {
867 0 result = GlobusSoapMessageErrorOutOfMemory;
868 0 goto exit;
869 }
870
871 0 result = ds_KeyValueType_choice_array_init_contents(array);
872 0 if(result != GLOBUS_SUCCESS)
873 {
874 0 globus_free(array);
875 0 array = NULL;
876 }
877
878 0 *arr = array;
879
880 0 exit:
881 0 GlobusSoapMessageDebugExit();
882 0 return result;
883 }
884
885 void
886 ds_KeyValueType_choice_array_destroy_contents(
887 ds_KeyValueType_choice_array * array)
888 0 {
889 0 int i = 0;
890 GlobusFuncName(ds_KeyValueType_choice_array_destroy_contents);
891 0 GlobusSoapMessageDebugEnter();
892
893 0 for(; i < array->length; ++i)
894 {
895 0 ds_KeyValueType_choice_destroy_contents(&array->elements[i]);
896 }
897
898 0 if(array->elements)
899 {
900 0 globus_free(array->elements);
901 0 array->elements = NULL;
902 }
903 0 array->length = 0;
904
905 0 GlobusSoapMessageDebugExit();
906 }
907
908 void
909 ds_KeyValueType_choice_array_destroy(
910 ds_KeyValueType_choice_array * array)
911 0 {
912 GlobusFuncName(ds_KeyValueType_choice_array_destroy);
913 0 GlobusSoapMessageDebugEnter();
914
915 0 ds_KeyValueType_choice_array_destroy_contents(array);
916 0 globus_free(array);
917
918 0 GlobusSoapMessageDebugExit();
919 }
920
921 globus_result_t
922 ds_KeyValueType_choice_array_copy(
923 ds_KeyValueType_choice_array ** dest_arr,
924 const ds_KeyValueType_choice_array * src_arr)
925 0 {
926 ds_KeyValueType_choice_array * array;
927 globus_result_t result;
928 GlobusFuncName(ds_KeyValueType_choice_array_copy);
929 0 GlobusSoapMessageDebugEnter();
930
931 0 array = (ds_KeyValueType_choice_array *) malloc(
932 sizeof(ds_KeyValueType_choice_array));
933 0 if(!array)
934 {
935 0 result = GlobusSoapMessageErrorOutOfMemory;
936 0 GlobusSoapMessageDebugExit();
937 0 return result;
938 }
939
940 0 result = ds_KeyValueType_choice_array_copy_contents(array, src_arr);
941 0 if(result != GLOBUS_SUCCESS)
942 {
943 0 globus_free(array);
944 0 GlobusSoapMessageDebugExit();
945 0 return result;
946 }
947
948 0 *dest_arr = array;
949
950 0 GlobusSoapMessageDebugExit();
951 0 return GLOBUS_SUCCESS;
952 }
953
954 globus_result_t
955 ds_KeyValueType_choice_array_copy_contents(
956 ds_KeyValueType_choice_array * dest_arr,
957 const ds_KeyValueType_choice_array * src_arr)
958 0 {
959 int i;
960 0 globus_result_t result = GLOBUS_SUCCESS;
961 GlobusFuncName(ds_KeyValueType_choice_array_copy_contents);
962 0 GlobusSoapMessageDebugEnter();
963
964 0 dest_arr->length = src_arr->length;
965 0 if(dest_arr->length > 0)
966 {
967 0 dest_arr->elements = (ds_KeyValueType_choice *) malloc(
968 sizeof(ds_KeyValueType_choice) * dest_arr->length);
969 0 if(!dest_arr->elements)
970 {
971 0 result = GlobusSoapMessageErrorOutOfMemory;
972 0 goto exit;
973 }
974 }
975 else
976 {
977 0 dest_arr->elements = NULL;
978 }
979
980 0 for(i = 0; i < dest_arr->length; i++)
981 {
982 0 result = ds_KeyValueType_choice_copy_contents(
983 &dest_arr->elements[i], &src_arr->elements[i]);
984 0 if(result != GLOBUS_SUCCESS)
985 {
986 0 while(i--)
987 {
988 0 ds_KeyValueType_choice_destroy_contents(&dest_arr->elements[i]);
989 }
990
991 0 globus_free(dest_arr->elements);
992 0 dest_arr->elements = NULL;
993 0 dest_arr->length = 0;
994 0 break;
995 }
996 }
997
998 0 exit:
999 0 GlobusSoapMessageDebugExit();
1000 0 return result;
1001 }
1002
1003 ds_KeyValueType_choice *
1004 ds_KeyValueType_choice_array_push(
1005 ds_KeyValueType_choice_array * array)
1006 0 {
1007 ds_KeyValueType_choice * tmp;
1008
1009 GlobusFuncName(ds_KeyValueType_choice_array_push);
1010 0 GlobusSoapMessageDebugEnter();
1011
1012 0 tmp = realloc(array->elements,
1013 sizeof(ds_KeyValueType_choice) *
1014 (array->length + 1));
1015 0 if (tmp == NULL)
1016 {
1017 0 goto error;
1018 }
1019 0 array->elements = tmp;
1020
1021 0 memset(&array->elements[array->length], 0, sizeof(ds_KeyValueType_choice));
1022 0 array->length++;
1023
1024 0 GlobusSoapMessageDebugExit();
1025 0 return (&array->elements[array->length - 1]);
1026 0 error:
1027 0 GlobusSoapMessageDebugExit();
1028 0 return NULL;
1029 }
1030
1031 void *
1032 ds_KeyValueType_choice_array_push_wrapper(
1033 void * array)
1034 0 {
1035 0 return (void *) ds_KeyValueType_choice_array_push(
1036 (ds_KeyValueType_choice_array *) array);
1037 }
1038
1039 globus_result_t
1040 ds_KeyValueType_choice_array_serialize(
1041 xsd_QName * element_qname,
1042 ds_KeyValueType_choice_array * array,
1043 globus_soap_message_handle_t message,
1044 globus_xsd_element_options_t options)
1045 0 {
1046 0 globus_result_t result = GLOBUS_SUCCESS;
1047 0 int i = 0;
1048 GlobusFuncName(ds_KeyValueType_choice_array_serialize);
1049 0 GlobusSoapMessageDebugEnter();
1050
1051 0 for(; i < array->length; ++i)
1052 {
1053 0 result = ds_KeyValueType_choice_serialize(
1054 element_qname,
1055 &array->elements[i],
1056 message,
1057 options);
1058 0 if(result != GLOBUS_SUCCESS)
1059 {
1060 0 goto exit;
1061 }
1062 }
1063
1064 0 exit:
1065
1066 0 GlobusSoapMessageDebugExit();
1067 0 return result;
1068 }
1069
1070 globus_result_t
1071 ds_KeyValueType_choice_array_deserialize(
1072 xsd_QName * element_qname,
1073 ds_KeyValueType_choice_array * array,
1074 globus_soap_message_handle_t message,
1075 globus_xsd_element_options_t options)
1076 0 {
1077 0 globus_result_t result = GLOBUS_SUCCESS;
1078 0 int i = 0;
1079 int pre_length;
1080 GlobusFuncName(ds_KeyValueType_choice_array_deserialize);
1081 0 GlobusSoapMessageDebugEnter();
1082
1083 0 pre_length = array->length;
1084
1085 0 for(i = 0; i < pre_length; ++i)
1086 {
1087 0 result = ds_KeyValueType_choice_deserialize(
1088 element_qname,
1089 &array->elements[i],
1090 message,
1091 options);
1092 0 if(result != GLOBUS_SUCCESS)
1093 {
1094 0 if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1095 GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1096 GlobusSoapMessageStatusFailedWithTextCheck(result))
1097 {
1098 0 result = GLOBUS_SUCCESS;
1099 0 break;
1100 }
1101
1102 0 result = GlobusSoapMessageErrorDeserializeFailed(
1103 result, element_qname);
1104 0 goto exit;
1105 }
1106 }
1107
1108 0 while(result == GLOBUS_SUCCESS)
1109 {
1110 ds_KeyValueType_choice next;
1111 0 memset(&next, 0, sizeof(ds_KeyValueType_choice));
1112
1113 0 result = ds_KeyValueType_choice_deserialize(
1114 element_qname,
1115 &next,
1116 message,
1117 options);
1118 0 if(result != GLOBUS_SUCCESS)
1119 {
1120 0 if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1121 GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1122 GlobusSoapMessageStatusFailedWithTextCheck(result))
1123 {
1124 0 result = GLOBUS_SUCCESS;
1125 0 break;
1126 }
1127
1128 0 result = GlobusSoapMessageErrorDeserializeFailed(
1129 result, element_qname);
1130 0 goto exit;
1131 }
1132
1133 0 array->elements = realloc(
1134 array->elements,
1135 (array->length + 1) * sizeof(ds_KeyValueType_choice));
1136 0 if(!array->elements)
1137 {
1138 0 result = GlobusSoapMessageErrorOutOfMemory;
1139 0 goto exit;
1140 }
1141 0 array->elements[array->length] = next;
1142 0 array->length++;
1143 0 ++i;
1144 }
1145
1146 0 exit:
1147
1148 0 if(result != GLOBUS_SUCCESS)
1149 {
1150 0 int di = 0;
1151 0 for(; di < i; ++di)
1152 {
1153 0 ds_KeyValueType_choice_destroy_contents(
1154 &array->elements[di]);
1155 0 memset(&array->elements[di], 0, sizeof(ds_KeyValueType_choice));
1156 }
1157 }
1158
1159 0 GlobusSoapMessageDebugExit();
1160 0 return result;