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 "sgtest_TestStepType.h"
26
27 xsd_QName sgtest_TestStepType_choice_qname =
28 {
29     "http://www.globus.org/namespaces/2005/09/ServiceGroupTest",
30     "TestStepType_choice"
31 };
32
33 globus_result_t
34 sgtest_TestStepType_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 sgtest_TestStepType_choice_serialize(
41         element_qname,
42         (sgtest_TestStepType_choice *) instance,
43         message_handle, options);
44 }
45
46 globus_result_t
47 sgtest_TestStepType_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 sgtest_TestStepType_choice_deserialize_pointer(
54         element_qname,
55         (sgtest_TestStepType_choice **) ip,
56         message_handle, options);
57 }
58
59 globus_result_t
60 sgtest_TestStepType_choice_init_wrapper(void **object)
61 0 {
62 0     return sgtest_TestStepType_choice_init(
63         (sgtest_TestStepType_choice **) object);
64 }
65
66 void
67 sgtest_TestStepType_choice_destroy_wrapper(
68     void *                          object)
69 0 {
70 0     sgtest_TestStepType_choice_destroy(
71         (sgtest_TestStepType_choice *) object);
72 }
73
74 globus_result_t
75 sgtest_TestStepType_choice_copy_wrapper(
76     void **                         dest_obj,
77     const void *                    src_obj)
78 0 {
79 0     return sgtest_TestStepType_choice_copy(
80         (sgtest_TestStepType_choice **) dest_obj,
81         (sgtest_TestStepType_choice *) src_obj);
82 }
83
84 globus_result_t
85 sgtest_TestStepType_choice_init_contents_wrapper(void *object)
86 0 {
87 0     return sgtest_TestStepType_choice_init_contents(
88         (sgtest_TestStepType_choice *) object);
89 }
90
91 void
92 sgtest_TestStepType_choice_destroy_contents_wrapper(
93     void *                          object)
94 0 {
95 0     sgtest_TestStepType_choice_destroy_contents(
96         (sgtest_TestStepType_choice *) object);
97 }
98
99 globus_result_t
100 sgtest_TestStepType_choice_copy_contents_wrapper(
101     void *                          dest_obj,
102     const void *                    src_obj)
103 0 {
104 0     return sgtest_TestStepType_choice_copy_contents(
105         (sgtest_TestStepType_choice *) dest_obj,
106         (sgtest_TestStepType_choice *) src_obj);
107 }
108
109 globus_result_t
110 sgtest_TestStepType_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 sgtest_TestStepType_choice_serialize_contents(
117         element_qname,
118         (const sgtest_TestStepType_choice *) instance,
119         message_handle, options);
120 }
121
122 globus_result_t
123 sgtest_TestStepType_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(sgtest_TestStepType_choice_deserialize_contents_wrapper);
131 0     GlobusSoapMessageDebugEnter();
132
133 0     if(!*instance)
134     {
135 0         result = sgtest_TestStepType_choice_init(
136             (sgtest_TestStepType_choice **)instance);
137 0         if(result != GLOBUS_SUCCESS)
138         {
139 0             goto error;
140         }
141     }
142
143 0     result = sgtest_TestStepType_choice_deserialize_contents(
144         element_qname,
145         *(sgtest_TestStepType_choice **)instance,
146         message_handle, options);
147 error:
148 0     GlobusSoapMessageDebugExit();
149 0     return result;
150 }
151
152 globus_result_t
153 sgtest_TestStepType_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 sgtest_TestStepType_choice_array_serialize(
160         element,
161         (sgtest_TestStepType_choice_array *) instance,
162         message, options);
163 }
164
165 globus_result_t
166 sgtest_TestStepType_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 = sgtest_TestStepType_choice_array_init(
177             (sgtest_TestStepType_choice_array **)inst);
178 0         if(result != GLOBUS_SUCCESS)
179         {
180 0             return result;
181         }
182     }
183
184 0     return sgtest_TestStepType_choice_array_deserialize(
185         element_qname,
186         *(sgtest_TestStepType_choice_array **) inst,
187         message, options);
188 }
189
190 globus_result_t
191 sgtest_TestStepType_choice_array_init_wrapper(
192     void **                             arr)
193 0 {
194 0     return sgtest_TestStepType_choice_array_init(
195         (sgtest_TestStepType_choice_array **) arr);
196 }
197
198 void
199 sgtest_TestStepType_choice_array_destroy_wrapper(
200     void *                              arr)
201 0 {
202 0     sgtest_TestStepType_choice_array_destroy(
203         (sgtest_TestStepType_choice_array *) arr);
204 }
205
206 globus_result_t
207 sgtest_TestStepType_choice_array_copy_wrapper(
208     void **                             dest_arr,
209     const void *                        src_arr)
210 0 {
211 0     return sgtest_TestStepType_choice_array_copy(
212         (sgtest_TestStepType_choice_array **) dest_arr,
213         (const sgtest_TestStepType_choice_array *) src_arr);
214 }
215
216 globus_result_t
217 sgtest_TestStepType_choice_array_init_contents_wrapper(
218     void *                              arr)
219 0 {
220 0     return sgtest_TestStepType_choice_array_init_contents(
221         (sgtest_TestStepType_choice_array *) arr);
222 }
223
224 void
225 sgtest_TestStepType_choice_array_destroy_contents_wrapper(
226     void *                              arr)
227 0 {
228 0     sgtest_TestStepType_choice_array_destroy_contents(
229         (sgtest_TestStepType_choice_array *) arr);
230 }
231
232 globus_result_t
233 sgtest_TestStepType_choice_array_copy_contents_wrapper(
234     void *                              dest_arr,
235     const void *                        src_arr)
236 0 {
237 0     return sgtest_TestStepType_choice_array_copy_contents(
238         (sgtest_TestStepType_choice_array *) dest_arr,
239         (const sgtest_TestStepType_choice_array *) src_arr);
240 }
241
242 struct globus_xsd_type_info_s sgtest_TestStepType_choice_array_info =
243 {
244     &sgtest_TestStepType_choice_qname,
245     sgtest_TestStepType_choice_array_serialize_wrapper,
246     sgtest_TestStepType_choice_array_deserialize_wrapper,
247     sgtest_TestStepType_choice_array_init_wrapper,
248     sgtest_TestStepType_choice_array_destroy_wrapper,
249     sgtest_TestStepType_choice_array_copy_wrapper,
250     sgtest_TestStepType_choice_array_init_contents_wrapper,
251     sgtest_TestStepType_choice_array_destroy_contents_wrapper,
252     sgtest_TestStepType_choice_array_copy_contents_wrapper,
253     sizeof(sgtest_TestStepType_choice),
254     sgtest_TestStepType_choice_array_push_wrapper,
255     NULL,
256     NULL
257 };
258
259 struct globus_xsd_type_info_s sgtest_TestStepType_choice_contents_info =
260 {
261     &sgtest_TestStepType_choice_qname,
262     sgtest_TestStepType_choice_serialize_contents_wrapper,
263     sgtest_TestStepType_choice_deserialize_contents_wrapper,
264     sgtest_TestStepType_choice_init_wrapper,
265     sgtest_TestStepType_choice_destroy_wrapper,
266     sgtest_TestStepType_choice_copy_wrapper,
267     sgtest_TestStepType_choice_init_contents_wrapper,
268     sgtest_TestStepType_choice_destroy_contents_wrapper,
269     sgtest_TestStepType_choice_copy_contents_wrapper,
270     sizeof(sgtest_TestStepType_choice),
271     NULL,
272     NULL,
273     NULL
274 };
275
276 struct globus_xsd_type_info_s sgtest_TestStepType_choice_info =
277 {
278     &sgtest_TestStepType_choice_qname,
279     sgtest_TestStepType_choice_serialize_wrapper,
280     sgtest_TestStepType_choice_deserialize_pointer_wrapper,
281     sgtest_TestStepType_choice_init_wrapper,
282     sgtest_TestStepType_choice_destroy_wrapper,
283     sgtest_TestStepType_choice_copy_wrapper,
284     sgtest_TestStepType_choice_init_contents_wrapper,
285     sgtest_TestStepType_choice_destroy_contents_wrapper,
286     sgtest_TestStepType_choice_copy_contents_wrapper,
287     sizeof(sgtest_TestStepType_choice),
288     NULL,
289     &sgtest_TestStepType_choice_contents_info,
290     &sgtest_TestStepType_choice_array_info
291 };
292
293 globus_result_t
294 sgtest_TestStepType_choice_init_contents(
295     sgtest_TestStepType_choice *                    instance)
296 0 {
297 0     globus_result_t                     result = GLOBUS_SUCCESS;
298 0     GlobusFuncName(sgtest_TestStepType_choice_init_contents);
299 0     GlobusSoapMessageDebugEnter();
300
301 0     memset(instance, 0, sizeof(sgtest_TestStepType));
302
303 0     GlobusSoapMessageDebugExit();
304 0     return result;
305 }
306
307 globus_result_t
308 sgtest_TestStepType_choice_init(
309     sgtest_TestStepType_choice ** object)
310 0 {
311 0     sgtest_TestStepType_choice * instance;
312 0     globus_result_t                     result = GLOBUS_SUCCESS;
313 0     GlobusFuncName(sgtest_TestStepType_choice_init);
314 0     GlobusSoapMessageDebugEnter();
315
316 0     instance = globus_malloc(sizeof(sgtest_TestStepType_choice));
317 0     if(!instance)
318     {
319 0         result = GlobusSoapMessageErrorOutOfMemory;
320 0         goto exit;
321     }
322
323 0     memset(instance, 0, sizeof(sgtest_TestStepType_choice));
324
325 0     *object = instance;
326
327  exit:
328 0     GlobusSoapMessageDebugExit();
329 0     return result;
330 }
331
332 void
333 sgtest_TestStepType_choice_destroy(
334     sgtest_TestStepType_choice * instance)
335 0 {
336 0     GlobusFuncName(sgtest_TestStepType_choice_destroy);
337 0     GlobusSoapMessageDebugEnter();
338
339 0     if(!instance)
340     {
341 0         goto exit;
342     }
343
344 0     sgtest_TestStepType_choice_destroy_contents(instance);
345 0     free(instance);
346
347  exit:
348
349 0     GlobusSoapMessageDebugExit();
350 }
351
352
353
354 void
355 sgtest_TestStepType_choice_destroy_contents(
356     sgtest_TestStepType_choice * instance)
357 12 {
358 12     GlobusFuncName(sgtest_TestStepType_choice_destroy_contents);
359 12     GlobusSoapMessageDebugEnter();
360
361 12     switch(instance->type)
362     {
363
364     case sgtest_TestStepType_AddTest:
365
366 3         sgtest_AddTestType_destroy_contents(
367              &instance->value.AddTest);
368 3         break;
369
370     case sgtest_TestStepType_GetResourcePropertyTest:
371
372 5         rptest_GetResourcePropertyTestType_destroy_contents(
373              &instance->value.GetResourcePropertyTest);
374 5         break;
375
376     case sgtest_TestStepType_CreateConsumerTest:
377
378 1         nptest_CreateConsumerTestType_destroy_contents(
379              &instance->value.CreateConsumerTest);
380 1         break;
381
382     case sgtest_TestStepType_SubscribeTest:
383
384 2         nptest_SubscribeTestType_destroy_contents(
385              &instance->value.SubscribeTest);
386 2         break;
387
388     case sgtest_TestStepType_ExpectNotificationTest:
389
390 1         nptest_ExpectNotificationTestType_destroy_contents(
391              &instance->value.ExpectNotificationTest);
392         break;
393
394         default:
395 12             break;
396     }
397
398 12     instance->type = sgtest_TestStepType_undefined;
399
400 12     GlobusSoapMessageDebugExit();
401 }
402
403 globus_result_t
404 sgtest_TestStepType_choice_copy(
405     sgtest_TestStepType_choice ** dest_obj,
406     const sgtest_TestStepType_choice * src_obj)
407 0 {
408 0     globus_result_t                     result = GLOBUS_SUCCESS;
409 0     sgtest_TestStepType_choice * instance;
410 0     GlobusFuncName(sgtest_TestStepType_choice_copy);
411
412 0     GlobusSoapMessageDebugEnter();
413
414 0     instance = malloc(sizeof(sgtest_TestStepType_choice));
415 0     if (instance == NULL)
416     {
417 0         GlobusSoapMessageDebugExit();
418 0         return GlobusSoapMessageErrorOutOfMemory;
419     }
420
421 0     result = sgtest_TestStepType_choice_copy_contents(instance, src_obj);
422 0     if(result != GLOBUS_SUCCESS)
423     {
424 0         globus_free(instance);
425 0         GlobusSoapMessageDebugExit();
426 0         return GlobusSoapMessageErrorOutOfMemory;
427     }
428
429 0     *dest_obj = instance;
430 0     GlobusSoapMessageDebugExit();
431 0     return result;
432 }
433
434
435
436 globus_result_t
437 sgtest_TestStepType_choice_copy_contents(
438     sgtest_TestStepType_choice * instance,
439     const sgtest_TestStepType_choice * src_obj)
440 12 {
441 12     xsd_QName                           subelement;
442 12     globus_result_t                     result = GLOBUS_SUCCESS;
443 12     GlobusFuncName(sgtest_TestStepType_choice_copy_contents);
444
445 12     GlobusSoapMessageDebugEnter();
446
447 12     switch(src_obj->type)
448     {
449
450     case sgtest_TestStepType_AddTest:
451 3         instance->type = sgtest_TestStepType_AddTest;
452 3         result = sgtest_AddTestType_copy_contents(
453             &instance->value.AddTest,
454             &src_obj->value.AddTest);
455 3         if(result != GLOBUS_SUCCESS)
456         {
457 0             result = GlobusSoapMessageErrorSerializeFailed(
458                 result, NULL, &sgtest_TestStepType_choice_qname);
459 0             goto exit;
460         }
461
462 5         break;
463
464     case sgtest_TestStepType_GetResourcePropertyTest:
465 5         instance->type = sgtest_TestStepType_GetResourcePropertyTest;
466 5         result = rptest_GetResourcePropertyTestType_copy_contents(
467             &instance->value.GetResourcePropertyTest,
468             &src_obj->value.GetResourcePropertyTest);
469 5         if(result != GLOBUS_SUCCESS)
470         {
471 0             result = GlobusSoapMessageErrorSerializeFailed(
472                 result, NULL, &sgtest_TestStepType_choice_qname);
473 0             goto exit;
474         }
475
476 1         break;
477
478     case sgtest_TestStepType_CreateConsumerTest:
479 1         instance->type = sgtest_TestStepType_CreateConsumerTest;
480 1         result = nptest_CreateConsumerTestType_copy_contents(
481             &instance->value.CreateConsumerTest,
482             &src_obj->value.CreateConsumerTest);
483 1         if(result != GLOBUS_SUCCESS)
484         {
485 0             result = GlobusSoapMessageErrorSerializeFailed(
486                 result, NULL, &sgtest_TestStepType_choice_qname);
487 0             goto exit;
488         }
489
490 2         break;
491
492     case sgtest_TestStepType_SubscribeTest:
493 2         instance->type = sgtest_TestStepType_SubscribeTest;
494 2         result = nptest_SubscribeTestType_copy_contents(
495             &instance->value.SubscribeTest,
496             &src_obj->value.SubscribeTest);
497 2         if(result != GLOBUS_SUCCESS)
498         {
499 0             result = GlobusSoapMessageErrorSerializeFailed(
500                 result, NULL, &sgtest_TestStepType_choice_qname);
501 0             goto exit;
502         }
503
504 1         break;
505
506     case sgtest_TestStepType_ExpectNotificationTest:
507 1         instance->type = sgtest_TestStepType_ExpectNotificationTest;
508 1         result = nptest_ExpectNotificationTestType_copy_contents(
509             &instance->value.ExpectNotificationTest,
510             &src_obj->value.ExpectNotificationTest);
511 1         if(result != GLOBUS_SUCCESS)
512         {
513 0             result = GlobusSoapMessageErrorSerializeFailed(
514                 result, NULL, &sgtest_TestStepType_choice_qname);
515             goto exit;
516         }
517
518 12         break;
519
520     default:
521 12         break;
522     }
523
524  exit:
525
526 12     GlobusSoapMessageDebugExit();
527 12     return result;
528 }
529
530
531
532
533
534 globus_result_t
535 sgtest_TestStepType_choice_serialize_contents(
536     const xsd_QName *                   element_qname, /* ignored */
537     const sgtest_TestStepType_choice *       instance,
538     globus_soap_message_handle_t        message_handle,
539     globus_xsd_element_options_t        options)
540 0 {
541 0     xsd_QName                           subelement;
542 0     globus_result_t                     result = GLOBUS_SUCCESS;
543 0     GlobusFuncName(sgtest_TestStepType_choice_serialize_contents);
544 0     GlobusSoapMessageDebugEnter();
545
546 0     switch(instance->type)
547     {
548
549     case sgtest_TestStepType_AddTest:
550
551 0         subelement.local = "AddTest";
552 0         subelement.Namespace = "http://www.globus.org/namespaces/2005/09/ServiceGroupTest";
553 0         result = sgtest_AddTestType_serialize(
554             &subelement,
555             &instance->value.AddTest,
556             message_handle,
557             options);
558 0         if(result != GLOBUS_SUCCESS)
559         {
560 0             result = GlobusSoapMessageErrorSerializeFailed(
561                 result, NULL, &sgtest_TestStepType_choice_qname);
562 0             goto exit;
563         }
564
565 0         break;
566
567     case sgtest_TestStepType_GetResourcePropertyTest:
568
569 0         subelement.local = "GetResourcePropertyTest";
570 0         subelement.Namespace = "http://www.globus.org/namespaces/2004/10/ResourcePropertiesTest";
571 0         result = rptest_GetResourcePropertyTestType_serialize(
572             &subelement,
573             &instance->value.GetResourcePropertyTest,
574             message_handle,
575             options);
576 0         if(result != GLOBUS_SUCCESS)
577         {
578 0             result = GlobusSoapMessageErrorSerializeFailed(
579                 result, NULL, &sgtest_TestStepType_choice_qname);
580 0             goto exit;
581         }
582
583 0         break;
584
585     case sgtest_TestStepType_CreateConsumerTest:
586
587 0         subelement.local = "CreateConsumerTest";
588 0         subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
589 0         result = nptest_CreateConsumerTestType_serialize(
590             &subelement,
591             &instance->value.CreateConsumerTest,
592             message_handle,
593             options);
594 0         if(result != GLOBUS_SUCCESS)
595         {
596 0             result = GlobusSoapMessageErrorSerializeFailed(
597                 result, NULL, &sgtest_TestStepType_choice_qname);
598 0             goto exit;
599         }
600
601 0         break;
602
603     case sgtest_TestStepType_SubscribeTest:
604
605 0         subelement.local = "SubscribeTest";
606 0         subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
607 0         result = nptest_SubscribeTestType_serialize(
608             &subelement,
609             &instance->value.SubscribeTest,
610             message_handle,
611             options);
612 0         if(result != GLOBUS_SUCCESS)
613         {
614 0             result = GlobusSoapMessageErrorSerializeFailed(
615                 result, NULL, &sgtest_TestStepType_choice_qname);
616 0             goto exit;
617         }
618
619 0         break;
620
621     case sgtest_TestStepType_ExpectNotificationTest:
622
623 0         subelement.local = "ExpectNotificationTest";
624 0         subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
625 0         result = nptest_ExpectNotificationTestType_serialize(
626             &subelement,
627             &instance->value.ExpectNotificationTest,
628             message_handle,
629             options);
630 0         if(result != GLOBUS_SUCCESS)
631         {
632 0             result = GlobusSoapMessageErrorSerializeFailed(
633                 result, NULL, &sgtest_TestStepType_choice_qname);
634             goto exit;
635         }
636
637 0         break;
638
639         default:
640 0             break;
641     }
642
643  exit:
644
645 0     GlobusSoapMessageDebugExit();
646 0     return result;
647 }
648
649
650
651 globus_result_t
652 sgtest_TestStepType_choice_serialize(
653     const xsd_QName *                   element_qname,
654     const sgtest_TestStepType_choice *       instance,
655     globus_soap_message_handle_t        message_handle,
656     globus_xsd_element_options_t        options)
657 0 {
658 0     globus_result_t                     result = GLOBUS_SUCCESS;
659 0     GlobusFuncName(sgtest_TestStepType_choice_serialize);
660 0     GlobusSoapMessageDebugEnter();
661
662 0     result = sgtest_TestStepType_choice_serialize_contents(
663         element_qname,
664         instance,
665         message_handle,
666         options);
667 0     if(result != GLOBUS_SUCCESS)
668     {
669 0         result = GlobusSoapMessageErrorSerializeFailed(
670             result, NULL, &sgtest_TestStepType_choice_qname);
671         goto exit;
672     }
673
674  exit:
675 0     GlobusSoapMessageDebugExit();
676 0     return result;
677 }
678
679
680
681
682
683 globus_result_t
684 sgtest_TestStepType_choice_deserialize_contents(
685     const xsd_QName *                   element_qname, /* ignored */
686     sgtest_TestStepType_choice *             instance,
687     globus_soap_message_handle_t        message_handle,
688     globus_xsd_element_options_t        options)
689 0 {
690 0     globus_result_t                     result = GLOBUS_SUCCESS;
691 0     GlobusFuncName(sgtest_TestStepType_choice_deserialize_contents);
692 0     GlobusSoapMessageDebugEnter();
693
694 0     result = sgtest_TestStepType_choice_deserialize(
695         NULL,
696         instance,
697         message_handle,
698         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
699 0     if(result != GLOBUS_SUCCESS)
700     {
701 0         result = GlobusSoapMessageErrorDeserializeFailed(
702             result, element_qname);
703         goto exit;
704     }
705
706  exit:
707
708 0     GlobusSoapMessageDebugExit();
709 0     return result;
710 }
711
712
713
714 globus_result_t
715 sgtest_TestStepType_choice_deserialize(
716     const xsd_QName *                   element_qname,
717     sgtest_TestStepType_choice *             instance,
718     globus_soap_message_handle_t        message_handle,
719     globus_xsd_element_options_t        options)
720 12 {
721 12     globus_result_t                     result = GLOBUS_SUCCESS;
722 12     xsd_QName                           subelement;
723 12     xsd_QName                           deselem_qname = { NULL, NULL } ;
724 12     GlobusFuncName(sgtest_TestStepType_choice_deserialize);
725 12     GlobusSoapMessageDebugEnter();
726
727 12     xsd_QName_init_contents(&deselem_qname);
728
729 12     do
730     {
731 12         result = globus_soap_message_deserialize_element_unknown(
732             message_handle, &deselem_qname);
733 12         if(result != GLOBUS_SUCCESS)
734         {
735 0             result = GlobusSoapMessageErrorDeserializeFailed(
736                 result, &sgtest_TestStepType_choice_qname);
737 0             goto exit;
738         }
739
740 12         if(globus_soap_message_deserialize_element_is_nil(message_handle))
741         {
742 0             xsd_QName_destroy_contents(&deselem_qname);
743 0             result = globus_soap_message_deserialize_element_end(
744                 message_handle,
745                 element_qname);
746 0             if(result != GLOBUS_SUCCESS)
747             {
748 0                 result = GlobusSoapMessageErrorDeserializeFailed(
749                     result, &sgtest_TestStepType_choice_qname);
750 0                 goto exit;
751             }
752         }
753         else
754         {
755 12             break;
756         }
757 12     } while(1);
758
759 12     globus_soap_message_deserialize_push_element(message_handle);
760
761 12     subelement.local = "AddTest";
762 12     subelement.Namespace = "http://www.globus.org/namespaces/2005/09/ServiceGroupTest";
763 12     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
764     {
765 3         instance->type=sgtest_TestStepType_AddTest;
766 3         result = sgtest_AddTestType_deserialize(
767             &subelement,
768             &instance->value.AddTest,
769             message_handle,
770             options);
771 3         if(result != GLOBUS_SUCCESS)
772         {
773 0             result = GlobusSoapMessageErrorDeserializeFailed(
774                 result, &sgtest_TestStepType_choice_qname);
775 0             goto AddTest_destroy;
776         }
777
778 9         goto exit;
779     }
780
781 9     subelement.local = "GetResourcePropertyTest";
782 9     subelement.Namespace = "http://www.globus.org/namespaces/2004/10/ResourcePropertiesTest";
783 9     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
784     {
785 5         instance->type=sgtest_TestStepType_GetResourcePropertyTest;
786 5         result = rptest_GetResourcePropertyTestType_deserialize(
787             &subelement,
788             &instance->value.GetResourcePropertyTest,
789             message_handle,
790             options);
791 5         if(result != GLOBUS_SUCCESS)
792         {
793 0             result = GlobusSoapMessageErrorDeserializeFailed(
794                 result, &sgtest_TestStepType_choice_qname);
795 0             goto GetResourcePropertyTest_destroy;
796         }
797
798 4         goto exit;
799     }
800
801 4     subelement.local = "CreateConsumerTest";
802 4     subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
803 4     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
804     {
805 1         instance->type=sgtest_TestStepType_CreateConsumerTest;
806 1         result = nptest_CreateConsumerTestType_deserialize(
807             &subelement,
808             &instance->value.CreateConsumerTest,
809             message_handle,
810             options);
811 1         if(result != GLOBUS_SUCCESS)
812         {
813 0             result = GlobusSoapMessageErrorDeserializeFailed(
814                 result, &sgtest_TestStepType_choice_qname);
815 0             goto CreateConsumerTest_destroy;
816         }
817
818 3         goto exit;
819     }
820
821 3     subelement.local = "SubscribeTest";
822 3     subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
823 3     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
824     {
825 2         instance->type=sgtest_TestStepType_SubscribeTest;
826 2         result = nptest_SubscribeTestType_deserialize(
827             &subelement,
828             &instance->value.SubscribeTest,
829             message_handle,
830             options);
831 2         if(result != GLOBUS_SUCCESS)
832         {
833 0             result = GlobusSoapMessageErrorDeserializeFailed(
834                 result, &sgtest_TestStepType_choice_qname);
835 0             goto SubscribeTest_destroy;
836         }
837
838 1         goto exit;
839     }
840
841 1     subelement.local = "ExpectNotificationTest";
842 1     subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
843 1     if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname))
844     {
845 1         instance->type=sgtest_TestStepType_ExpectNotificationTest;
846 1         result = nptest_ExpectNotificationTestType_deserialize(
847             &subelement,
848             &instance->value.ExpectNotificationTest,
849             message_handle,
850             options);
851 1         if(result != GLOBUS_SUCCESS)
852         {
853 0             result = GlobusSoapMessageErrorDeserializeFailed(
854                 result, &sgtest_TestStepType_choice_qname);
855 0             goto ExpectNotificationTest_destroy;
856         }
857
858 0         goto exit;
859     }
860
861 0     instance->type = sgtest_TestStepType_undefined;
862 0     result = GlobusSoapMessageErrorDeserializeFailed(
863                 result, &sgtest_TestStepType_choice_qname);
864  
865     goto exit;
866
867  deserialize_failed:
868
869  ExpectNotificationTest_destroy:
870
871  SubscribeTest_destroy:
872
873  CreateConsumerTest_destroy:
874
875  GetResourcePropertyTest_destroy:
876
877  AddTest_destroy:
878
879  exit:
880
881 12     xsd_QName_destroy_contents(&deselem_qname);
882
883 12     if(result == GLOBUS_SUCCESS)
884     {
885 12         do
886         {
887 12             result = globus_soap_message_deserialize_element(
888                 message_handle, NULL);
889 12             if(result != GLOBUS_SUCCESS &&
890                (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
891                 GlobusSoapMessageStatusFailedElementCheck(result) ||
892                 GlobusSoapMessageStatusFailedWithTextCheck(result)))
893             {
894 12                 result = GLOBUS_SUCCESS;
895 12                 break;
896             }
897
898 0             if(globus_soap_message_deserialize_element_is_nil(
899                    message_handle))
900             {
901 0                 result = globus_soap_message_deserialize_element_end(
902                     message_handle,
903                     element_qname);
904 0                 if(result != GLOBUS_SUCCESS)
905                 {
906 0                     result = GlobusSoapMessageErrorDeserializeFailed(
907                         result, &sgtest_TestStepType_choice_qname);
908                     break;
909                 }
910             }
911             else
912             {
913 12                 break;
914             }
915
916 12         } while(1);
917     }
918
919 12     xsd_QName_destroy_contents(&deselem_qname);
920
921 12     GlobusSoapMessageDebugExit();
922 12     return result;
923 }
924
925
926
927 globus_result_t
928 sgtest_TestStepType_choice_deserialize_pointer(
929     const xsd_QName *                   element_qname,
930     sgtest_TestStepType_choice **            ip,
931     globus_soap_message_handle_t        message_handle,
932     globus_xsd_element_options_t        options)
933 0 {
934 0     sgtest_TestStepType_choice * instance = NULL;
935 0     globus_result_t                     result = GLOBUS_SUCCESS;
936 0     xsd_QName                           subelement;
937 0     GlobusFuncName(sgtest_TestStepType_choice_deserialize_pointer);
938 0     GlobusSoapMessageDebugEnter();
939
940 0     *ip = NULL;
941
942 0     result = sgtest_TestStepType_choice_init(&instance);
943 0     if(result != GLOBUS_SUCCESS)
944     {
945 0         result = GlobusSoapMessageErrorDeserializeFailed(
946             result, element_qname);
947 0         goto exit;
948     }
949
950 0     result = sgtest_TestStepType_choice_deserialize(
951         element_qname,
952         instance,
953         message_handle,
954         options);
955 0     if(result != GLOBUS_SUCCESS)
956     {
957 0         goto exit;
958     }
959
960 0     *ip = instance;
961
962  exit:
963
964 0     GlobusSoapMessageDebugExit();
965 0     return result;
966 }
967
968
969
970 globus_result_t
971 sgtest_TestStepType_choice_array_init_contents(
972     sgtest_TestStepType_choice_array * array)
973 0 {
974 0     return globus_xsd_generic_array_init_contents(
975         (globus_xsd_generic_array_t *) array,
976         &sgtest_TestStepType_choice_array_info);
977 }
978 /* sgtest_TestStepType_choice_array_init_contents() */
979
980 globus_result_t
981 sgtest_TestStepType_choice_array_init(
982     sgtest_TestStepType_choice_array ** arr)
983 0 {
984 0     return globus_xsd_generic_array_init(
985         (globus_xsd_generic_array_t **) arr,
986         &sgtest_TestStepType_choice_info);
987 }
988 /* sgtest_TestStepType_choice_array_init() */
989
990 void
991 sgtest_TestStepType_choice_array_destroy_contents(
992     sgtest_TestStepType_choice_array * array)
993 0 {
994 0     globus_xsd_generic_array_destroy_contents(
995         (globus_xsd_generic_array_t *) array);
996 }
997 /* sgtest_TestStepType_choice_array_destroy_contents() */
998
999 void
1000 sgtest_TestStepType_choice_array_destroy(
1001     sgtest_TestStepType_choice_array * array)
1002 0 {
1003 0     globus_xsd_generic_array_destroy(
1004         (globus_xsd_generic_array_t *) array);
1005 }
1006 /* sgtest_TestStepType_choice_array_destroy() */
1007
1008 globus_result_t
1009 sgtest_TestStepType_choice_array_copy(
1010     sgtest_TestStepType_choice_array ** dest_arr,
1011     const sgtest_TestStepType_choice_array * src_arr)
1012 0 {
1013 0     return globus_xsd_generic_array_copy(
1014         (globus_xsd_generic_array_t **) dest_arr,
1015         (const globus_xsd_generic_array_t *) src_arr);
1016 }
1017 /* sgtest_TestStepType_choice_array_copy() */
1018
1019 globus_result_t
1020 sgtest_TestStepType_choice_array_copy_contents(
1021     sgtest_TestStepType_choice_array * dest_arr,
1022     const sgtest_TestStepType_choice_array * src_arr)
1023 0 {
1024 0     return globus_xsd_generic_array_copy_contents(
1025         (globus_xsd_generic_array_t *) dest_arr,
1026         (const globus_xsd_generic_array_t *) src_arr);
1027 }
1028
1029 sgtest_TestStepType_choice *
1030 sgtest_TestStepType_choice_array_push(
1031     sgtest_TestStepType_choice_array * array)
1032 0 {
1033     /* Some contents initializers don't initialize subelments but to set their
1034      * values to be NULL
1035      */
1036 0     if (array->type_info == NULL)
1037     {
1038 0         array->type_info = &sgtest_TestStepType_choice_info;
1039     }
1040 0     return globus_xsd_generic_array_push(
1041         (globus_xsd_generic_array_t *) array);
1042 }
1043 /* sgtest_TestStepType_choice_array_push() */
1044
1045 void *
1046 sgtest_TestStepType_choice_array_push_wrapper(
1047     void * array)
1048 0 {
1049 0     return (void *) sgtest_TestStepType_choice_array_push(
1050         (sgtest_TestStepType_choice_array *) array);
1051 }
1052
1053 globus_result_t
1054 sgtest_TestStepType_choice_array_serialize(
1055     const xsd_QName *                   element_qname,
1056     const sgtest_TestStepType_choice_array * array,
1057     globus_soap_message_handle_t        message,
1058     globus_xsd_element_options_t        options)
1059 0 {
1060 0     return globus_xsd_generic_array_serialize(
1061         element_qname,
1062         (const globus_xsd_generic_array_t *) array,
1063         message,
1064         options);
1065 }
1066 /* sgtest_TestStepType_choice_array_serialize() */
1067
1068 globus_result_t
1069 sgtest_TestStepType_choice_array_deserialize(
1070     const xsd_QName *                   element_qname,
1071     sgtest_TestStepType_choice_array *       array,
1072     globus_soap_message_handle_t        message,
1073     globus_xsd_element_options_t        options)
1074 0 {
1075     /* Some initializers set the array's contents to NULL */
1076 0     if (array->type_info == NULL)
1077     {
1078 0         array->type_info = &sgtest_TestStepType_choice_info;
1079     }
1080 0     return globus_xsd_generic_array_deserialize(
1081         element_qname,
1082         (globus_xsd_generic_array_t *) array,
1083         message,
1084         options);
1085 }