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 "wst_RequestKETType.h"
21
22 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
23 xsd_QName wst_RequestKETType_qname =
24 {
25     WST_REQUESTKETTYPE_NS,
26     WST_REQUESTKETTYPE_LOCAL
27 };
28 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
29
30 globus_result_t
31 wst_RequestKETType_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 wst_RequestKETType_serialize(
38         element_qname,
39         (wst_RequestKETType *) instance,
40         message_handle, options);
41 }
42
43 globus_result_t
44 wst_RequestKETType_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 wst_RequestKETType_deserialize_pointer(
51         element_qname,
52         (wst_RequestKETType **) ip,
53         message_handle, options);
54 }
55
56 globus_result_t
57 wst_RequestKETType_init_wrapper(void **object)
58 0 {
59 0     return wst_RequestKETType_init(
60         (wst_RequestKETType **) object);
61 }
62
63 void
64 wst_RequestKETType_destroy_wrapper(
65     void *                          object)
66 0 {
67 0     wst_RequestKETType_destroy(
68         (wst_RequestKETType *) object);
69 }
70
71 globus_result_t
72 wst_RequestKETType_copy_wrapper(
73     void **                         dest_obj,
74     void *                          src_obj)
75 0 {
76 0     return wst_RequestKETType_copy(
77         (wst_RequestKETType **) dest_obj,
78         (wst_RequestKETType *) src_obj);
79 }
80
81 globus_result_t
82 wst_RequestKETType_init_contents_wrapper(void *object)
83 0 {
84 0     return wst_RequestKETType_init_contents(
85         (wst_RequestKETType *) object);
86 }
87
88 void
89 wst_RequestKETType_destroy_contents_wrapper(
90     void *                          object)
91 0 {
92 0     wst_RequestKETType_destroy_contents(
93         (wst_RequestKETType *) object);
94 }
95
96 globus_result_t
97 wst_RequestKETType_copy_contents_wrapper(
98     void *                          dest_obj,
99     void *                          src_obj)
100 0 {
101 0     return wst_RequestKETType_copy_contents(
102         (wst_RequestKETType *) dest_obj,
103         (wst_RequestKETType *) src_obj);
104 }
105
106 globus_result_t
107 wst_RequestKETType_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 wst_RequestKETType_serialize_contents(
114         element_qname,
115         (wst_RequestKETType *) instance,
116         message_handle, options);
117 }
118
119 globus_result_t
120 wst_RequestKETType_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(wst_RequestKETType_deserialize_contents_wrapper);
128 0     GlobusSoapMessageDebugEnter();
129
130 0     if(!*instance)
131     {
132 0         result = wst_RequestKETType_init(
133             (wst_RequestKETType **)instance);
134 0         if(result != GLOBUS_SUCCESS)
135         {
136 0             goto error;
137         }
138     }
139
140 0     result = wst_RequestKETType_deserialize_contents(
141         element_qname,
142         *(wst_RequestKETType **)instance,
143         message_handle, options);
144 error:
145 0     GlobusSoapMessageDebugExit();
146 0     return result;
147 }
148
149 globus_result_t
150 wst_RequestKETType_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 wst_RequestKETType_array_serialize(
157         element,
158         (wst_RequestKETType_array *) instance,
159         message, options);
160 }
161
162 globus_result_t
163 wst_RequestKETType_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 = wst_RequestKETType_array_init(
174             (wst_RequestKETType_array **)inst);
175 0         if(result != GLOBUS_SUCCESS)
176         {
177 0             return result;
178         }
179     }
180
181 0     return wst_RequestKETType_array_deserialize(
182         element_qname,
183         *(wst_RequestKETType_array **) inst,
184         message, options);
185 }
186
187 globus_result_t
188 wst_RequestKETType_array_init_wrapper(
189     void **                             arr)
190 0 {
191 0     return wst_RequestKETType_array_init(
192         (wst_RequestKETType_array **) arr);
193 }
194
195 void
196 wst_RequestKETType_array_destroy_wrapper(
197     void *                              arr)
198 0 {
199 0     wst_RequestKETType_array_destroy(
200         (wst_RequestKETType_array *) arr);
201 }
202
203 globus_result_t
204 wst_RequestKETType_array_copy_wrapper(
205     void **                             dest_arr,
206     void *                              src_arr)
207 0 {
208 0     return wst_RequestKETType_array_copy(
209         (wst_RequestKETType_array **) dest_arr,
210         (wst_RequestKETType_array *) src_arr);
211 }
212
213 globus_result_t
214 wst_RequestKETType_array_init_contents_wrapper(
215     void *                              arr)
216 0 {
217 0     return wst_RequestKETType_array_init_contents(
218         (wst_RequestKETType_array *) arr);
219 }
220
221 void
222 wst_RequestKETType_array_destroy_contents_wrapper(
223     void *                              arr)
224 0 {
225 0     wst_RequestKETType_array_destroy_contents(
226         (wst_RequestKETType_array *) arr);
227 }
228
229 globus_result_t
230 wst_RequestKETType_array_copy_contents_wrapper(
231     void *                              dest_arr,
232     void *                              src_arr)
233 0 {
234 0     return wst_RequestKETType_array_copy_contents(
235         (wst_RequestKETType_array *) dest_arr,
236         (wst_RequestKETType_array *) src_arr);
237 }
238
239 struct globus_xsd_type_info_s wst_RequestKETType_contents_info =
240 {
241     &wst_RequestKETType_qname,
242     wst_RequestKETType_serialize_contents_wrapper,
243     wst_RequestKETType_deserialize_contents_wrapper,
244     wst_RequestKETType_init_wrapper,
245     wst_RequestKETType_destroy_wrapper,
246     wst_RequestKETType_copy_wrapper,
247     wst_RequestKETType_init_contents_wrapper,
248     wst_RequestKETType_destroy_contents_wrapper,
249     wst_RequestKETType_copy_contents_wrapper,
250     sizeof(wst_RequestKETType),
251     NULL,
252     NULL,
253     NULL
254 };
255
256 struct globus_xsd_type_info_s wst_RequestKETType_array_info =
257 {
258     &wst_RequestKETType_qname,
259     wst_RequestKETType_array_serialize_wrapper,
260     wst_RequestKETType_array_deserialize_wrapper,
261     wst_RequestKETType_array_init_wrapper,
262     wst_RequestKETType_array_destroy_wrapper,
263     wst_RequestKETType_array_copy_wrapper,
264     wst_RequestKETType_array_init_contents_wrapper,
265     wst_RequestKETType_array_destroy_contents_wrapper,
266     wst_RequestKETType_array_copy_contents_wrapper,
267     sizeof(wst_RequestKETType),
268     wst_RequestKETType_array_push_wrapper,
269     NULL,
270     NULL
271 };
272
273 struct globus_xsd_type_info_s wst_RequestKETType_info =
274 {
275     &wst_RequestKETType_qname,
276     wst_RequestKETType_serialize_wrapper,
277     wst_RequestKETType_deserialize_pointer_wrapper,
278     wst_RequestKETType_init_wrapper,
279     wst_RequestKETType_destroy_wrapper,
280     wst_RequestKETType_copy_wrapper,
281     wst_RequestKETType_init_contents_wrapper,
282     wst_RequestKETType_destroy_contents_wrapper,
283     wst_RequestKETType_copy_contents_wrapper,
284     sizeof(wst_RequestKETType),
285     NULL,
286     &wst_RequestKETType_contents_info,
287     &wst_RequestKETType_array_info
288 };
289
290 globus_result_t
291 wst_RequestKETType_init_contents(
292     wst_RequestKETType * instance)
293 0 {
294 0     globus_result_t                     result = GLOBUS_SUCCESS;
295 0     GlobusFuncName(wst_RequestKETType_init_contents);
296 0     GlobusSoapMessageDebugEnter();
297
298 0     memset(instance, 0, sizeof(wst_RequestKETType));
299
300 0     GlobusSoapMessageDebugExit();
301 0     return result;
302 }
303
304 globus_result_t
305 wst_RequestKETType_init(
306     wst_RequestKETType ** object)
307 0 {
308 0     wst_RequestKETType * instance;
309 0     globus_result_t                     result = GLOBUS_SUCCESS;
310 0     GlobusFuncName(wst_RequestKETType_init);
311 0     GlobusSoapMessageDebugEnter();
312
313 0     instance = globus_malloc(sizeof(wst_RequestKETType));
314 0     if(!instance)
315     {
316 0         result = GlobusSoapMessageErrorOutOfMemory;
317 0         goto exit;
318     }
319
320 0     memset(instance, 0, sizeof(wst_RequestKETType));
321
322 0     *object = instance;
323
324  exit:
325 0     GlobusSoapMessageDebugExit();
326 0     return result;
327 }
328
329 void
330 wst_RequestKETType_destroy(
331     wst_RequestKETType * instance)
332 0 {
333 0     GlobusFuncName(wst_RequestKETType_destroy);
334 0     GlobusSoapMessageDebugEnter();
335
336 0     if(!instance)
337     {
338 0         goto exit;
339     }
340
341 0     wst_RequestKETType_destroy_contents(instance);
342 0     globus_free(instance);
343
344  exit:
345
346 0     GlobusSoapMessageDebugExit();
347 }
348
349 void
350 wst_RequestKETType_destroy_contents(
351     wst_RequestKETType * instance)
352 0 {
353 0     GlobusFuncName(wst_RequestKETType_destroy_contents);
354 0     GlobusSoapMessageDebugEnter();
355
356 0     if(instance)
357     {
358
359
360     }
361
362 0     GlobusSoapMessageDebugExit();
363 }
364
365 globus_result_t
366 wst_RequestKETType_copy(
367     wst_RequestKETType ** dest_obj,
368     const wst_RequestKETType * src_obj)
369 0 {
370 0     globus_result_t                     result = GLOBUS_SUCCESS;
371 0     wst_RequestKETType * instance;
372 0     GlobusFuncName(wst_RequestKETType_copy);
373
374 0     GlobusSoapMessageDebugEnter();
375
376 0     instance = malloc(sizeof(wst_RequestKETType));
377 0     if (instance == NULL)
378     {
379 0         GlobusSoapMessageDebugExit();
380 0         return GlobusSoapMessageErrorOutOfMemory;
381     }
382
383 0     result = wst_RequestKETType_copy_contents(instance, src_obj);
384 0     if(result != GLOBUS_SUCCESS)
385     {
386 0         globus_free(instance);
387 0         GlobusSoapMessageDebugExit();
388 0         return GlobusSoapMessageErrorOutOfMemory;
389     }
390
391 0     *dest_obj = instance;
392 0     GlobusSoapMessageDebugExit();
393 0     return result;
394 }
395
396 globus_result_t
397 wst_RequestKETType_copy_contents(
398     wst_RequestKETType * instance,
399     const wst_RequestKETType * src_obj)
400 0 {
401 0     globus_result_t                     result = GLOBUS_SUCCESS;
402 0     GlobusFuncName(wst_RequestKETType_copy_contents);
403
404 0     GlobusSoapMessageDebugEnter();
405
406
407 0     goto exit;
408
409  fail_deserialize:
410
411
412  exit:
413
414 0     GlobusSoapMessageDebugExit();
415 0     return result;
416 }
417
418
419
420 globus_result_t
421 wst_RequestKETType_serialize_contents(
422     xsd_QName *                         element_qname, /* ignored */
423     wst_RequestKETType * inst,
424     globus_soap_message_handle_t        message_handle,
425     globus_xsd_element_options_t        options)
426 0 {
427 0     globus_result_t                     result = GLOBUS_SUCCESS;
428 0     GlobusFuncName(wst_RequestKETType_serialize_contents);
429 0     GlobusSoapMessageDebugEnter();
430
431 0     result = wst_RequestKETType_serialize(
432         NULL,
433         inst,
434         message_handle,
435         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
436 0     if(result != GLOBUS_SUCCESS)
437     {
438 0         result = GlobusSoapMessageErrorSerializeFailed(
439             result, NULL, element_qname);
440         goto exit;
441     }
442
443  exit:
444
445 0     GlobusSoapMessageDebugExit();
446 0     return result;
447 }
448
449
450
451 globus_result_t
452 wst_RequestKETType_serialize(
453     xsd_QName *                         element_qname,
454     wst_RequestKETType * instance,
455     globus_soap_message_handle_t        message_handle,
456     globus_xsd_element_options_t        options)
457 0 {
458 0     globus_result_t                     result = GLOBUS_SUCCESS;
459 0     xsd_QName                           subelement;
460 0     globus_list_t *                     any_attr_keys = NULL;
461 0     globus_list_t *                     any_attr_keys_iterator = NULL;
462 0     xsd_QName *                         type_attr = NULL;
463 0     char *                              prefix = NULL;
464 0     int                                 prefix_created;
465 0     int                                 define_prefix = 0;
466 0     int                                 save_options = options;
467
468 0     GlobusFuncName(wst_RequestKETType_serialize);
469 0     GlobusSoapMessageDebugEnter();
470
471
472 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
473     {
474         /* serialize wst_RequestKETType element */
475
476 0         result = globus_soap_message_invoke_ns_callouts(
477             message_handle,
478             element_qname,
479             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_SET,
480             &options);
481 0         if(result != GLOBUS_SUCCESS)
482         {
483 0             result = GlobusSoapMessageErrorSerializeFailed(
484                 result, NULL, element_qname);
485 0             goto exit;
486         }
487
488 0 result = globus_soap_message_element_ns_set(
489             message_handle,
490             element_qname->Namespace,
491             &options);
492 0         if(result != GLOBUS_SUCCESS)
493         {
494 0             result = GlobusSoapMessageErrorSerializeFailed(
495                 result, NULL, element_qname);
496 0             goto exit;
497         }
498
499 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
500    !globus_soap_message_serialize_is_c14n_subset(message_handle))
501         {
502 0             result = globus_soap_message_attribute_ns_set(
503                 message_handle,
504                 "http://www.w3.org/2001/XMLSchema-instance",
505                 &options);
506 0             if(result != GLOBUS_SUCCESS)
507             {
508 0                 result = GlobusSoapMessageErrorSerializeFailed(
509                     result, NULL, element_qname);
510 0                 goto exit;
511             }
512
513 0             result = globus_soap_message_attribute_ns_set(
514                 message_handle,
515                 wst_RequestKETType_qname.Namespace,
516                 &options);
517 0             if(result != GLOBUS_SUCCESS)
518             {
519 0                 result = GlobusSoapMessageErrorSerializeFailed(
520                     result, NULL, element_qname);
521 0                 goto exit;
522             }
523         }
524
525 0         result = globus_soap_message_invoke_callouts(
526             message_handle,
527             element_qname,
528             GLOBUS_SOAP_MESSAGE_CALLOUT_BEGIN);
529 0         if(result != GLOBUS_SUCCESS)
530         {
531 0             result = GlobusSoapMessageErrorSerializeFailed(
532                 result, NULL, element_qname);
533 0             goto exit;
534         }
535
536 0         result = globus_soap_message_serialize_element(
537             message_handle,
538             element_qname,
539             options,
540             &wst_RequestKETType_qname);
541 0         if(result != GLOBUS_SUCCESS)
542         {
543 0             result = GlobusSoapMessageErrorSerializeFailed(
544                 result, NULL, element_qname);
545 0             goto exit;
546         }
547
548 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
549    !globus_soap_message_serialize_is_c14n_subset(message_handle))
550         {
551 0            xsd_QName_init(&type_attr);
552        
553 0            type_attr->local = globus_libc_strdup("type");
554 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
555         }
556
557         /* serialize namespaces */
558         
559 0 result = globus_soap_message_invoke_ns_callouts(
560             message_handle,
561             element_qname,
562             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_ADD,
563             &options);
564 0         if(result != GLOBUS_SUCCESS)
565         {
566 0             result = GlobusSoapMessageErrorSerializeFailed(
567                 result, NULL, element_qname);
568 0             goto exit;
569         }
570
571 0 result = globus_soap_message_element_ns_add(
572             message_handle,
573             element_qname->Namespace,
574             &options);
575 0         if(result != GLOBUS_SUCCESS)
576         {
577 0             result = GlobusSoapMessageErrorSerializeFailed(
578                 result, NULL, element_qname);
579 0             goto exit;
580         }
581
582 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
583    !globus_soap_message_serialize_is_c14n_subset(message_handle))
584         {
585 0             result = globus_soap_message_attribute_ns_add(
586                 message_handle,
587                 "http://www.w3.org/2001/XMLSchema-instance",
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 0             result = globus_soap_message_attribute_ns_add(
597                 message_handle,
598                 wst_RequestKETType_qname.Namespace,
599                 &options);
600 0             if(result != GLOBUS_SUCCESS)
601             {
602 0                 result = GlobusSoapMessageErrorSerializeFailed(
603                     result, NULL, element_qname);
604 0                 goto exit;
605             }
606         }
607
608         /* serialize attributes */
609
610 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
611    !globus_soap_message_serialize_is_c14n_subset(message_handle))
612         {
613 0             result = globus_soap_message_serialize_QName_attribute(
614                 message_handle,
615                 type_attr,
616                 &wst_RequestKETType_qname);
617 0             if(result != GLOBUS_SUCCESS)
618             {
619 0                 result = GlobusSoapMessageErrorSerializeFailed(
620                     result, NULL, element_qname);
621 0                 goto exit;
622             }
623         }
624
625
626 0         result = globus_soap_message_invoke_callouts(
627             message_handle,
628             element_qname,
629             GLOBUS_SOAP_MESSAGE_CALLOUT_ATTR);
630 0         if(result != GLOBUS_SUCCESS)
631         {
632 0             result = GlobusSoapMessageErrorSerializeFailed(
633                 result, NULL, element_qname);
634 0             goto exit;
635         }
636     }
637
638 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
639     {
640 0         result = globus_soap_message_serialize_element_begin_close(
641             message_handle);
642 0         if(result != GLOBUS_SUCCESS)
643         {
644 0             result = GlobusSoapMessageErrorSerializeFailed(
645                 result, NULL, element_qname);
646 0             goto exit;
647         }
648     }
649 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
650
651     /* serialize contents of type */
652
653 0     options = save_options;
654
655 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
656     {
657         /* add end element */
658 0         result = globus_soap_message_serialize_element_end(
659             message_handle,
660             element_qname,
661             options,
662             &wst_RequestKETType_qname);
663 0         if(result != GLOBUS_SUCCESS)
664         {
665 0             result = GlobusSoapMessageErrorSerializeFailed(
666                 result, NULL, element_qname);
667 0             goto exit;
668         }
669
670 0         globus_soap_message_element_ns_remove(
671             message_handle,
672             element_qname->Namespace,
673             &options);
674
675     /* remove namespace/prefix mappings for these types */
676
677 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
678    !globus_soap_message_serialize_is_c14n_subset(message_handle))
679         {
680 0             globus_soap_message_attribute_ns_remove(
681                 message_handle,
682                 "http://www.w3.org/2001/XMLSchema-instance",
683                 &options);
684            
685 0             globus_soap_message_attribute_ns_remove(
686                 message_handle,
687                 wst_RequestKETType_qname.Namespace,
688                 &options);
689         }           
690
691 0         result = globus_soap_message_invoke_ns_callouts(
692             message_handle,
693             element_qname,
694             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_REMOVE,
695             &options);
696 0         if(result != GLOBUS_SUCCESS)
697         {
698 0             result  = GlobusSoapMessageErrorSerializeFailed(
699                 result, NULL, element_qname);
700 0             goto exit;
701         }
702
703 0         result = globus_soap_message_invoke_callouts(
704             message_handle,
705             element_qname,
706             GLOBUS_SOAP_MESSAGE_CALLOUT_END);
707 0         if(result != GLOBUS_SUCCESS)
708         {
709 0             result = GlobusSoapMessageErrorSerializeFailed(
710                 result, NULL, element_qname);
711             goto exit;
712         }
713     }
714
715  exit:
716 0     if (type_attr)
717     {
718 0         xsd_QName_destroy(type_attr);
719     }
720
721 0     if(any_attr_keys)
722     {
723 0         globus_list_free(any_attr_keys);
724     }
725
726 0     GlobusSoapMessageDebugExit();
727 0     return result;
728 }
729
730
731
732 globus_result_t
733 wst_RequestKETType_deserialize_contents(
734     xsd_QName *                         element_qname, /* ignored */
735     wst_RequestKETType * inst,
736     globus_soap_message_handle_t        message_handle,
737     globus_xsd_element_options_t        options)
738 0 {
739 0     globus_result_t                     result = GLOBUS_SUCCESS;
740 0     GlobusFuncName(wst_RequestKETType_deserialize_contents);
741 0     GlobusSoapMessageDebugEnter();
742
743 0     result = wst_RequestKETType_deserialize(
744         NULL,
745         inst,
746         message_handle,
747         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
748 0     if(result != GLOBUS_SUCCESS)
749     {
750 0         result = GlobusSoapMessageErrorDeserializeFailed(
751             result, element_qname);
752         goto exit;
753     }
754
755  exit:
756
757 0     GlobusSoapMessageDebugExit();
758 0     return result;
759 }
760
761
762
763 globus_result_t
764 wst_RequestKETType_deserialize(
765     xsd_QName *                         element_qname,
766     wst_RequestKETType * instance,
767     globus_soap_message_handle_t        message_handle,
768     globus_xsd_element_options_t        options)
769 0 {
770 0     globus_result_t                     result = GLOBUS_SUCCESS;
771 0     xsd_QName                           subelement;
772 0     GlobusFuncName(wst_RequestKETType_deserialize);
773 0     GlobusSoapMessageDebugEnter();
774
775
776 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
777     {
778 0         result = globus_soap_message_deserialize_element(
779             message_handle, element_qname);
780 0         if(result != GLOBUS_SUCCESS)
781         {
782 0             result = GlobusSoapMessageErrorDeserializeFailed(
783                 result, element_qname);
784 0             goto exit;
785         }
786
787
788 0         result = globus_soap_message_deserialize_element_begin_close(
789             message_handle);
790 0         if(result != GLOBUS_SUCCESS)
791         {
792 0             result = GlobusSoapMessageErrorDeserializeFailed(
793                 result, element_qname);
794 0             goto fail_deserialize;
795         }
796     }
797
798 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
799     {
800 0         result = globus_soap_message_deserialize_element_end(
801             message_handle,
802             element_qname);
803 0         if(result != GLOBUS_SUCCESS)
804         {
805 0             result = GlobusSoapMessageErrorDeserializeFailed(
806                 result, element_qname);
807             goto fail_deserialize;
808         }
809     }
810
811 0     goto exit;
812
813  fail_deserialize:
814
815
816  exit:
817
818 0     GlobusSoapMessageDebugExit();
819 0     return result;
820 }
821
822
823
824 globus_result_t
825 wst_RequestKETType_deserialize_pointer(
826     xsd_QName *                         element_qname,
827     wst_RequestKETType ** ip,
828     globus_soap_message_handle_t        message_handle,
829     globus_xsd_element_options_t        options)
830 0 {
831 0     wst_RequestKETType * instance = NULL;
832 0     globus_result_t                     result = GLOBUS_SUCCESS;
833 0     xsd_QName                           subelement;
834 0     int                                 found_attrs = 0;
835 0     int                                 empty_element = 0;
836 0     GlobusFuncName(wst_RequestKETType_deserialize_pointer);
837 0     GlobusSoapMessageDebugEnter();
838
839 0     *ip = NULL;
840
841 0     result = globus_soap_message_deserialize_element(
842         message_handle, element_qname);
843 0     if(result != GLOBUS_SUCCESS &&
844        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
845         GlobusSoapMessageStatusFailedElementCheck(result) ||
846         GlobusSoapMessageStatusFailedWithTextCheck(result)))
847     {
848 0         *ip = NULL;
849 0         result = GLOBUS_SUCCESS;
850 0         goto exit;
851     }
852
853 0     if(result != GLOBUS_SUCCESS)
854     {
855 0         result = GlobusSoapMessageErrorDeserializeFailed(
856             result, element_qname);
857 0         goto exit;
858     }
859
860 0     if(globus_soap_message_deserialize_element_is_empty(
861            message_handle))
862     {
863 0         empty_element = 1;
864     }
865
866
867
868 0     result = wst_RequestKETType_init(&instance);
869 0     if(result != GLOBUS_SUCCESS)
870     {
871 0         result = GlobusSoapMessageErrorDeserializeFailed(
872             result, element_qname);
873 0         goto exit;
874     }
875
876
877 0     if(found_attrs == 0 && 
878        globus_soap_message_deserialize_element_is_nil(message_handle))
879     {
880 0         wst_RequestKETType_destroy(instance);
881         
882 0         result = globus_soap_message_deserialize_element_end(
883                 message_handle,
884                 element_qname);
885 0         if(result != GLOBUS_SUCCESS)
886         {
887 0             result = GlobusSoapMessageErrorDeserializeFailed(
888                 result, element_qname);
889 0             goto exit;
890         }
891
892 0         *ip = NULL;
893 0         globus_object_free(globus_error_get(result));
894 0         result = GLOBUS_SUCCESS;
895 0         goto exit;
896     }
897
898
899 0     if(empty_element)
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, element_qname);
908 0             goto fail_deserialize;
909         }
910
911 0         *ip = instance;
912 0         goto exit;
913     }
914
915 0     result = globus_soap_message_deserialize_element_begin_close(
916         message_handle);
917 0     if(result != GLOBUS_SUCCESS)
918     {
919 0         result = GlobusSoapMessageErrorDeserializeFailed(
920             result, element_qname);
921 0         goto exit;
922     }
923
924
925
926 0     result = globus_soap_message_deserialize_element_end(
927         message_handle,
928         element_qname);
929 0     if(result != GLOBUS_SUCCESS)
930     {
931 0         result = GlobusSoapMessageErrorDeserializeFailed(
932             result, element_qname);
933 0         goto fail_deserialize;
934     }
935
936 0     *ip = instance;
937
938     goto exit;
939
940  fail_deserialize:
941
942  exit:
943
944 0     GlobusSoapMessageDebugExit();
945 0     return result;
946 }
947
948
949 globus_result_t
950 wst_RequestKETType_array_init_contents(
951     wst_RequestKETType_array * array)
952 0 {
953 0     GlobusFuncName(wst_RequestKETType_array_init_contents);
954 0     GlobusSoapMessageDebugEnter();
955
956 0     memset(array, 0, sizeof(wst_RequestKETType_array));
957
958 0     GlobusSoapMessageDebugExit();
959 0     return GLOBUS_SUCCESS;
960 }
961
962 globus_result_t
963 wst_RequestKETType_array_init(
964     wst_RequestKETType_array ** arr)
965 0 {
966 0     wst_RequestKETType_array * array;
967 0     globus_result_t                     result;
968 0     GlobusFuncName(wst_RequestKETType_array_init);
969 0     GlobusSoapMessageDebugEnter();
970
971 0     array = (wst_RequestKETType_array *)
972         globus_malloc(sizeof(wst_RequestKETType_array));
973 0     if(!array)
974     {
975 0         result = GlobusSoapMessageErrorOutOfMemory;
976 0         goto exit;
977     }
978
979 0     result = wst_RequestKETType_array_init_contents(array);
980 0     if(result != GLOBUS_SUCCESS)
981     {
982 0         globus_free(array);
983 0         array = NULL;
984
985     }
986
987 0     *arr = array;
988
989  exit:
990 0     GlobusSoapMessageDebugExit();
991 0     return result;
992 }
993
994 void
995 wst_RequestKETType_array_destroy_contents(
996     wst_RequestKETType_array * array)
997 0 {
998 0     int                                 i = 0;
999 0     GlobusFuncName(wst_RequestKETType_array_destroy_contents);
1000 0     GlobusSoapMessageDebugEnter();
1001
1002 0     for(; i < array->length; ++i)
1003     {
1004 0         wst_RequestKETType_destroy_contents(&array->elements[i]);
1005     }
1006
1007 0     if(array->elements)
1008     {
1009 0         globus_free(array->elements);
1010 0         array->elements = NULL;
1011     }
1012 0     array->length = 0;
1013
1014 0     GlobusSoapMessageDebugExit();
1015 }
1016
1017 void
1018 wst_RequestKETType_array_destroy(
1019     wst_RequestKETType_array * array)
1020 0 {
1021 0     GlobusFuncName(wst_RequestKETType_array_destroy);
1022 0     GlobusSoapMessageDebugEnter();
1023
1024 0     wst_RequestKETType_array_destroy_contents(array);
1025 0     globus_free(array);
1026
1027 0     GlobusSoapMessageDebugExit();
1028 }
1029
1030 globus_result_t
1031 wst_RequestKETType_array_copy(
1032     wst_RequestKETType_array ** dest_arr,
1033     const wst_RequestKETType_array * src_arr)
1034 0 {
1035 0     wst_RequestKETType_array * array;
1036 0     globus_result_t                     result;
1037 0     GlobusFuncName(wst_RequestKETType_array_copy);
1038 0     GlobusSoapMessageDebugEnter();
1039
1040 0     array = (wst_RequestKETType_array *) globus_malloc(
1041         sizeof(wst_RequestKETType_array));
1042 0     if(!array)
1043     {
1044 0         result = GlobusSoapMessageErrorOutOfMemory;
1045 0         GlobusSoapMessageDebugExit();
1046 0         return result;
1047     }
1048
1049 0     result = wst_RequestKETType_array_copy_contents(array, src_arr);
1050 0     if(result != GLOBUS_SUCCESS)
1051     {
1052 0         globus_free(array);
1053 0         GlobusSoapMessageDebugExit();
1054 0         return result;
1055     }
1056
1057 0     *dest_arr = array;
1058
1059 0     GlobusSoapMessageDebugExit();
1060 0     return GLOBUS_SUCCESS;
1061 }
1062
1063 globus_result_t
1064 wst_RequestKETType_array_copy_contents(
1065     wst_RequestKETType_array * dest_arr,
1066     const wst_RequestKETType_array * src_arr)
1067 0 {
1068 0     int                                 i;
1069 0     globus_result_t                     result = GLOBUS_SUCCESS;
1070 0     GlobusFuncName(wst_RequestKETType_array_copy_contents);
1071 0     GlobusSoapMessageDebugEnter();
1072
1073 0     dest_arr->length = src_arr->length;
1074 0     if(dest_arr->length > 0)
1075     {
1076 0         dest_arr->elements = (wst_RequestKETType *) malloc(
1077             sizeof(wst_RequestKETType) * dest_arr->length);
1078 0         if(!dest_arr->elements)
1079         {
1080 0             result = GlobusSoapMessageErrorOutOfMemory;
1081 0             GlobusSoapMessageDebugExit();
1082 0             return result;
1083         }
1084     }
1085     else
1086     {
1087 0         dest_arr->elements = NULL;
1088     }
1089     
1090 0     for(i = 0; i < dest_arr->length; i++)
1091     {
1092 0         result = wst_RequestKETType_copy_contents(
1093             &dest_arr->elements[i], &src_arr->elements[i]);
1094 0         if(result != GLOBUS_SUCCESS)
1095         {
1096 0             while(i--)
1097             {
1098 0                 wst_RequestKETType_destroy_contents(&dest_arr->elements[i]);
1099             }
1100
1101 0             globus_free(dest_arr->elements);
1102 0             dest_arr->elements = NULL;
1103 0             dest_arr->length = 0;
1104 0             break;
1105         }
1106     }
1107
1108 0     GlobusSoapMessageDebugExit();
1109 0     return result;
1110 }
1111
1112 wst_RequestKETType *
1113 wst_RequestKETType_array_push(
1114     wst_RequestKETType_array * array)
1115 0 {
1116 0     GlobusFuncName(wst_RequestKETType_array_push);
1117 0     GlobusSoapMessageDebugEnter();
1118
1119 0     array->elements = realloc(array->elements,
1120                               sizeof(wst_RequestKETType) *
1121                               (array->length + 1));
1122 0     memset(&array->elements[array->length], 0, sizeof(wst_RequestKETType));
1123 0     array->length++;
1124
1125 0     GlobusSoapMessageDebugExit();
1126 0     return (&array->elements[array->length - 1]);
1127 }
1128
1129 void *
1130 wst_RequestKETType_array_push_wrapper(
1131     void * array)
1132 0 {
1133 0     return (void *) wst_RequestKETType_array_push((wst_RequestKETType_array *) array);
1134 }
1135
1136 globus_result_t
1137 wst_RequestKETType_array_serialize(
1138     xsd_QName *                         element_qname,
1139     wst_RequestKETType_array * array,
1140     globus_soap_message_handle_t        message,
1141     globus_xsd_element_options_t        options)
1142 0 {
1143 0     globus_result_t                     result = GLOBUS_SUCCESS;
1144 0     int                                 i = 0;
1145 0     GlobusFuncName(wst_RequestKETType_array_serialize);
1146 0     GlobusSoapMessageDebugEnter();
1147
1148 0     for(; i < array->length; ++i)
1149     {
1150 0         result = wst_RequestKETType_serialize(
1151             element_qname,
1152             &array->elements[i],
1153             message,
1154             options);
1155 0         if(result != GLOBUS_SUCCESS)
1156         {
1157 0             goto exit;
1158         }
1159     }
1160
1161 exit:
1162
1163 0     GlobusSoapMessageDebugExit();
1164 0     return result;
1165 }
1166
1167 globus_result_t
1168 wst_RequestKETType_array_deserialize(
1169     xsd_QName *                         element_qname,
1170     wst_RequestKETType_array * array,
1171     globus_soap_message_handle_t        message,
1172     globus_xsd_element_options_t        options)
1173 0 {
1174 0     globus_result_t                     result = GLOBUS_SUCCESS;
1175 0     int                                 i = 0;
1176 0     int                                 pre_length;
1177 0     GlobusFuncName(wst_RequestKETType_array_deserialize);
1178 0     GlobusSoapMessageDebugEnter();
1179
1180 0     pre_length = array->length;
1181
1182 0     for(i = 0; i < pre_length; ++i)
1183     {
1184 0         result = wst_RequestKETType_deserialize(
1185             element_qname,
1186             &array->elements[i],
1187             message,
1188             options);
1189 0         if(result != GLOBUS_SUCCESS)
1190         {
1191 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1192                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1193                GlobusSoapMessageStatusFailedWithTextCheck(result))
1194             {
1195 0                 result = GLOBUS_SUCCESS;
1196 0                 break;
1197             }
1198
1199 0             result = GlobusSoapMessageErrorDeserializeFailed(
1200                 result, element_qname);
1201 0             goto exit;
1202         }
1203     }
1204
1205 0     while(result == GLOBUS_SUCCESS)
1206     {
1207 0         wst_RequestKETType                  next;
1208 0         memset(&next, 0, sizeof(wst_RequestKETType));
1209
1210 0         result = wst_RequestKETType_deserialize(
1211             element_qname,
1212             &next,
1213             message,
1214             options);
1215 0         if(result != GLOBUS_SUCCESS)
1216         {
1217 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1218                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1219                GlobusSoapMessageStatusFailedWithTextCheck(result))
1220             {
1221 0                 result = GLOBUS_SUCCESS;
1222 0                 break;
1223             }
1224
1225 0             result = GlobusSoapMessageErrorDeserializeFailed(
1226                 result, element_qname);
1227 0             goto exit;
1228         }
1229
1230 0         array->elements = realloc(
1231             array->elements,
1232             (array->length + 1) * sizeof(wst_RequestKETType));
1233 0         if(!array->elements)
1234         {
1235 0             result = GlobusSoapMessageErrorOutOfMemory;
1236 0             goto exit;
1237         }
1238 0         array->elements[array->length] = next;
1239 0         array->length++;
1240 0         ++i;
1241     }
1242
1243   exit:
1244
1245 0     if(result != GLOBUS_SUCCESS)
1246     {
1247 0         int                             di = 0;
1248 0         for(; di < i; ++di)
1249         {
1250 0             wst_RequestKETType_destroy_contents(
1251                 &array->elements[di]);
1252 0             memset(&array->elements[di], 0, sizeof(wst_RequestKETType));
1253         }
1254     }
1255
1256 0     GlobusSoapMessageDebugExit();
1257 0     return result;