1 /*
2  * Copyright 1999-2006 University of Chicago
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  * http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 /*
19  * This file is automatically generated by the Globus WSDLtoC converter
20  */
21
22 #include "xsd_QName.h"
23 #include "globus_soap_message.h"
24 #include "globus_xsd_type_info.h"
25 #include "wsu_ContextType.h"
26
27 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
28 xsd_QName wsu_ContextType_qname =
29 {
30     WSU_CONTEXTTYPE_NS,
31     WSU_CONTEXTTYPE_LOCAL
32 };
33 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
34
35 globus_result_t
36 wsu_ContextType_serialize_wrapper(
37     const xsd_QName *                   element_qname,
38     const void *                        instance,
39     globus_soap_message_handle_t        message_handle,
40     globus_xsd_element_options_t        options)
41 0 {
42 0     return wsu_ContextType_serialize(
43         element_qname,
44         (const wsu_ContextType *) instance,
45         message_handle, options);
46 }
47
48 globus_result_t
49 wsu_ContextType_deserialize_pointer_wrapper(
50     const xsd_QName *                   element_qname,
51     void **                             ip,
52     globus_soap_message_handle_t        message_handle,
53     globus_xsd_element_options_t        options)
54 0 {
55 0     return wsu_ContextType_deserialize_pointer(
56         element_qname,
57         (wsu_ContextType **) ip,
58         message_handle, options);
59 }
60
61 globus_result_t
62 wsu_ContextType_init_wrapper(void **object)
63 0 {
64 0     return wsu_ContextType_init(
65         (wsu_ContextType **) object);
66 }
67
68 void
69 wsu_ContextType_destroy_wrapper(
70     void *                          object)
71 0 {
72 0     wsu_ContextType_destroy(
73         (wsu_ContextType *) object);
74 }
75
76 globus_result_t
77 wsu_ContextType_copy_wrapper(
78     void **                         dest_obj,
79     const void *                    src_obj)
80 0 {
81 0     return wsu_ContextType_copy(
82         (wsu_ContextType **) dest_obj,
83         (wsu_ContextType *) src_obj);
84 }
85
86 globus_result_t
87 wsu_ContextType_init_contents_wrapper(void *object)
88 0 {
89 0     return wsu_ContextType_init_contents(
90         (wsu_ContextType *) object);
91 }
92
93 void
94 wsu_ContextType_destroy_contents_wrapper(
95     void *                          object)
96 0 {
97 0     wsu_ContextType_destroy_contents(
98         (wsu_ContextType *) object);
99 }
100
101 globus_result_t
102 wsu_ContextType_copy_contents_wrapper(
103     void *                          dest_obj,
104     const void *                    src_obj)
105 0 {
106 0     return wsu_ContextType_copy_contents(
107         (wsu_ContextType *) dest_obj,
108         (const wsu_ContextType *) src_obj);
109 }
110
111 globus_result_t
112 wsu_ContextType_serialize_contents_wrapper(
113     const xsd_QName *                   element_qname,
114     const void *                        instance,
115     globus_soap_message_handle_t        message_handle,
116     globus_xsd_element_options_t        options)
117 0 {
118 0     return wsu_ContextType_serialize_contents(
119         element_qname,
120         (wsu_ContextType *) instance,
121         message_handle, options);
122 }
123
124 globus_result_t
125 wsu_ContextType_deserialize_contents_wrapper(
126     const xsd_QName *                   element_qname,
127     void **                             instance,
128     globus_soap_message_handle_t        message_handle,
129     globus_xsd_element_options_t        options)
130 0 {
131 0     globus_result_t                     result;
132 0     GlobusFuncName(wsu_ContextType_deserialize_contents_wrapper);
133 0     GlobusSoapMessageDebugEnter();
134
135 0     if(!*instance)
136     {
137 0         result = wsu_ContextType_init(
138             (wsu_ContextType **)instance);
139 0         if(result != GLOBUS_SUCCESS)
140         {
141 0             goto error;
142         }
143     }
144
145 0     result = wsu_ContextType_deserialize_contents(
146         element_qname,
147         *(wsu_ContextType **)instance,
148         message_handle, options);
149 error:
150 0     GlobusSoapMessageDebugExit();
151 0     return result;
152 }
153
154 globus_result_t
155 wsu_ContextType_array_serialize_wrapper(
156     const xsd_QName *               element,
157     const void *                    instance,
158     globus_soap_message_handle_t    message,
159     globus_xsd_element_options_t    options)
160 0 {
161 0     return wsu_ContextType_array_serialize(
162         element,
163         (wsu_ContextType_array *) instance,
164         message, options);
165 }
166
167 globus_result_t
168 wsu_ContextType_array_deserialize_wrapper(
169     const xsd_QName *                   element_qname,
170     void **                             inst,
171     globus_soap_message_handle_t        message,
172     globus_xsd_element_options_t        options)
173 0 {
174 0     if(!*inst)
175     {
176 0         globus_result_t                 result;
177
178 0         result = wsu_ContextType_array_init(
179             (wsu_ContextType_array **)inst);
180 0         if(result != GLOBUS_SUCCESS)
181         {
182 0             return result;
183         }
184     }
185
186 0     return wsu_ContextType_array_deserialize(
187         element_qname,
188         *(wsu_ContextType_array **) inst,
189         message, options);
190 }
191
192 globus_result_t
193 wsu_ContextType_array_init_wrapper(
194     void **                             arr)
195 0 {
196 0     return wsu_ContextType_array_init(
197         (wsu_ContextType_array **) arr);
198 }
199
200 void
201 wsu_ContextType_array_destroy_wrapper(
202     void *                              arr)
203 0 {
204 0     wsu_ContextType_array_destroy(
205         (wsu_ContextType_array *) arr);
206 }
207
208 globus_result_t
209 wsu_ContextType_array_copy_wrapper(
210     void **                             dest_arr,
211     const void *                        src_arr)
212 0 {
213 0     return wsu_ContextType_array_copy(
214         (wsu_ContextType_array **) dest_arr,
215         (const wsu_ContextType_array *) src_arr);
216 }
217
218 globus_result_t
219 wsu_ContextType_array_init_contents_wrapper(
220     void *                              arr)
221 0 {
222 0     return wsu_ContextType_array_init_contents(
223         (wsu_ContextType_array *) arr);
224 }
225
226 void
227 wsu_ContextType_array_destroy_contents_wrapper(
228     void *                              arr)
229 0 {
230 0     wsu_ContextType_array_destroy_contents(
231         (wsu_ContextType_array *) arr);
232 }
233
234 globus_result_t
235 wsu_ContextType_array_copy_contents_wrapper(
236     void *                              dest_arr,
237     const void *                        src_arr)
238 0 {
239 0     return wsu_ContextType_array_copy_contents(
240         (wsu_ContextType_array *) dest_arr,
241         (const wsu_ContextType_array *) src_arr);
242 }
243
244 struct globus_xsd_type_info_s wsu_ContextType_contents_info =
245 {
246     &wsu_ContextType_qname,
247     wsu_ContextType_serialize_contents_wrapper,
248     wsu_ContextType_deserialize_contents_wrapper,
249     wsu_ContextType_init_wrapper,
250     wsu_ContextType_destroy_wrapper,
251     wsu_ContextType_copy_wrapper,
252     wsu_ContextType_init_contents_wrapper,
253     wsu_ContextType_destroy_contents_wrapper,
254     wsu_ContextType_copy_contents_wrapper,
255     sizeof(wsu_ContextType),
256     NULL,
257     NULL,
258     NULL
259 };
260
261 struct globus_xsd_type_info_s wsu_ContextType_array_info =
262 {
263     &wsu_ContextType_qname,
264     wsu_ContextType_array_serialize_wrapper,
265     wsu_ContextType_array_deserialize_wrapper,
266     wsu_ContextType_array_init_wrapper,
267     wsu_ContextType_array_destroy_wrapper,
268     wsu_ContextType_array_copy_wrapper,
269     wsu_ContextType_array_init_contents_wrapper,
270     wsu_ContextType_array_destroy_contents_wrapper,
271     wsu_ContextType_array_copy_contents_wrapper,
272     sizeof(wsu_ContextType),
273     wsu_ContextType_array_push_wrapper,
274     NULL,
275     NULL
276 };
277
278 struct globus_xsd_type_info_s wsu_ContextType_info =
279 {
280     &wsu_ContextType_qname,
281     wsu_ContextType_serialize_wrapper,
282     wsu_ContextType_deserialize_pointer_wrapper,
283     wsu_ContextType_init_wrapper,
284     wsu_ContextType_destroy_wrapper,
285     wsu_ContextType_copy_wrapper,
286     wsu_ContextType_init_contents_wrapper,
287     wsu_ContextType_destroy_contents_wrapper,
288     wsu_ContextType_copy_contents_wrapper,
289     sizeof(wsu_ContextType),
290     NULL,
291     &wsu_ContextType_contents_info,
292     &wsu_ContextType_array_info
293 };
294
295 globus_result_t
296 wsu_ContextType_init_contents(
297     wsu_ContextType * instance)
298 0 {
299 0     globus_result_t                     result = GLOBUS_SUCCESS;
300 0     GlobusFuncName(wsu_ContextType_init_contents);
301 0     GlobusSoapMessageDebugEnter();
302
303 0     memset(instance, 0, sizeof(wsu_ContextType));
304
305 0     GlobusSoapMessageDebugExit();
306 0     return result;
307 }
308
309 globus_result_t
310 wsu_ContextType_init(
311     wsu_ContextType ** object)
312 0 {
313 0     wsu_ContextType * instance;
314 0     globus_result_t                     result = GLOBUS_SUCCESS;
315 0     GlobusFuncName(wsu_ContextType_init);
316 0     GlobusSoapMessageDebugEnter();
317
318 0     instance = globus_malloc(sizeof(wsu_ContextType));
319 0     if(!instance)
320     {
321 0         result = GlobusSoapMessageErrorOutOfMemory;
322 0         goto exit;
323     }
324
325 0     memset(instance, 0, sizeof(wsu_ContextType));
326
327 0     *object = instance;
328
329  exit:
330 0     GlobusSoapMessageDebugExit();
331 0     return result;
332 }
333
334 void
335 wsu_ContextType_destroy(
336     wsu_ContextType * instance)
337 0 {
338 0     GlobusFuncName(wsu_ContextType_destroy);
339 0     GlobusSoapMessageDebugEnter();
340
341 0     if(!instance)
342     {
343 0         goto exit;
344     }
345
346 0     wsu_ContextType_destroy_contents(instance);
347 0     globus_free(instance);
348
349  exit:
350
351 0     GlobusSoapMessageDebugExit();
352 }
353
354
355 void
356 wsu_ContextType_destroy_contents(
357     wsu_ContextType * instance)
358 0 {
359 0     GlobusFuncName(wsu_ContextType_destroy_contents);
360 0     GlobusSoapMessageDebugEnter();
361
362 0     if(instance)
363     {
364
365
366 0     wsu_AttributedDateTime_destroy(instance->Expires);
367 0     instance->Expires = NULL;
368
369 0     wsu_AttributedURI_destroy_contents(
370          &instance->Identifier);
371
372 0         xsd_anyAttributes_destroy(instance->anyAttributes);
373 0         instance->anyAttributes = NULL;
374
375 0     if(instance->_Id)
376     {
377 0         xsd_ID_destroy(
378             instance->_Id);
379 0         instance->_Id = NULL;
380     }
381
382 0     xsd_any_array_destroy_contents(&instance->any);
383
384     }
385
386 0     GlobusSoapMessageDebugExit();
387 }
388
389
390 globus_result_t
391 wsu_ContextType_copy(
392     wsu_ContextType ** dest_obj,
393     const wsu_ContextType * src_obj)
394 0 {
395 0     globus_result_t                     result = GLOBUS_SUCCESS;
396 0     wsu_ContextType * instance;
397 0     GlobusFuncName(wsu_ContextType_copy);
398
399 0     GlobusSoapMessageDebugEnter();
400
401 0     instance = calloc(1, sizeof(wsu_ContextType));
402 0     if (instance == NULL)
403     {
404 0         GlobusSoapMessageDebugExit();
405 0         return GlobusSoapMessageErrorOutOfMemory;
406     }
407
408 0     result = wsu_ContextType_copy_contents(instance, src_obj);
409 0     if(result != GLOBUS_SUCCESS)
410     {
411 0         globus_free(instance);
412 0         GlobusSoapMessageDebugExit();
413 0         return GlobusSoapMessageErrorOutOfMemory;
414     }
415
416 0     *dest_obj = instance;
417 0     GlobusSoapMessageDebugExit();
418 0     return result;
419 }
420
421 globus_result_t
422 wsu_ContextType_copy_contents(
423     wsu_ContextType * instance,
424     const wsu_ContextType * src_obj)
425 0 {
426 0     globus_result_t                     result = GLOBUS_SUCCESS;
427 0     GlobusFuncName(wsu_ContextType_copy_contents);
428
429 0     GlobusSoapMessageDebugEnter();
430
431 0     if(src_obj->anyAttributes)
432     {
433 0         result = xsd_anyAttributes_copy(&instance->anyAttributes, 
434                                         src_obj->anyAttributes);
435 0         if(result != GLOBUS_SUCCESS)
436         {
437 0             result = GlobusSoapMessageErrorCopyAnyAttrsFailed(
438                 result, NULL);
439 0             goto xsd_anyAttributes_after_destroy;
440         }
441     }
442     else
443     {
444 0         instance->anyAttributes = NULL;
445     }
446
447 0     if(src_obj->_Id)
448     {
449 0         result = xsd_ID_copy(
450             &instance->_Id,
451             src_obj->_Id);
452 0         if(result != GLOBUS_SUCCESS)
453         {
454 0             result = GlobusSoapMessageErrorCopyFailed(
455                 result, NULL, &xsd_ID_qname);
456 0             goto _Id_destroy;
457         }
458     }
459     else
460     {
461 0         instance->_Id = NULL;
462     }
463
464 0     if(src_obj->Expires)
465     {
466 0         result = wsu_AttributedDateTime_copy(
467             &instance->Expires,
468             src_obj->Expires);
469 0         if(result != GLOBUS_SUCCESS)
470         {
471 0             result = GlobusSoapMessageErrorCopyFailed(
472                 result, NULL, &wsu_AttributedDateTime_qname);
473 0             goto Expires_destroy_pointer;
474         }
475     }
476     else
477     {
478 0         instance->Expires = NULL;
479     }
480
481 0     result = wsu_AttributedURI_copy_contents(
482         &instance->Identifier,
483         &src_obj->Identifier);
484 0     if(result != GLOBUS_SUCCESS)
485     {
486 0         result = GlobusSoapMessageErrorCopyFailed(
487                 result, NULL, &wsu_AttributedURI_qname);
488 0         goto Identifier_destroy;
489     }
490     
491 0      result = xsd_any_array_copy_contents(
492          &instance->any,
493          &src_obj->any);
494 0      if(result != GLOBUS_SUCCESS)
495      {
496 0          result = GlobusSoapMessageErrorCopyFailed(
497              result, NULL, &xsd_any_qname);
498 0          goto any_destroy_array;
499      }
500
501 0     goto exit;
502
503  fail_deserialize:
504
505  xsd_anyAttributes_destroy:
506 0         xsd_anyAttributes_destroy(instance->anyAttributes);
507 0         instance->anyAttributes = NULL;
508  xsd_anyAttributes_after_destroy:
509 0         wsu_AttributedDateTime_destroy(
510             instance->Expires);
511 0          instance->Expires = NULL;
512
513  Expires_destroy_pointer:
514 0         wsu_AttributedURI_destroy_contents(
515              &instance->Identifier);
516
517  Identifier_destroy:
518
519  _Id_destroy:
520
521 0     if(instance->_Id)
522     {
523 0         xsd_ID_destroy(
524             instance->_Id);
525 0         instance->_Id = NULL;
526     }
527 0         xsd_any_array_destroy_contents(
528             &instance->any);
529
530  any_destroy_array:
531
532
533  exit:
534
535 0     GlobusSoapMessageDebugExit();
536 0     return result;
537 }
538
539
540
541 globus_result_t
542 wsu_ContextType_serialize_contents(
543     const xsd_QName *                   element_qname, /* ignored */
544     const wsu_ContextType *              inst,
545     globus_soap_message_handle_t        message_handle,
546     globus_xsd_element_options_t        options)
547 0 {
548 0     globus_result_t                     result = GLOBUS_SUCCESS;
549 0     GlobusFuncName(wsu_ContextType_serialize_contents);
550 0     GlobusSoapMessageDebugEnter();
551
552 0     result = wsu_ContextType_serialize(
553         NULL,
554         inst,
555         message_handle,
556         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
557 0     if(result != GLOBUS_SUCCESS)
558     {
559 0         result = GlobusSoapMessageErrorSerializeFailed(
560             result, NULL, element_qname);
561         goto exit;
562     }
563
564  exit:
565
566 0     GlobusSoapMessageDebugExit();
567 0     return result;
568 }
569
570
571
572 globus_result_t
573 wsu_ContextType_serialize(
574     const xsd_QName *                   element_qname,
575     const wsu_ContextType *              instance,
576     globus_soap_message_handle_t        message_handle,
577     globus_xsd_element_options_t        options)
578 0 {
579 0     globus_result_t                     result = GLOBUS_SUCCESS;
580 0     xsd_QName                           subelement;
581 0     globus_list_t *                     any_attr_keys = NULL;
582 0     globus_list_t *                     any_attr_keys_iterator = NULL;
583 0     xsd_QName *                         type_attr = NULL;
584
585 0     char *                              prefix = NULL;
586 0     int                                 prefix_created;
587 0     int                                 define_prefix = 0;
588 0     int                                 save_options = options;
589
590 0     GlobusFuncName(wsu_ContextType_serialize);
591 0     GlobusSoapMessageDebugEnter();
592
593
594 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
595     {
596         /* serialize wsu_ContextType element */
597 0 result = globus_soap_message_element_ns_set(
598             message_handle,
599             element_qname,
600             element_qname->Namespace,
601             &options);
602 0         if(result != GLOBUS_SUCCESS)
603         {
604 0             result = GlobusSoapMessageErrorSerializeFailed(
605                 result, NULL, element_qname);
606 0             goto exit;
607         }
608
609 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
610    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
611         {
612 0             result = globus_soap_message_attribute_ns_set(
613                 message_handle,
614                 element_qname,
615                 "http://www.w3.org/2001/XMLSchema-instance",
616                 &options);
617 0             if(result != GLOBUS_SUCCESS)
618             {
619 0                 result = GlobusSoapMessageErrorSerializeFailed(
620                     result, NULL, element_qname);
621 0                 goto exit;
622             }
623         }
624
625 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
626    !globus_soap_message_serialize_is_c14n_subset(message_handle))
627         {
628
629 0             result = globus_soap_message_attribute_ns_set(
630                 message_handle,
631                 element_qname,
632                 wsu_ContextType_qname.Namespace,
633                 &options);
634 0             if(result != GLOBUS_SUCCESS)
635             {
636 0                 result = GlobusSoapMessageErrorSerializeFailed(
637                     result, NULL, element_qname);
638 0                 goto exit;
639             }
640         }
641
642 0         result = xsd_anyAttributes_namespace_set(
643             message_handle, element_qname, instance->anyAttributes, &options);
644 0         if(result != GLOBUS_SUCCESS)
645         {
646 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
647                 result, "Failed to set namespace");
648 0             goto exit;
649         }
650
651 0         if(instance->_Id)
652         {
653
654 0         result = globus_soap_message_attribute_ns_set(
655             message_handle,
656             element_qname,
657             "http://schemas.xmlsoap.org/ws/2002/07/utility",
658              &options);
659
660 0         if(result != GLOBUS_SUCCESS)
661         {
662 0             xsd_QName               error_qname;
663 0             error_qname.local = prefix;
664 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
665 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
666                                                            NULL, 
667                                                            &error_qname);
668 0             goto exit;
669         }
670
671
672         }
673
674        {
675 0            int ani;
676
677 0            for (ani = 0; ani < instance->any.length; ani++)
678
679     {
680         /*
681         int nsi;
682         for (nsi = 0; nsi < instance->any.elements[ani].namespaces.length; nsi++)
683         {
684             if (instance->any.elements[ani].namespaces.elements[nsi] != NULL)
685             {
686                 char * prefix;
687                 char * ns;
688                 prefix = globus_libc_strdup(
689                         instance->any.elements[ani].namespaces.elements[nsi]);
690                 if (prefix == NULL)
691                 {
692                     result = GlobusSoapMessageErrorOutOfMemory;
693
694                     goto exit;
695                 }
696                 ns = strchr(prefix, '=');
697                 if (ns == NULL)
698                 {
699                     free(prefix);
700
701                     result = GlobusSoapMessageErrorSerializeNamespaceFailed(ns, prefix);
702                     goto exit;
703                 }
704                 *(ns) = '\0';
705                 ns++;
706                 result = globus_soap_message_serialize_ns_set_prefix(
707                     message_handle,
708                     element_qname,
709                     ns,
710                     prefix,
711                     &options);
712                 free(prefix);
713                 if(result != GLOBUS_SUCCESS)
714                 {
715                     goto exit;
716                 }
717             }
718         }
719         */
720     }
721
722     }
723
724 0         result = globus_soap_message_serialize_element(
725             message_handle,
726             element_qname,
727             options,
728             &wsu_ContextType_qname);
729 0         if(result != GLOBUS_SUCCESS)
730         {
731 0             result = GlobusSoapMessageErrorSerializeFailed(
732                 result, NULL, element_qname);
733 0             goto exit;
734         }
735
736 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
737    !globus_soap_message_serialize_is_c14n_subset(message_handle))
738         {
739 0            xsd_QName_init(&type_attr);
740        
741 0            type_attr->local = globus_libc_strdup("type");
742 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
743         }
744
745
746         /* serialize namespaces */
747 0 result = globus_soap_message_element_ns_add(
748             message_handle,
749             element_qname,
750             element_qname->Namespace,
751             &options);
752 0         if(result != GLOBUS_SUCCESS)
753         {
754 0             result = GlobusSoapMessageErrorSerializeFailed(
755                 result, NULL, element_qname);
756 0             goto exit;
757         }
758
759 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
760    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
761         {
762 0             result = globus_soap_message_attribute_ns_add(
763                 message_handle,
764                 element_qname,
765                 "http://www.w3.org/2001/XMLSchema-instance",
766                 &options);
767 0             if(result != GLOBUS_SUCCESS)
768             {
769 0                 result = GlobusSoapMessageErrorSerializeFailed(
770                     result, NULL, element_qname);
771 0                 goto exit;
772             }
773         }
774 0         if ((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
775    !globus_soap_message_serialize_is_c14n_subset(message_handle))
776         {
777
778 0             result = globus_soap_message_attribute_ns_add(
779                 message_handle,
780                 element_qname,
781                 wsu_ContextType_qname.Namespace,
782                 &options);
783 0             if(result != GLOBUS_SUCCESS)
784             {
785 0                 result = GlobusSoapMessageErrorSerializeFailed(
786                     result, NULL, element_qname);
787 0                 goto exit;
788             }
789         }
790
791 0         result = xsd_anyAttributes_namespace_add(
792             message_handle, element_qname, instance->anyAttributes, &options);
793 0         if(result != GLOBUS_SUCCESS)
794         {
795 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
796                 result, "Failed to add namespace");
797 0             goto exit;
798         }
799
800 0         if(instance->_Id)
801         {
802
803 0         result = globus_soap_message_attribute_ns_add(
804             message_handle,
805             element_qname,
806             "http://schemas.xmlsoap.org/ws/2002/07/utility",
807              &options);
808
809 0         if(result != GLOBUS_SUCCESS)
810         {
811 0             xsd_QName               error_qname;
812 0             error_qname.local = prefix;
813 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
814 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
815                                                            NULL, 
816                                                            &error_qname);
817 0             goto exit;
818         }
819
820
821         }
822
823        {
824 0            int ani;
825
826 0            for (ani = 0; ani < instance->any.length; ani++)
827
828     {
829         /*
830         int nsi;
831         for (nsi = 0; nsi < instance->any.elements[ani].namespaces.length; nsi++)
832         {
833             if (instance->any.elements[ani].namespaces.elements[nsi] != NULL)
834             {
835                 char * prefix;
836                 char * ns;
837
838                 prefix = globus_libc_strdup(
839                         instance->any.elements[ani].namespaces.elements[nsi]);
840                 if (prefix == NULL)
841                 {
842                     result = GlobusSoapMessageErrorOutOfMemory;
843
844                     goto exit;
845                 }
846                 ns = strchr(prefix, '=');
847                 if (ns == NULL)
848                 {
849                     free(prefix);
850
851                     result = GlobusSoapMessageErrorSerializeNamespaceFailed(ns, prefix);
852                     goto exit;
853                 }
854                 *(ns) = '\0';
855                 ns++;
856                 result = globus_soap_message_serialize_ns_add_prefix(
857                     message_handle,
858                     element_qname,
859                     ns,
860                     prefix,
861                     &options);
862                 free(prefix);
863                 if(result != GLOBUS_SUCCESS)
864                 {
865                     goto exit;
866                 }
867             }
868         }
869         */
870     }
871
872     }
873
874         /* serialize attributes */
875
876 0         if(instance->anyAttributes)
877         {
878 0             any_attr_keys = xsd_anyAttributes_lex_sort(
879                 instance->anyAttributes);
880 0             any_attr_keys_iterator = any_attr_keys;
881         }
882
883 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
884 0         subelement.local = "Id";
885
886 0         if(any_attr_keys_iterator)
887         {
888 0             result = xsd_anyAttributes_serialize_lex_before(
889                 message_handle,
890                 &any_attr_keys_iterator,
891                 instance->anyAttributes,
892                 &subelement);
893 0             if(result != GLOBUS_SUCCESS)
894             {
895 0                 result = GlobusSoapMessageErrorSerializeFailed(result, 
896                                                                NULL, 
897                                                                element_qname);
898 0                 goto exit;
899             }
900         }
901
902 0         if(instance->_Id)
903         {
904
905 0         result = xsd_ID_serialize_attribute(
906             &subelement,
907             instance->_Id,
908             message_handle,
909             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
910 0         if(result != GLOBUS_SUCCESS)
911         {
912 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
913                                                            NULL, 
914                                                            element_qname);
915 0             goto exit;
916         }
917
918         }
919
920 0         if(any_attr_keys_iterator)
921         {
922 0             result = xsd_anyAttributes_serialize_lex_before(
923                 message_handle,
924                 &any_attr_keys_iterator,
925                 instance->anyAttributes,
926                 type_attr);
927 0             if(result != GLOBUS_SUCCESS)
928             {
929 0                 result = GlobusSoapMessageErrorSerializeFailed(result, 
930                                                                NULL, 
931                                                                element_qname);
932 0                 goto exit;
933             }
934         }
935
936 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
937    !globus_soap_message_serialize_is_c14n_subset(message_handle))
938         {
939 0             result = globus_soap_message_serialize_QName_attribute(
940                 message_handle,
941                 type_attr,
942                 &wsu_ContextType_qname);
943 0             if(result != GLOBUS_SUCCESS)
944             {
945 0                 result = GlobusSoapMessageErrorSerializeFailed(
946                     result, NULL, element_qname);
947 0                 goto exit;
948             }
949         }
950
951
952     }
953
954 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
955     {
956 0         result = globus_soap_message_serialize_element_begin_close(
957             message_handle, element_qname);
958 0         if(result != GLOBUS_SUCCESS)
959         {
960 0             result = GlobusSoapMessageErrorSerializeFailed(
961                 result, NULL, element_qname);
962 0             goto exit;
963         }
964     }
965 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
966
967
968     /* serialize contents of type */
969
970 0     subelement.local = "Expires";
971 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
972
973 0     if(instance->Expires)
974     {
975 0         result = wsu_AttributedDateTime_serialize(
976             &subelement,
977             instance->Expires,
978             message_handle,
979             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
980 0         if(result != GLOBUS_SUCCESS)
981         {
982 0             result = GlobusSoapMessageErrorSerializeFailed(
983                 result, NULL, &wsu_AttributedDateTime_qname);
984 0             goto exit;
985         }
986     }
987
988 0     subelement.local = "Identifier";
989 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
990
991 0     result = wsu_AttributedURI_serialize(
992          &subelement,
993          &instance->Identifier,
994          message_handle,
995          options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
996 0     if(result != GLOBUS_SUCCESS)
997     {
998 0         result = GlobusSoapMessageErrorSerializeFailed(
999                 result, NULL, &wsu_AttributedURI_qname);
1000 0         goto exit;
1001     }
1002
1003 0     subelement.local = "any";
1004 0     subelement.Namespace = "http://www.w3.org/2001/XMLSchema";
1005     
1006 0      result = xsd_any_array_serialize(
1007          &subelement,
1008          &instance->any,
1009          message_handle,
1010          options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
1011 0      if(result != GLOBUS_SUCCESS)
1012      {
1013 0          result = GlobusSoapMessageErrorSerializeFailed(
1014              result, NULL, &xsd_any_qname);
1015 0          goto exit;
1016      }
1017
1018 0     options = save_options;
1019
1020 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1021     {
1022         /* add end element */
1023 0         result = globus_soap_message_serialize_element_end(
1024             message_handle,
1025             element_qname,
1026             options,
1027             &wsu_ContextType_qname);
1028 0         if(result != GLOBUS_SUCCESS)
1029         {
1030 0             result = GlobusSoapMessageErrorSerializeFailed(
1031                 result, NULL, element_qname);
1032 0             goto exit;
1033         }
1034
1035 0         globus_soap_message_element_ns_remove(
1036             message_handle,
1037             element_qname->Namespace,
1038             &options);
1039
1040     /* remove namespace/prefix mappings for these types */
1041
1042 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1043    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
1044         {
1045 0             globus_soap_message_attribute_ns_remove(
1046                 message_handle,
1047                 "http://www.w3.org/2001/XMLSchema-instance",
1048                 &options);
1049         }           
1050 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1051    !globus_soap_message_serialize_is_c14n_subset(message_handle))
1052         {
1053 0             globus_soap_message_attribute_ns_remove(
1054                 message_handle,
1055                 wsu_ContextType_qname.Namespace,
1056                 &options);
1057         }           
1058
1059 0         result = xsd_anyAttributes_namespace_remove(
1060             message_handle, instance->anyAttributes, &options);
1061 0         if(result != GLOBUS_SUCCESS)
1062         {
1063 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
1064                 result, "Failed to remove namespace");
1065 0             goto exit;
1066         }
1067
1068 0         if(instance->_Id)
1069         {
1070
1071 0         globus_soap_message_attribute_ns_remove(
1072             message_handle,
1073             "http://schemas.xmlsoap.org/ws/2002/07/utility",
1074              &options);
1075
1076         }
1077
1078        {
1079 0            int ani;
1080
1081 0            for (ani = 0; ani < instance->any.length; ani++)
1082
1083     {
1084         /*
1085         int nsi;
1086         for (nsi = 0; nsi < instance->any.elements[ani].namespaces.length; nsi++)
1087         {
1088             if (instance->any.elements[ani].namespaces.elements[nsi] != NULL)
1089             {
1090                 char * prefix;
1091                 char * ns;
1092
1093                 prefix = globus_libc_strdup(
1094                         instance->any.elements[ani].namespaces.elements[nsi]);
1095                 if (prefix == NULL)
1096                 {
1097                     result = GlobusSoapMessageErrorOutOfMemory;
1098
1099                     goto exit;
1100                 }
1101                 ns = strchr(prefix, '=');
1102                 if (ns == NULL)
1103                 {
1104                     free(prefix);
1105
1106                     result = GlobusSoapMessageErrorSerializeNamespaceFailed(ns, prefix);
1107                     goto exit;
1108                 }
1109                 *(ns) = '\0';
1110                 ns++;
1111
1112                 globus_soap_message_serialize_ns_remove_prefix(
1113                         message_handle,
1114                         ns,
1115                         prefix,
1116                         &options);
1117                 free(prefix);
1118             }
1119         }
1120         */
1121     }
1122
1123     }
1124
1125     }
1126
1127  exit:
1128 0     if (type_attr)
1129     {
1130 0         xsd_QName_destroy(type_attr);
1131     }
1132
1133
1134 0     if(any_attr_keys)
1135     {
1136 0         globus_list_free(any_attr_keys);
1137     }
1138
1139 0     GlobusSoapMessageDebugExit();
1140 0     return result;
1141 }
1142
1143
1144
1145 globus_result_t
1146 wsu_ContextType_deserialize_contents(
1147     const xsd_QName *                   element_qname, /* ignored */
1148     wsu_ContextType *                    inst,
1149     globus_soap_message_handle_t        message_handle,
1150     globus_xsd_element_options_t        options)
1151 0 {
1152 0     globus_result_t                     result = GLOBUS_SUCCESS;
1153 0     GlobusFuncName(wsu_ContextType_deserialize_contents);
1154 0     GlobusSoapMessageDebugEnter();
1155
1156 0     result = wsu_ContextType_deserialize(
1157         NULL,
1158         inst,
1159         message_handle,
1160         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1161 0     if(result != GLOBUS_SUCCESS)
1162     {
1163 0         result = GlobusSoapMessageErrorDeserializeFailed(
1164             result, element_qname);
1165         goto exit;
1166     }
1167
1168  exit:
1169
1170 0     GlobusSoapMessageDebugExit();
1171 0     return result;
1172 }
1173
1174
1175
1176 globus_result_t
1177 wsu_ContextType_deserialize(
1178     const xsd_QName *                   element_qname,
1179     wsu_ContextType *                    instance,
1180     globus_soap_message_handle_t        message_handle,
1181     globus_xsd_element_options_t        options)
1182 0 {
1183 0     globus_result_t                     result = GLOBUS_SUCCESS;
1184 0     xsd_QName                           subelement;
1185 0     GlobusFuncName(wsu_ContextType_deserialize);
1186 0     GlobusSoapMessageDebugEnter();
1187
1188
1189 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1190     {
1191 0         result = globus_soap_message_deserialize_element(
1192             message_handle, element_qname);
1193 0         if(result != GLOBUS_SUCCESS)
1194         {
1195 0             result = GlobusSoapMessageErrorDeserializeFailed(
1196                 result, element_qname);
1197 0             goto exit;
1198         }
1199
1200 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1201 0         if(result != GLOBUS_SUCCESS)
1202         {
1203 0             result = GlobusSoapMessageErrorDeserializeFailed(
1204                 result, element_qname);
1205 0             goto xsd_anyAttributes_after_destroy;
1206         }
1207
1208 0         result = xsd_anyAttributes_deserialize(
1209             message_handle,
1210             instance->anyAttributes);
1211 0         if(result != GLOBUS_SUCCESS)
1212         {
1213 0             result = GlobusSoapMessageErrorDeserializeFailed(
1214                 result, element_qname);
1215 0             goto xsd_anyAttributes_destroy;
1216         }
1217
1218 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
1219 0     subelement.local = "Id";
1220
1221 0     result = xsd_ID_deserialize_attribute_pointer(
1222         &subelement,
1223         &instance->_Id,
1224         message_handle,
1225         0);
1226 0     if(result != GLOBUS_SUCCESS)
1227     {
1228 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1229 0         goto _Id_destroy;
1230     }
1231
1232
1233
1234 0         result = globus_soap_message_deserialize_element_begin_close(
1235             message_handle);
1236 0         if(result != GLOBUS_SUCCESS)
1237         {
1238 0             result = GlobusSoapMessageErrorDeserializeFailed(
1239                 result, element_qname);
1240 0             goto fail_deserialize;
1241         }
1242     }
1243
1244 0     subelement.local = "Expires";
1245 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
1246
1247 0     result = wsu_AttributedDateTime_deserialize_pointer(
1248         &subelement,
1249         &instance->Expires,
1250         message_handle,
1251         0);
1252 0     if(result != GLOBUS_SUCCESS)
1253     {
1254 0         result = GlobusSoapMessageErrorDeserializeFailed(
1255             result, 
1256             (&subelement));
1257 0         goto Expires_destroy_pointer;
1258     }
1259
1260 0     subelement.local = "Identifier";
1261 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
1262
1263 0     result = wsu_AttributedURI_deserialize(
1264          &subelement,
1265          &instance->Identifier,
1266          message_handle,
1267          0);
1268 0     if(result != GLOBUS_SUCCESS)
1269     {
1270 0         result = GlobusSoapMessageErrorDeserializeFailed(
1271             result, 
1272             &wsu_AttributedURI_qname);
1273 0         goto Identifier_destroy;
1274     }
1275
1276 0     subelement.local = "any";
1277 0     subelement.Namespace = "http://www.w3.org/2001/XMLSchema";
1278     
1279 0     result = xsd_any_array_deserialize(
1280         &subelement,
1281         &instance->any,
1282         message_handle,
1283         0);
1284 0     if(result != GLOBUS_SUCCESS)
1285     {
1286 0         result = GlobusSoapMessageErrorDeserializeFailed(
1287             result, 
1288             (&subelement));
1289 0         goto any_destroy_array;
1290     }
1291
1292 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1293     {
1294 0         result = globus_soap_message_deserialize_element_end(
1295             message_handle,
1296             element_qname);
1297 0         if(result != GLOBUS_SUCCESS)
1298         {
1299 0             result = GlobusSoapMessageErrorDeserializeFailed(
1300                 result, element_qname);
1301             goto fail_deserialize;
1302         }
1303     }
1304
1305 0     goto exit;
1306
1307  fail_deserialize:
1308
1309  xsd_anyAttributes_destroy:
1310 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1311 0         instance->anyAttributes = NULL;
1312  xsd_anyAttributes_after_destroy:
1313 0         wsu_AttributedDateTime_destroy(
1314             instance->Expires);
1315 0          instance->Expires = NULL;
1316
1317  Expires_destroy_pointer:
1318 0         wsu_AttributedURI_destroy_contents(
1319              &instance->Identifier);
1320
1321  Identifier_destroy:
1322
1323  _Id_destroy:
1324     /* output_fail_destroy_attribute() */
1325
1326 0     if(instance->_Id)
1327     {
1328 0         xsd_ID_destroy(
1329             instance->_Id);
1330 0         instance->_Id = NULL;
1331     }
1332 0         xsd_any_array_destroy_contents(
1333             &instance->any);
1334
1335  any_destroy_array:
1336
1337
1338  exit:
1339
1340 0     GlobusSoapMessageDebugExit();
1341 0     return result;
1342 }
1343
1344
1345
1346 globus_result_t
1347 wsu_ContextType_deserialize_pointer(
1348     const xsd_QName *                   element_qname,
1349     wsu_ContextType **                   ip,
1350     globus_soap_message_handle_t        message_handle,
1351     globus_xsd_element_options_t        options)
1352 0 {
1353 0     wsu_ContextType * instance = NULL;
1354 0     globus_result_t                     result = GLOBUS_SUCCESS;
1355 0     xsd_QName                           subelement;
1356 0     int                                 found_attrs = 0;
1357 0     int                                 empty_element = 0;
1358 0     GlobusFuncName(wsu_ContextType_deserialize_pointer);
1359 0     GlobusSoapMessageDebugEnter();
1360
1361 0     *ip = NULL;
1362
1363 0     result = globus_soap_message_deserialize_element(
1364         message_handle, element_qname);
1365 0     if(result != GLOBUS_SUCCESS &&
1366        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1367         GlobusSoapMessageStatusFailedElementCheck(result) ||
1368         GlobusSoapMessageStatusFailedWithTextCheck(result)))
1369     {
1370 0         result = GLOBUS_SUCCESS;
1371 0         goto exit;
1372     }
1373
1374 0     if(result != GLOBUS_SUCCESS)
1375     {
1376 0         result = GlobusSoapMessageErrorDeserializeFailed(
1377             result, element_qname);
1378 0         goto exit;
1379     }
1380
1381 0     if(globus_soap_message_deserialize_element_is_empty(
1382            message_handle))
1383     {
1384 0         empty_element = 1;
1385     }
1386
1387 0     result = wsu_ContextType_init(&instance);
1388 0     if(result != GLOBUS_SUCCESS)
1389     {
1390 0         result = GlobusSoapMessageErrorDeserializeFailed(
1391             result, element_qname);
1392 0         goto exit;
1393     }
1394
1395
1396 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1397 0         if(result != GLOBUS_SUCCESS)
1398         {
1399 0             result = GlobusSoapMessageErrorDeserializeFailed(
1400                 result, element_qname);
1401 0             goto xsd_anyAttributes_after_destroy;
1402         }
1403
1404 0         result = xsd_anyAttributes_deserialize(
1405             message_handle,
1406             instance->anyAttributes);
1407 0         if(result != GLOBUS_SUCCESS)
1408         {
1409 0             result = GlobusSoapMessageErrorDeserializeFailed(
1410                 result, element_qname);
1411 0             goto xsd_anyAttributes_destroy;
1412         }
1413
1414 0         if(instance->anyAttributes &&
1415            xsd_anyAttributes_size(instance->anyAttributes) > 0)
1416         {
1417 0             found_attrs++;
1418         }
1419
1420 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
1421 0     subelement.local = "Id";
1422
1423 0     result = xsd_ID_deserialize_attribute_pointer(
1424         &subelement,
1425         &instance->_Id,
1426         message_handle,
1427         0);
1428 0     if(result != GLOBUS_SUCCESS)
1429     {
1430 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1431 0         goto _Id_destroy;
1432     }
1433
1434
1435 0     if(instance->_Id)
1436     {
1437 0         found_attrs++;
1438     }
1439
1440
1441 0     if(empty_element)
1442     {
1443 0         result = globus_soap_message_deserialize_element_end(
1444             message_handle,
1445             element_qname);
1446 0         if(result != GLOBUS_SUCCESS)
1447         {
1448 0             result = GlobusSoapMessageErrorDeserializeFailed(
1449                 result, element_qname);
1450 0             goto fail_deserialize;
1451         }
1452
1453 0         *ip = instance;
1454 0         goto exit;
1455     }
1456
1457 0     result = globus_soap_message_deserialize_element_begin_close(
1458         message_handle);
1459 0     if(result != GLOBUS_SUCCESS)
1460     {
1461 0         result = GlobusSoapMessageErrorDeserializeFailed(
1462             result, element_qname);
1463 0         goto exit;
1464     }
1465
1466 0     result = wsu_ContextType_deserialize(
1467             element_qname,
1468             instance,
1469             message_handle,
1470             options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1471
1472 0     result = globus_soap_message_deserialize_element_end(
1473         message_handle,
1474         element_qname);
1475 0     if(result != GLOBUS_SUCCESS)
1476     {
1477 0         result = GlobusSoapMessageErrorDeserializeFailed(
1478             result, element_qname);
1479 0         goto fail_deserialize;
1480     }
1481
1482 0     *ip = instance;
1483
1484 0     goto exit;
1485
1486  fail_deserialize:
1487
1488  xsd_anyAttributes_destroy:
1489 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1490 0         instance->anyAttributes = NULL;
1491  xsd_anyAttributes_after_destroy:
1492 0         wsu_AttributedDateTime_destroy(
1493             instance->Expires);
1494 0          instance->Expires = NULL;
1495
1496  Expires_destroy_pointer:
1497 0         wsu_AttributedURI_destroy_contents(
1498              &instance->Identifier);
1499
1500  Identifier_destroy:
1501
1502  _Id_destroy:
1503     /* output_fail_destroy_attribute() */
1504
1505 0     if(instance->_Id)
1506     {
1507 0         xsd_ID_destroy(
1508             instance->_Id);
1509 0         instance->_Id = NULL;
1510     }
1511 0         xsd_any_array_destroy_contents(
1512             &instance->any);
1513
1514  any_destroy_array:
1515
1516  exit:
1517
1518 0     GlobusSoapMessageDebugExit();
1519 0     return result;
1520 }
1521
1522
1523 globus_result_t
1524 wsu_ContextType_array_init_contents(
1525     wsu_ContextType_array * array)
1526 0 {
1527 0     return globus_xsd_generic_array_init_contents(
1528         (globus_xsd_generic_array_t *) array,
1529         &wsu_ContextType_info);
1530 }
1531 /* wsu_ContextType_array_init_contents() */
1532
1533 globus_result_t
1534 wsu_ContextType_array_init(
1535     wsu_ContextType_array ** arr)
1536 0 {
1537 0     return globus_xsd_generic_array_init(
1538         (globus_xsd_generic_array_t **) arr,
1539         &wsu_ContextType_info);
1540 }
1541 /* wsu_ContextType_array_init() */
1542
1543 void
1544 wsu_ContextType_array_destroy_contents(
1545     wsu_ContextType_array * array)
1546 0 {
1547 0     globus_xsd_generic_array_destroy_contents(
1548         (globus_xsd_generic_array_t *) array);
1549 }
1550 /* wsu_ContextType_array_destroy_contents() */
1551
1552 void
1553 wsu_ContextType_array_destroy(
1554     wsu_ContextType_array * array)
1555 0 {
1556 0     globus_xsd_generic_array_destroy(
1557         (globus_xsd_generic_array_t *) array);
1558 }
1559 /* wsu_ContextType_array_destroy() */
1560
1561 globus_result_t
1562 wsu_ContextType_array_copy(
1563     wsu_ContextType_array ** dest_arr,
1564     const wsu_ContextType_array * src_arr)
1565 0 {
1566 0     return globus_xsd_generic_array_copy(
1567         (globus_xsd_generic_array_t **) dest_arr,
1568         (globus_xsd_generic_array_t *) src_arr);
1569 }
1570 /* wsu_ContextType_array_copy() */
1571
1572 globus_result_t
1573 wsu_ContextType_array_copy_contents(
1574     wsu_ContextType_array * dest_arr,
1575     const wsu_ContextType_array * src_arr)
1576 0 {
1577 0     return globus_xsd_generic_array_copy_contents(
1578         (globus_xsd_generic_array_t *) dest_arr,
1579         (globus_xsd_generic_array_t *) src_arr);
1580 }
1581 /* wsu_ContextType_array_copy_contents() */
1582
1583 wsu_ContextType *
1584 wsu_ContextType_array_push(
1585     wsu_ContextType_array * array)
1586 0 {
1587     /* Some contents initializers don't initialize subelments but to set their
1588      * values to be NULL
1589      */
1590 0     if (array->type_info == NULL)
1591     {
1592 0         array->type_info = &wsu_ContextType_info;
1593     }
1594
1595 0     return globus_xsd_generic_array_push(
1596         (globus_xsd_generic_array_t *) array);
1597 }
1598 /* wsu_ContextType_array_push() */
1599
1600 void *
1601 wsu_ContextType_array_push_wrapper(
1602     void * array)
1603 0 {
1604 0     return (void *) wsu_ContextType_array_push((wsu_ContextType_array *) array);
1605 }
1606
1607 globus_result_t
1608 wsu_ContextType_array_serialize(
1609     const xsd_QName *                   element_qname,
1610     const wsu_ContextType_array *        array,
1611     globus_soap_message_handle_t        message,
1612     globus_xsd_element_options_t        options)
1613 0 {
1614 0     return globus_xsd_generic_array_serialize(
1615         element_qname,
1616         (const globus_xsd_generic_array_t *) array,
1617         message,
1618         options);
1619 }
1620 /* wsu_ContextType_array_serialize() */
1621
1622 globus_result_t
1623 wsu_ContextType_array_deserialize(
1624     const xsd_QName *                   element_qname,
1625     wsu_ContextType_array * array,
1626     globus_soap_message_handle_t        message,
1627     globus_xsd_element_options_t        options)
1628 0 {
1629     /* Some initializers set the array's contents to NULL */
1630 0     if (array->type_info == NULL)
1631     {
1632 0         array->type_info = &wsu_ContextType_info;
1633     }
1634 0     return globus_xsd_generic_array_deserialize(
1635         element_qname,
1636         (globus_xsd_generic_array_t *) array,
1637         message,
1638         options);