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