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