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 "wsp_PolicyAssertions_group.h"
26
27 xsd_QName wsp_PolicyAssertions_group_choice_qname =
28 {
29     "http://schemas.xmlsoap.org/ws/2002/12/policy",
30     "PolicyAssertions_group_choice"
31 };
32
33 globus_result_t
34 wsp_PolicyAssertions_group_choice_serialize_wrapper(
35     const xsd_QName *                   element_qname,
36     const void *                        instance,
37     globus_soap_message_handle_t        message_handle,
38     globus_xsd_element_options_t        options)
39 0 {
40 0     return wsp_PolicyAssertions_group_choice_serialize(
41         element_qname,
42         (wsp_PolicyAssertions_group_choice *) instance,
43         message_handle, options);
44 }
45
46 globus_result_t
47 wsp_PolicyAssertions_group_choice_deserialize_pointer_wrapper(
48     const xsd_QName *                   element_qname,
49     void **                             ip,
50     globus_soap_message_handle_t        message_handle,
51     globus_xsd_element_options_t        options)
52 0 {
53 0     return wsp_PolicyAssertions_group_choice_deserialize_pointer(
54         element_qname,
55         (wsp_PolicyAssertions_group_choice **) ip,
56         message_handle, options);
57 }
58
59 globus_result_t
60 wsp_PolicyAssertions_group_choice_init_wrapper(void **object)
61 0 {
62 0     return wsp_PolicyAssertions_group_choice_init(
63         (wsp_PolicyAssertions_group_choice **) object);
64 }
65
66 void
67 wsp_PolicyAssertions_group_choice_destroy_wrapper(
68     void *                          object)
69 0 {
70 0     wsp_PolicyAssertions_group_choice_destroy(
71         (wsp_PolicyAssertions_group_choice *) object);
72 }
73
74 globus_result_t
75 wsp_PolicyAssertions_group_choice_copy_wrapper(
76     void **                         dest_obj,
77     const void *                    src_obj)
78 0 {
79 0     return wsp_PolicyAssertions_group_choice_copy(
80         (wsp_PolicyAssertions_group_choice **) dest_obj,
81         (wsp_PolicyAssertions_group_choice *) src_obj);
82 }
83
84 globus_result_t
85 wsp_PolicyAssertions_group_choice_init_contents_wrapper(void *object)
86 0 {
87 0     return wsp_PolicyAssertions_group_choice_init_contents(
88         (wsp_PolicyAssertions_group_choice *) object);
89 }
90
91 void
92 wsp_PolicyAssertions_group_choice_destroy_contents_wrapper(
93     void *                          object)
94 0 {
95 0     wsp_PolicyAssertions_group_choice_destroy_contents(
96         (wsp_PolicyAssertions_group_choice *) object);
97 }
98
99 globus_result_t
100 wsp_PolicyAssertions_group_choice_copy_contents_wrapper(
101     void *                          dest_obj,
102     const void *                    src_obj)
103 0 {
104 0     return wsp_PolicyAssertions_group_choice_copy_contents(
105         (wsp_PolicyAssertions_group_choice *) dest_obj,
106         (wsp_PolicyAssertions_group_choice *) src_obj);
107 }
108
109 globus_result_t
110 wsp_PolicyAssertions_group_choice_serialize_contents_wrapper(
111     const xsd_QName *                   element_qname,
112     const void *                        instance,
113     globus_soap_message_handle_t        message_handle,
114     globus_xsd_element_options_t        options)
115 0 {
116 0     return wsp_PolicyAssertions_group_choice_serialize_contents(
117         element_qname,
118         (const wsp_PolicyAssertions_group_choice *) instance,
119         message_handle, options);
120 }
121
122 globus_result_t
123 wsp_PolicyAssertions_group_choice_deserialize_contents_wrapper(
124     const xsd_QName *                   element_qname,
125     void **                             instance,
126     globus_soap_message_handle_t        message_handle,
127     globus_xsd_element_options_t        options)
128 0 {
129 0     globus_result_t                     result;
130 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_deserialize_contents_wrapper);
131 0     GlobusSoapMessageDebugEnter();
132
133 0     if(!*instance)
134     {
135 0         result = wsp_PolicyAssertions_group_choice_init(
136             (wsp_PolicyAssertions_group_choice **)instance);
137 0         if(result != GLOBUS_SUCCESS)
138         {
139 0             goto error;
140         }
141     }
142
143 0     result = wsp_PolicyAssertions_group_choice_deserialize_contents(
144         element_qname,
145         *(wsp_PolicyAssertions_group_choice **)instance,
146         message_handle, options);
147 error:
148 0     GlobusSoapMessageDebugExit();
149 0     return result;
150 }
151
152 globus_result_t
153 wsp_PolicyAssertions_group_choice_array_serialize_wrapper(
154     const xsd_QName *               element,
155     const void *                    instance,
156     globus_soap_message_handle_t    message,
157     globus_xsd_element_options_t    options)
158 0 {
159 0     return wsp_PolicyAssertions_group_choice_array_serialize(
160         element,
161         (wsp_PolicyAssertions_group_choice_array *) instance,
162         message, options);
163 }
164
165 globus_result_t
166 wsp_PolicyAssertions_group_choice_array_deserialize_wrapper(
167     const xsd_QName *                   element_qname,
168     void **                             inst,
169     globus_soap_message_handle_t        message,
170     globus_xsd_element_options_t        options)
171 0 {
172 0     if(!*inst)
173     {
174 0         globus_result_t                 result;
175
176 0         result = wsp_PolicyAssertions_group_choice_array_init(
177             (wsp_PolicyAssertions_group_choice_array **)inst);
178 0         if(result != GLOBUS_SUCCESS)
179         {
180 0             return result;
181         }
182     }
183
184 0     return wsp_PolicyAssertions_group_choice_array_deserialize(
185         element_qname,
186         *(wsp_PolicyAssertions_group_choice_array **) inst,
187         message, options);
188 }
189
190 globus_result_t
191 wsp_PolicyAssertions_group_choice_array_init_wrapper(
192     void **                             arr)
193 0 {
194 0     return wsp_PolicyAssertions_group_choice_array_init(
195         (wsp_PolicyAssertions_group_choice_array **) arr);
196 }
197
198 void
199 wsp_PolicyAssertions_group_choice_array_destroy_wrapper(
200     void *                              arr)
201 0 {
202 0     wsp_PolicyAssertions_group_choice_array_destroy(
203         (wsp_PolicyAssertions_group_choice_array *) arr);
204 }
205
206 globus_result_t
207 wsp_PolicyAssertions_group_choice_array_copy_wrapper(
208     void **                             dest_arr,
209     const void *                        src_arr)
210 0 {
211 0     return wsp_PolicyAssertions_group_choice_array_copy(
212         (wsp_PolicyAssertions_group_choice_array **) dest_arr,
213         (const wsp_PolicyAssertions_group_choice_array *) src_arr);
214 }
215
216 globus_result_t
217 wsp_PolicyAssertions_group_choice_array_init_contents_wrapper(
218     void *                              arr)
219 0 {
220 0     return wsp_PolicyAssertions_group_choice_array_init_contents(
221         (wsp_PolicyAssertions_group_choice_array *) arr);
222 }
223
224 void
225 wsp_PolicyAssertions_group_choice_array_destroy_contents_wrapper(
226     void *                              arr)
227 0 {
228 0     wsp_PolicyAssertions_group_choice_array_destroy_contents(
229         (wsp_PolicyAssertions_group_choice_array *) arr);
230 }
231
232 globus_result_t
233 wsp_PolicyAssertions_group_choice_array_copy_contents_wrapper(
234     void *                              dest_arr,
235     const void *                        src_arr)
236 0 {
237 0     return wsp_PolicyAssertions_group_choice_array_copy_contents(
238         (wsp_PolicyAssertions_group_choice_array *) dest_arr,
239         (const wsp_PolicyAssertions_group_choice_array *) src_arr);
240 }
241
242 struct globus_xsd_type_info_s wsp_PolicyAssertions_group_choice_array_info =
243 {
244     &wsp_PolicyAssertions_group_choice_qname,
245     wsp_PolicyAssertions_group_choice_array_serialize_wrapper,
246     wsp_PolicyAssertions_group_choice_array_deserialize_wrapper,
247     wsp_PolicyAssertions_group_choice_array_init_wrapper,
248     wsp_PolicyAssertions_group_choice_array_destroy_wrapper,
249     wsp_PolicyAssertions_group_choice_array_copy_wrapper,
250     wsp_PolicyAssertions_group_choice_array_init_contents_wrapper,
251     wsp_PolicyAssertions_group_choice_array_destroy_contents_wrapper,
252     wsp_PolicyAssertions_group_choice_array_copy_contents_wrapper,
253     sizeof(wsp_PolicyAssertions_group_choice),
254     wsp_PolicyAssertions_group_choice_array_push_wrapper,
255     NULL,
256     NULL
257 };
258
259 struct globus_xsd_type_info_s wsp_PolicyAssertions_group_choice_contents_info =
260 {
261     &wsp_PolicyAssertions_group_choice_qname,
262     wsp_PolicyAssertions_group_choice_serialize_contents_wrapper,
263     wsp_PolicyAssertions_group_choice_deserialize_contents_wrapper,
264     wsp_PolicyAssertions_group_choice_init_wrapper,
265     wsp_PolicyAssertions_group_choice_destroy_wrapper,
266     wsp_PolicyAssertions_group_choice_copy_wrapper,
267     wsp_PolicyAssertions_group_choice_init_contents_wrapper,
268     wsp_PolicyAssertions_group_choice_destroy_contents_wrapper,
269     wsp_PolicyAssertions_group_choice_copy_contents_wrapper,
270     sizeof(wsp_PolicyAssertions_group_choice),
271     NULL,
272     NULL,
273     NULL
274 };
275
276 struct globus_xsd_type_info_s wsp_PolicyAssertions_group_choice_info =
277 {
278     &wsp_PolicyAssertions_group_choice_qname,
279     wsp_PolicyAssertions_group_choice_serialize_wrapper,
280     wsp_PolicyAssertions_group_choice_deserialize_pointer_wrapper,
281     wsp_PolicyAssertions_group_choice_init_wrapper,
282     wsp_PolicyAssertions_group_choice_destroy_wrapper,
283     wsp_PolicyAssertions_group_choice_copy_wrapper,
284     wsp_PolicyAssertions_group_choice_init_contents_wrapper,
285     wsp_PolicyAssertions_group_choice_destroy_contents_wrapper,
286     wsp_PolicyAssertions_group_choice_copy_contents_wrapper,
287     sizeof(wsp_PolicyAssertions_group_choice),
288     NULL,
289     &wsp_PolicyAssertions_group_choice_contents_info,
290     &wsp_PolicyAssertions_group_choice_array_info
291 };
292
293 globus_result_t
294 wsp_PolicyAssertions_group_choice_init_contents(
295     wsp_PolicyAssertions_group_choice *                    instance)
296 0 {
297 0     globus_result_t                     result = GLOBUS_SUCCESS;
298 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_init_contents);
299 0     GlobusSoapMessageDebugEnter();
300
301 0     memset(instance, 0, sizeof(wsp_PolicyAssertions_group));
302
303 0     GlobusSoapMessageDebugExit();
304 0     return result;
305 }
306
307 globus_result_t
308 wsp_PolicyAssertions_group_choice_init(
309     wsp_PolicyAssertions_group_choice ** object)
310 0 {
311 0     wsp_PolicyAssertions_group_choice * instance;
312 0     globus_result_t                     result = GLOBUS_SUCCESS;
313 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_init);
314 0     GlobusSoapMessageDebugEnter();
315
316 0     instance = globus_malloc(sizeof(wsp_PolicyAssertions_group_choice));
317 0     if(!instance)
318     {
319 0         result = GlobusSoapMessageErrorOutOfMemory;
320 0         goto exit;
321     }
322
323 0     memset(instance, 0, sizeof(wsp_PolicyAssertions_group_choice));
324
325 0     *object = instance;
326
327  exit:
328 0     GlobusSoapMessageDebugExit();
329 0     return result;
330 }
331
332 void
333 wsp_PolicyAssertions_group_choice_destroy(
334     wsp_PolicyAssertions_group_choice * instance)
335 0 {
336 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_destroy);
337 0     GlobusSoapMessageDebugEnter();
338
339 0     if(!instance)
340     {
341 0         goto exit;
342     }
343
344 0     wsp_PolicyAssertions_group_choice_destroy_contents(instance);
345 0     free(instance);
346
347  exit:
348
349 0     GlobusSoapMessageDebugExit();
350 }
351
352
353
354 void
355 wsp_PolicyAssertions_group_choice_destroy_contents(
356     wsp_PolicyAssertions_group_choice * instance)
357 0 {
358 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_destroy_contents);
359 0     GlobusSoapMessageDebugEnter();
360
361 0     switch(instance->type)
362     {
363
364     case wsp_PolicyAssertions_group_TextEncoding:
365
366 0         wsp_TextEncodingAssertion_destroy_contents(
367              &instance->value.TextEncoding);
368 0         break;
369
370     case wsp_PolicyAssertions_group_Language:
371
372 0         wsp_LanguageAssertion_destroy_contents(
373              &instance->value.Language);
374 0         break;
375
376     case wsp_PolicyAssertions_group_SpecVersion:
377
378 0         wsp_SpecVersionAssertion_destroy_contents(
379              &instance->value.SpecVersion);
380 0         break;
381
382     case wsp_PolicyAssertions_group_MessagePredicate:
383
384 0         wsp_MessagePredicateAssertion_destroy_contents(
385              &instance->value.MessagePredicate);
386         break;
387
388         default:
389 0             break;
390     }
391
392 0     instance->type = wsp_PolicyAssertions_group_undefined;
393
394 0     GlobusSoapMessageDebugExit();
395 }
396
397 globus_result_t
398 wsp_PolicyAssertions_group_choice_copy(
399     wsp_PolicyAssertions_group_choice ** dest_obj,
400     const wsp_PolicyAssertions_group_choice * src_obj)
401 0 {
402 0     globus_result_t                     result = GLOBUS_SUCCESS;
403 0     wsp_PolicyAssertions_group_choice * instance;
404 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_copy);
405
406 0     GlobusSoapMessageDebugEnter();
407
408 0     instance = malloc(sizeof(wsp_PolicyAssertions_group_choice));
409 0     if (instance == NULL)
410     {
411 0         GlobusSoapMessageDebugExit();
412 0         return GlobusSoapMessageErrorOutOfMemory;
413     }
414
415 0     result = wsp_PolicyAssertions_group_choice_copy_contents(instance, src_obj);
416 0     if(result != GLOBUS_SUCCESS)
417     {
418 0         globus_free(instance);
419 0         GlobusSoapMessageDebugExit();
420 0         return GlobusSoapMessageErrorOutOfMemory;
421     }
422
423 0     *dest_obj = instance;
424 0     GlobusSoapMessageDebugExit();
425 0     return result;
426 }
427
428
429
430 globus_result_t
431 wsp_PolicyAssertions_group_choice_copy_contents(
432     wsp_PolicyAssertions_group_choice * instance,
433     const wsp_PolicyAssertions_group_choice * src_obj)
434 0 {
435 0     xsd_QName                           subelement;
436 0     globus_result_t                     result = GLOBUS_SUCCESS;
437 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_copy_contents);
438
439 0     GlobusSoapMessageDebugEnter();
440
441 0     switch(src_obj->type)
442     {
443
444     case wsp_PolicyAssertions_group_TextEncoding:
445 0         instance->type = wsp_PolicyAssertions_group_TextEncoding;
446 0         result = wsp_TextEncodingAssertion_copy_contents(
447             &instance->value.TextEncoding,
448             &src_obj->value.TextEncoding);
449 0         if(result != GLOBUS_SUCCESS)
450         {
451 0             result = GlobusSoapMessageErrorSerializeFailed(
452                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
453 0             goto exit;
454         }
455
456 0         break;
457
458     case wsp_PolicyAssertions_group_Language:
459 0         instance->type = wsp_PolicyAssertions_group_Language;
460 0         result = wsp_LanguageAssertion_copy_contents(
461             &instance->value.Language,
462             &src_obj->value.Language);
463 0         if(result != GLOBUS_SUCCESS)
464         {
465 0             result = GlobusSoapMessageErrorSerializeFailed(
466                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
467 0             goto exit;
468         }
469
470 0         break;
471
472     case wsp_PolicyAssertions_group_SpecVersion:
473 0         instance->type = wsp_PolicyAssertions_group_SpecVersion;
474 0         result = wsp_SpecVersionAssertion_copy_contents(
475             &instance->value.SpecVersion,
476             &src_obj->value.SpecVersion);
477 0         if(result != GLOBUS_SUCCESS)
478         {
479 0             result = GlobusSoapMessageErrorSerializeFailed(
480                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
481 0             goto exit;
482         }
483
484 0         break;
485
486     case wsp_PolicyAssertions_group_MessagePredicate:
487 0         instance->type = wsp_PolicyAssertions_group_MessagePredicate;
488 0         result = wsp_MessagePredicateAssertion_copy_contents(
489             &instance->value.MessagePredicate,
490             &src_obj->value.MessagePredicate);
491 0         if(result != GLOBUS_SUCCESS)
492         {
493 0             result = GlobusSoapMessageErrorSerializeFailed(
494                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
495             goto exit;
496         }
497
498 0         break;
499
500     default:
501 0         break;
502     }
503
504  exit:
505
506 0     GlobusSoapMessageDebugExit();
507 0     return result;
508 }
509
510
511
512
513
514 globus_result_t
515 wsp_PolicyAssertions_group_choice_serialize_contents(
516     const xsd_QName *                   element_qname, /* ignored */
517     const wsp_PolicyAssertions_group_choice *       instance,
518     globus_soap_message_handle_t        message_handle,
519     globus_xsd_element_options_t        options)
520 0 {
521 0     xsd_QName                           subelement;
522 0     globus_result_t                     result = GLOBUS_SUCCESS;
523 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_serialize_contents);
524 0     GlobusSoapMessageDebugEnter();
525
526 0     switch(instance->type)
527     {
528
529     case wsp_PolicyAssertions_group_TextEncoding:
530
531 0         subelement.local = "TextEncoding";
532 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
533 0         result = wsp_TextEncodingAssertion_serialize(
534             &subelement,
535             &instance->value.TextEncoding,
536             message_handle,
537             options);
538 0         if(result != GLOBUS_SUCCESS)
539         {
540 0             result = GlobusSoapMessageErrorSerializeFailed(
541                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
542 0             goto exit;
543         }
544
545 0         break;
546
547     case wsp_PolicyAssertions_group_Language:
548
549 0         subelement.local = "Language";
550 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
551 0         result = wsp_LanguageAssertion_serialize(
552             &subelement,
553             &instance->value.Language,
554             message_handle,
555             options);
556 0         if(result != GLOBUS_SUCCESS)
557         {
558 0             result = GlobusSoapMessageErrorSerializeFailed(
559                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
560 0             goto exit;
561         }
562
563 0         break;
564
565     case wsp_PolicyAssertions_group_SpecVersion:
566
567 0         subelement.local = "SpecVersion";
568 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
569 0         result = wsp_SpecVersionAssertion_serialize(
570             &subelement,
571             &instance->value.SpecVersion,
572             message_handle,
573             options);
574 0         if(result != GLOBUS_SUCCESS)
575         {
576 0             result = GlobusSoapMessageErrorSerializeFailed(
577                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
578 0             goto exit;
579         }
580
581 0         break;
582
583     case wsp_PolicyAssertions_group_MessagePredicate:
584
585 0         subelement.local = "MessagePredicate";
586 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
587 0         result = wsp_MessagePredicateAssertion_serialize(
588             &subelement,
589             &instance->value.MessagePredicate,
590             message_handle,
591             options);
592 0         if(result != GLOBUS_SUCCESS)
593         {
594 0             result = GlobusSoapMessageErrorSerializeFailed(
595                 result, NULL, &wsp_PolicyAssertions_group_choice_qname);
596             goto exit;
597         }
598
599 0         break;
600
601         default:
602 0             break;
603     }
604
605  exit:
606
607 0     GlobusSoapMessageDebugExit();
608 0     return result;
609 }
610
611
612
613 globus_result_t
614 wsp_PolicyAssertions_group_choice_serialize(
615     const xsd_QName *                   element_qname,
616     const wsp_PolicyAssertions_group_choice *       instance,
617     globus_soap_message_handle_t        message_handle,
618     globus_xsd_element_options_t        options)
619 0 {
620 0     globus_result_t                     result = GLOBUS_SUCCESS;
621 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_serialize);
622 0     GlobusSoapMessageDebugEnter();
623
624 0     result = wsp_PolicyAssertions_group_choice_serialize_contents(
625         element_qname,
626         instance,
627         message_handle,
628         options);
629 0     if(result != GLOBUS_SUCCESS)
630     {
631 0         result = GlobusSoapMessageErrorSerializeFailed(
632             result, NULL, &wsp_PolicyAssertions_group_choice_qname);
633         goto exit;
634     }
635
636  exit:
637 0     GlobusSoapMessageDebugExit();
638 0     return result;
639 }
640
641
642
643
644
645 globus_result_t
646 wsp_PolicyAssertions_group_choice_deserialize_contents(
647     const xsd_QName *                   element_qname, /* ignored */
648     wsp_PolicyAssertions_group_choice *             instance,
649     globus_soap_message_handle_t        message_handle,
650     globus_xsd_element_options_t        options)
651 0 {
652 0     globus_result_t                     result = GLOBUS_SUCCESS;
653 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_deserialize_contents);
654 0     GlobusSoapMessageDebugEnter();
655
656 0     result = wsp_PolicyAssertions_group_choice_deserialize(
657         NULL,
658         instance,
659         message_handle,
660         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
661 0     if(result != GLOBUS_SUCCESS)
662     {
663 0         result = GlobusSoapMessageErrorDeserializeFailed(
664             result, element_qname);
665         goto exit;
666     }
667
668  exit:
669
670 0     GlobusSoapMessageDebugExit();
671 0     return result;
672 }
673
674
675
676 globus_result_t
677 wsp_PolicyAssertions_group_choice_deserialize(
678     const xsd_QName *                   element_qname,
679     wsp_PolicyAssertions_group_choice *             instance,
680     globus_soap_message_handle_t        message_handle,
681     globus_xsd_element_options_t        options)
682 0 {
683 0     globus_result_t                     result = GLOBUS_SUCCESS;
684 0     xsd_QName                           subelement;
685 0     xsd_QName                           deselem_qname = { NULL, NULL } ;
686 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_deserialize);
687 0     GlobusSoapMessageDebugEnter();
688
689 0     xsd_QName_init_contents(&deselem_qname);
690
691 0     do
692     {
693 0         result = globus_soap_message_deserialize_element_unknown(
694             message_handle, &deselem_qname);
695 0         if(result != GLOBUS_SUCCESS)
696         {
697 0             result = GlobusSoapMessageErrorDeserializeFailed(
698                 result, &wsp_PolicyAssertions_group_choice_qname);
699 0             goto exit;
700         }
701
702 0         if(globus_soap_message_deserialize_element_is_nil(message_handle))
703         {
704 0             xsd_QName_destroy_contents(&deselem_qname);
705 0             result = globus_soap_message_deserialize_element_end(
706                 message_handle,
707                 element_qname);
708 0             if(result != GLOBUS_SUCCESS)
709             {
710 0                 result = GlobusSoapMessageErrorDeserializeFailed(
711                     result, &wsp_PolicyAssertions_group_choice_qname);
712 0                 goto exit;
713             }
714         }
715         else
716         {
717 0             break;
718         }
719 0     } while(1);
720
721 0     globus_soap_message_deserialize_push_element(message_handle);
722
723 0     subelement.local = "TextEncoding";
724 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
725 0     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
726     {
727 0         instance->type=wsp_PolicyAssertions_group_TextEncoding;
728 0         result = wsp_TextEncodingAssertion_deserialize(
729             &subelement,
730             &instance->value.TextEncoding,
731             message_handle,
732             options);
733 0         if(result != GLOBUS_SUCCESS)
734         {
735 0             result = GlobusSoapMessageErrorDeserializeFailed(
736                 result, &wsp_PolicyAssertions_group_choice_qname);
737 0             goto TextEncoding_destroy;
738         }
739
740 0         goto exit;
741     }
742
743 0     subelement.local = "Language";
744 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
745 0     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
746     {
747 0         instance->type=wsp_PolicyAssertions_group_Language;
748 0         result = wsp_LanguageAssertion_deserialize(
749             &subelement,
750             &instance->value.Language,
751             message_handle,
752             options);
753 0         if(result != GLOBUS_SUCCESS)
754         {
755 0             result = GlobusSoapMessageErrorDeserializeFailed(
756                 result, &wsp_PolicyAssertions_group_choice_qname);
757 0             goto Language_destroy;
758         }
759
760 0         goto exit;
761     }
762
763 0     subelement.local = "SpecVersion";
764 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
765 0     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
766     {
767 0         instance->type=wsp_PolicyAssertions_group_SpecVersion;
768 0         result = wsp_SpecVersionAssertion_deserialize(
769             &subelement,
770             &instance->value.SpecVersion,
771             message_handle,
772             options);
773 0         if(result != GLOBUS_SUCCESS)
774         {
775 0             result = GlobusSoapMessageErrorDeserializeFailed(
776                 result, &wsp_PolicyAssertions_group_choice_qname);
777 0             goto SpecVersion_destroy;
778         }
779
780 0         goto exit;
781     }
782
783 0     subelement.local = "MessagePredicate";
784 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
785 0     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
786     {
787 0         instance->type=wsp_PolicyAssertions_group_MessagePredicate;
788 0         result = wsp_MessagePredicateAssertion_deserialize(
789             &subelement,
790             &instance->value.MessagePredicate,
791             message_handle,
792             options);
793 0         if(result != GLOBUS_SUCCESS)
794         {
795 0             result = GlobusSoapMessageErrorDeserializeFailed(
796                 result, &wsp_PolicyAssertions_group_choice_qname);
797 0             goto MessagePredicate_destroy;
798         }
799
800 0         goto exit;
801     }
802
803 0     instance->type = wsp_PolicyAssertions_group_undefined;
804 0     result = GlobusSoapMessageErrorDeserializeFailed(
805                 result, &wsp_PolicyAssertions_group_choice_qname);
806  
807     goto exit;
808
809  deserialize_failed:
810
811  MessagePredicate_destroy:
812
813  SpecVersion_destroy:
814
815  Language_destroy:
816
817  TextEncoding_destroy:
818
819  exit:
820
821 0     xsd_QName_destroy_contents(&deselem_qname);
822
823 0     if(result == GLOBUS_SUCCESS)
824     {
825 0         do
826         {
827 0             result = globus_soap_message_deserialize_element(
828                 message_handle, NULL);
829 0             if(result != GLOBUS_SUCCESS &&
830                (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
831                 GlobusSoapMessageStatusFailedElementCheck(result) ||
832                 GlobusSoapMessageStatusFailedWithTextCheck(result)))
833             {
834 0                 result = GLOBUS_SUCCESS;
835 0                 break;
836             }
837
838 0             if(globus_soap_message_deserialize_element_is_nil(
839                    message_handle))
840             {
841 0                 result = globus_soap_message_deserialize_element_end(
842                     message_handle,
843                     element_qname);
844 0                 if(result != GLOBUS_SUCCESS)
845                 {
846 0                     result = GlobusSoapMessageErrorDeserializeFailed(
847                         result, &wsp_PolicyAssertions_group_choice_qname);
848                     break;
849                 }
850             }
851             else
852             {
853 0                 break;
854             }
855
856 0         } while(1);
857     }
858
859 0     xsd_QName_destroy_contents(&deselem_qname);
860
861 0     GlobusSoapMessageDebugExit();
862 0     return result;
863 }
864
865
866
867 globus_result_t
868 wsp_PolicyAssertions_group_choice_deserialize_pointer(
869     const xsd_QName *                   element_qname,
870     wsp_PolicyAssertions_group_choice **            ip,
871     globus_soap_message_handle_t        message_handle,
872     globus_xsd_element_options_t        options)
873 0 {
874 0     wsp_PolicyAssertions_group_choice * instance = NULL;
875 0     globus_result_t                     result = GLOBUS_SUCCESS;
876 0     xsd_QName                           subelement;
877 0     GlobusFuncName(wsp_PolicyAssertions_group_choice_deserialize_pointer);
878 0     GlobusSoapMessageDebugEnter();
879
880 0     *ip = NULL;
881
882 0     result = wsp_PolicyAssertions_group_choice_init(&instance);
883 0     if(result != GLOBUS_SUCCESS)
884     {
885 0         result = GlobusSoapMessageErrorDeserializeFailed(
886             result, element_qname);
887 0         goto exit;
888     }
889
890 0     result = wsp_PolicyAssertions_group_choice_deserialize(
891         element_qname,
892         instance,
893         message_handle,
894         options);
895 0     if(result != GLOBUS_SUCCESS)
896     {
897 0         goto exit;
898     }
899
900 0     *ip = instance;
901
902  exit:
903
904 0     GlobusSoapMessageDebugExit();
905 0     return result;
906 }
907
908
909
910 globus_result_t
911 wsp_PolicyAssertions_group_choice_array_init_contents(
912     wsp_PolicyAssertions_group_choice_array * array)
913 0 {
914 0     return globus_xsd_generic_array_init_contents(
915         (globus_xsd_generic_array_t *) array,
916         &wsp_PolicyAssertions_group_choice_array_info);
917 }
918 /* wsp_PolicyAssertions_group_choice_array_init_contents() */
919
920 globus_result_t
921 wsp_PolicyAssertions_group_choice_array_init(
922     wsp_PolicyAssertions_group_choice_array ** arr)
923 0 {
924 0     return globus_xsd_generic_array_init(
925         (globus_xsd_generic_array_t **) arr,
926         &wsp_PolicyAssertions_group_choice_info);
927 }
928 /* wsp_PolicyAssertions_group_choice_array_init() */
929
930 void
931 wsp_PolicyAssertions_group_choice_array_destroy_contents(
932     wsp_PolicyAssertions_group_choice_array * array)
933 0 {
934 0     globus_xsd_generic_array_destroy_contents(
935         (globus_xsd_generic_array_t *) array);
936 }
937 /* wsp_PolicyAssertions_group_choice_array_destroy_contents() */
938
939 void
940 wsp_PolicyAssertions_group_choice_array_destroy(
941     wsp_PolicyAssertions_group_choice_array * array)
942 0 {
943 0     globus_xsd_generic_array_destroy(
944         (globus_xsd_generic_array_t *) array);
945 }
946 /* wsp_PolicyAssertions_group_choice_array_destroy() */
947
948 globus_result_t
949 wsp_PolicyAssertions_group_choice_array_copy(
950     wsp_PolicyAssertions_group_choice_array ** dest_arr,
951     const wsp_PolicyAssertions_group_choice_array * src_arr)
952 0 {
953 0     return globus_xsd_generic_array_copy(
954         (globus_xsd_generic_array_t **) dest_arr,
955         (const globus_xsd_generic_array_t *) src_arr);
956 }
957 /* wsp_PolicyAssertions_group_choice_array_copy() */
958
959 globus_result_t
960 wsp_PolicyAssertions_group_choice_array_copy_contents(
961     wsp_PolicyAssertions_group_choice_array * dest_arr,
962     const wsp_PolicyAssertions_group_choice_array * src_arr)
963 0 {
964 0     return globus_xsd_generic_array_copy_contents(
965         (globus_xsd_generic_array_t *) dest_arr,
966         (const globus_xsd_generic_array_t *) src_arr);
967 }
968
969 wsp_PolicyAssertions_group_choice *
970 wsp_PolicyAssertions_group_choice_array_push(
971     wsp_PolicyAssertions_group_choice_array * array)
972 0 {
973     /* Some contents initializers don't initialize subelments but to set their
974      * values to be NULL
975      */
976 0     if (array->type_info == NULL)
977     {
978 0         array->type_info = &wsp_PolicyAssertions_group_choice_info;
979     }
980 0     return globus_xsd_generic_array_push(
981         (globus_xsd_generic_array_t *) array);
982 }
983 /* wsp_PolicyAssertions_group_choice_array_push() */
984
985 void *
986 wsp_PolicyAssertions_group_choice_array_push_wrapper(
987     void * array)
988 0 {
989 0     return (void *) wsp_PolicyAssertions_group_choice_array_push(
990         (wsp_PolicyAssertions_group_choice_array *) array);
991 }
992
993 globus_result_t
994 wsp_PolicyAssertions_group_choice_array_serialize(
995     const xsd_QName *                   element_qname,
996     const wsp_PolicyAssertions_group_choice_array * array,
997     globus_soap_message_handle_t        message,
998     globus_xsd_element_options_t        options)
999 0 {
1000 0     return globus_xsd_generic_array_serialize(
1001         element_qname,
1002         (const globus_xsd_generic_array_t *) array,
1003         message,
1004         options);
1005 }
1006 /* wsp_PolicyAssertions_group_choice_array_serialize() */
1007
1008 globus_result_t
1009 wsp_PolicyAssertions_group_choice_array_deserialize(
1010     const xsd_QName *                   element_qname,
1011     wsp_PolicyAssertions_group_choice_array *       array,
1012     globus_soap_message_handle_t        message,
1013     globus_xsd_element_options_t        options)
1014 0 {
1015     /* Some initializers set the array's contents to NULL */
1016 0     if (array->type_info == NULL)
1017     {
1018 0         array->type_info = &wsp_PolicyAssertions_group_choice_info;
1019     }
1020 0     return globus_xsd_generic_array_deserialize(
1021         element_qname,
1022         (globus_xsd_generic_array_t *) array,
1023         message,
1024         options);
1025 }