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 "wsse_PasswordString.h"
21
22 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
23 xsd_QName wsse_PasswordString_qname =
24 {
25     WSSE_PASSWORDSTRING_NS,
26     WSSE_PASSWORDSTRING_LOCAL
27 };
28 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
29
30 globus_result_t
31 wsse_PasswordString_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 wsse_PasswordString_serialize(
38         element_qname,
39         (wsse_PasswordString *) instance,
40         message_handle, options);
41 }
42
43 globus_result_t
44 wsse_PasswordString_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 wsse_PasswordString_deserialize_pointer(
51         element_qname,
52         (wsse_PasswordString **) ip,
53         message_handle, options);
54 }
55
56 globus_result_t
57 wsse_PasswordString_init_wrapper(void **object)
58 0 {
59 0     return wsse_PasswordString_init(
60         (wsse_PasswordString **) object);
61 }
62
63 void
64 wsse_PasswordString_destroy_wrapper(
65     void *                          object)
66 0 {
67 0     wsse_PasswordString_destroy(
68         (wsse_PasswordString *) object);
69 }
70
71 globus_result_t
72 wsse_PasswordString_copy_wrapper(
73     void **                         dest_obj,
74     void *                          src_obj)
75 0 {
76 0     return wsse_PasswordString_copy(
77         (wsse_PasswordString **) dest_obj,
78         (wsse_PasswordString *) src_obj);
79 }
80
81 globus_result_t
82 wsse_PasswordString_init_contents_wrapper(void *object)
83 0 {
84 0     return wsse_PasswordString_init_contents(
85         (wsse_PasswordString *) object);
86 }
87
88 void
89 wsse_PasswordString_destroy_contents_wrapper(
90     void *                          object)
91 0 {
92 0     wsse_PasswordString_destroy_contents(
93         (wsse_PasswordString *) object);
94 }
95
96 globus_result_t
97 wsse_PasswordString_copy_contents_wrapper(
98     void *                          dest_obj,
99     void *                          src_obj)
100 0 {
101 0     return wsse_PasswordString_copy_contents(
102         (wsse_PasswordString *) dest_obj,
103         (wsse_PasswordString *) src_obj);
104 }
105
106 globus_result_t
107 wsse_PasswordString_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 wsse_PasswordString_serialize_contents(
114         element_qname,
115         (wsse_PasswordString *) instance,
116         message_handle, options);
117 }
118
119 globus_result_t
120 wsse_PasswordString_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(wsse_PasswordString_deserialize_contents_wrapper);
128 0     GlobusSoapMessageDebugEnter();
129
130 0     if(!*instance)
131     {
132 0         result = wsse_PasswordString_init(
133             (wsse_PasswordString **)instance);
134 0         if(result != GLOBUS_SUCCESS)
135         {
136 0             goto error;
137         }
138     }
139
140 0     result = wsse_PasswordString_deserialize_contents(
141         element_qname,
142         *(wsse_PasswordString **)instance,
143         message_handle, options);
144 error:
145 0     GlobusSoapMessageDebugExit();
146 0     return result;
147 }
148
149 globus_result_t
150 wsse_PasswordString_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 wsse_PasswordString_array_serialize(
157         element,
158         (wsse_PasswordString_array *) instance,
159         message, options);
160 }
161
162 globus_result_t
163 wsse_PasswordString_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 = wsse_PasswordString_array_init(
174             (wsse_PasswordString_array **)inst);
175 0         if(result != GLOBUS_SUCCESS)
176         {
177 0             return result;
178         }
179     }
180
181 0     return wsse_PasswordString_array_deserialize(
182         element_qname,
183         *(wsse_PasswordString_array **) inst,
184         message, options);
185 }
186
187 globus_result_t
188 wsse_PasswordString_array_init_wrapper(
189     void **                             arr)
190 0 {
191 0     return wsse_PasswordString_array_init(
192         (wsse_PasswordString_array **) arr);
193 }
194
195 void
196 wsse_PasswordString_array_destroy_wrapper(
197     void *                              arr)
198 0 {
199 0     wsse_PasswordString_array_destroy(
200         (wsse_PasswordString_array *) arr);
201 }
202
203 globus_result_t
204 wsse_PasswordString_array_copy_wrapper(
205     void **                             dest_arr,
206     void *                              src_arr)
207 0 {
208 0     return wsse_PasswordString_array_copy(
209         (wsse_PasswordString_array **) dest_arr,
210         (wsse_PasswordString_array *) src_arr);
211 }
212
213 globus_result_t
214 wsse_PasswordString_array_init_contents_wrapper(
215     void *                              arr)
216 0 {
217 0     return wsse_PasswordString_array_init_contents(
218         (wsse_PasswordString_array *) arr);
219 }
220
221 void
222 wsse_PasswordString_array_destroy_contents_wrapper(
223     void *                              arr)
224 0 {
225 0     wsse_PasswordString_array_destroy_contents(
226         (wsse_PasswordString_array *) arr);
227 }
228
229 globus_result_t
230 wsse_PasswordString_array_copy_contents_wrapper(
231     void *                              dest_arr,
232     void *                              src_arr)
233 0 {
234 0     return wsse_PasswordString_array_copy_contents(
235         (wsse_PasswordString_array *) dest_arr,
236         (wsse_PasswordString_array *) src_arr);
237 }
238
239 struct globus_xsd_type_info_s wsse_PasswordString_contents_info =
240 {
241     &wsse_PasswordString_qname,
242     wsse_PasswordString_serialize_contents_wrapper,
243     wsse_PasswordString_deserialize_contents_wrapper,
244     wsse_PasswordString_init_wrapper,
245     wsse_PasswordString_destroy_wrapper,
246     wsse_PasswordString_copy_wrapper,
247     wsse_PasswordString_init_contents_wrapper,
248     wsse_PasswordString_destroy_contents_wrapper,
249     wsse_PasswordString_copy_contents_wrapper,
250     sizeof(wsse_PasswordString),
251     NULL,
252     NULL,
253     NULL
254 };
255
256 struct globus_xsd_type_info_s wsse_PasswordString_array_info =
257 {
258     &wsse_PasswordString_qname,
259     wsse_PasswordString_array_serialize_wrapper,
260     wsse_PasswordString_array_deserialize_wrapper,
261     wsse_PasswordString_array_init_wrapper,
262     wsse_PasswordString_array_destroy_wrapper,
263     wsse_PasswordString_array_copy_wrapper,
264     wsse_PasswordString_array_init_contents_wrapper,
265     wsse_PasswordString_array_destroy_contents_wrapper,
266     wsse_PasswordString_array_copy_contents_wrapper,
267     sizeof(wsse_PasswordString),
268     wsse_PasswordString_array_push_wrapper,
269     NULL,
270     NULL
271 };
272
273 struct globus_xsd_type_info_s wsse_PasswordString_info =
274 {
275     &wsse_PasswordString_qname,
276     wsse_PasswordString_serialize_wrapper,
277     wsse_PasswordString_deserialize_pointer_wrapper,
278     wsse_PasswordString_init_wrapper,
279     wsse_PasswordString_destroy_wrapper,
280     wsse_PasswordString_copy_wrapper,
281     wsse_PasswordString_init_contents_wrapper,
282     wsse_PasswordString_destroy_contents_wrapper,
283     wsse_PasswordString_copy_contents_wrapper,
284     sizeof(wsse_PasswordString),
285     NULL,
286     &wsse_PasswordString_contents_info,
287     &wsse_PasswordString_array_info
288 };
289
290 globus_result_t
291 wsse_PasswordString_init_contents(
292     wsse_PasswordString * instance)
293 0 {
294 0     globus_result_t                     result = GLOBUS_SUCCESS;
295 0     GlobusFuncName(wsse_PasswordString_init_contents);
296 0     GlobusSoapMessageDebugEnter();
297
298 0     memset(instance, 0, sizeof(wsse_PasswordString));
299
300 0     GlobusSoapMessageDebugExit();
301 0     return result;
302 }
303
304 globus_result_t
305 wsse_PasswordString_init(
306     wsse_PasswordString ** object)
307 0 {
308 0     wsse_PasswordString * instance;
309 0     globus_result_t                     result = GLOBUS_SUCCESS;
310 0     GlobusFuncName(wsse_PasswordString_init);
311 0     GlobusSoapMessageDebugEnter();
312
313 0     instance = globus_malloc(sizeof(wsse_PasswordString));
314 0     if(!instance)
315     {
316 0         result = GlobusSoapMessageErrorOutOfMemory;
317 0         goto exit;
318     }
319
320 0     memset(instance, 0, sizeof(wsse_PasswordString));
321
322 0     *object = instance;
323
324  exit:
325 0     GlobusSoapMessageDebugExit();
326 0     return result;
327 }
328
329 void
330 wsse_PasswordString_destroy(
331     wsse_PasswordString * instance)
332 0 {
333 0     GlobusFuncName(wsse_PasswordString_destroy);
334 0     GlobusSoapMessageDebugEnter();
335
336 0     if(!instance)
337     {
338 0         goto exit;
339     }
340
341 0     wsse_PasswordString_destroy_contents(instance);
342 0     globus_free(instance);
343
344  exit:
345
346 0     GlobusSoapMessageDebugExit();
347 }
348
349 void
350 wsse_PasswordString_destroy_contents(
351     wsse_PasswordString * instance)
352 0 {
353 0     GlobusFuncName(wsse_PasswordString_destroy_contents);
354 0     GlobusSoapMessageDebugEnter();
355
356 0     if(instance)
357     {
358
359
360 0     xsd_string_destroy_contents(
361          &instance->base_value);
362
363 0         xsd_anyAttributes_destroy(instance->anyAttributes);
364 0         instance->anyAttributes = NULL;
365
366 0     if(instance->_Id)
367     {
368 0         xsd_ID_destroy(
369             instance->_Id);
370 0         instance->_Id = NULL;
371     }
372
373 0     if(instance->_Type)
374     {
375 0         xsd_anyURI_destroy(
376             instance->_Type);
377 0         instance->_Type = NULL;
378     }
379
380     }
381
382 0     GlobusSoapMessageDebugExit();
383 }
384
385 globus_result_t
386 wsse_PasswordString_copy(
387     wsse_PasswordString ** dest_obj,
388     const wsse_PasswordString * src_obj)
389 0 {
390 0     globus_result_t                     result = GLOBUS_SUCCESS;
391 0     wsse_PasswordString * instance;
392 0     GlobusFuncName(wsse_PasswordString_copy);
393
394 0     GlobusSoapMessageDebugEnter();
395
396 0     instance = malloc(sizeof(wsse_PasswordString));
397 0     if (instance == NULL)
398     {
399 0         GlobusSoapMessageDebugExit();
400 0         return GlobusSoapMessageErrorOutOfMemory;
401     }
402
403 0     result = wsse_PasswordString_copy_contents(instance, src_obj);
404 0     if(result != GLOBUS_SUCCESS)
405     {
406 0         globus_free(instance);
407 0         GlobusSoapMessageDebugExit();
408 0         return GlobusSoapMessageErrorOutOfMemory;
409     }
410
411 0     *dest_obj = instance;
412 0     GlobusSoapMessageDebugExit();
413 0     return result;
414 }
415
416 globus_result_t
417 wsse_PasswordString_copy_contents(
418     wsse_PasswordString * instance,
419     const wsse_PasswordString * src_obj)
420 0 {
421 0     globus_result_t                     result = GLOBUS_SUCCESS;
422 0     GlobusFuncName(wsse_PasswordString_copy_contents);
423
424 0     GlobusSoapMessageDebugEnter();
425
426
427 0     if(src_obj->anyAttributes)
428     {
429 0         result = xsd_anyAttributes_copy(&instance->anyAttributes, 
430                                         src_obj->anyAttributes);
431 0         if(result != GLOBUS_SUCCESS)
432         {
433 0             result = GlobusSoapMessageErrorCopyAnyAttrsFailed(
434                 result, NULL);
435 0             goto xsd_anyAttributes_after_destroy;
436         }
437     }
438     else
439     {
440 0         instance->anyAttributes = NULL;
441     }
442
443 0     if(src_obj->_Id)
444     {
445 0         result = xsd_ID_copy(
446             &instance->_Id,
447             src_obj->_Id);
448 0         if(result != GLOBUS_SUCCESS)
449         {
450 0             result = GlobusSoapMessageErrorCopyFailed(
451                 result, NULL, &xsd_ID_qname);
452 0             goto _Id_destroy;
453         }
454     }
455     else
456     {
457 0         instance->_Id = NULL;
458     }
459
460 0     if(src_obj->_Type)
461     {
462 0         result = xsd_anyURI_copy(
463             &instance->_Type,
464             src_obj->_Type);
465 0         if(result != GLOBUS_SUCCESS)
466         {
467 0             result = GlobusSoapMessageErrorCopyFailed(
468                 result, NULL, &xsd_anyURI_qname);
469 0             goto _Type_destroy;
470         }
471     }
472     else
473     {
474 0         instance->_Type = NULL;
475     }
476
477 0     result = xsd_string_copy_contents(
478         &instance->base_value,
479         &src_obj->base_value);
480 0     if(result != GLOBUS_SUCCESS)
481     {
482 0         result = GlobusSoapMessageErrorCopyFailed(
483             result, NULL,  &xsd_string_qname);
484 0         goto base_value_destroy;
485     }
486
487 0     goto exit;
488
489  fail_deserialize:
490
491  xsd_anyAttributes_destroy:
492 0         xsd_anyAttributes_destroy(instance->anyAttributes);
493 0         instance->anyAttributes = NULL;
494  xsd_anyAttributes_after_destroy:
495 0         xsd_string_destroy_contents(
496             &instance->base_value);
497
498  base_value_destroy:
499
500  _Id_destroy:
501
502 0     if(instance->_Id)
503     {
504 0         xsd_ID_destroy(
505             instance->_Id);
506 0         instance->_Id = NULL;
507     }
508
509  _Type_destroy:
510
511 0     if(instance->_Type)
512     {
513 0         xsd_anyURI_destroy(
514             instance->_Type);
515 0         instance->_Type = NULL;
516     }
517
518
519  exit:
520
521 0     GlobusSoapMessageDebugExit();
522 0     return result;
523 }
524
525
526
527 globus_result_t
528 wsse_PasswordString_serialize_contents(
529     xsd_QName *                         element_qname, /* ignored */
530     wsse_PasswordString * inst,
531     globus_soap_message_handle_t        message_handle,
532     globus_xsd_element_options_t        options)
533 0 {
534 0     globus_result_t                     result = GLOBUS_SUCCESS;
535 0     GlobusFuncName(wsse_PasswordString_serialize_contents);
536 0     GlobusSoapMessageDebugEnter();
537
538 0     result = wsse_PasswordString_serialize(
539         NULL,
540         inst,
541         message_handle,
542         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
543 0     if(result != GLOBUS_SUCCESS)
544     {
545 0         result = GlobusSoapMessageErrorSerializeFailed(
546             result, NULL, element_qname);
547         goto exit;
548     }
549
550  exit:
551
552 0     GlobusSoapMessageDebugExit();
553 0     return result;
554 }
555
556
557
558 globus_result_t
559 wsse_PasswordString_serialize(
560     xsd_QName *                         element_qname,
561     wsse_PasswordString * instance,
562     globus_soap_message_handle_t        message_handle,
563     globus_xsd_element_options_t        options)
564 0 {
565 0     globus_result_t                     result = GLOBUS_SUCCESS;
566 0     xsd_QName                           subelement;
567 0     globus_list_t *                     any_attr_keys = NULL;
568 0     globus_list_t *                     any_attr_keys_iterator = NULL;
569 0     xsd_QName *                         type_attr = NULL;
570 0     char *                              prefix = NULL;
571 0     int                                 prefix_created;
572 0     int                                 define_prefix = 0;
573 0     int                                 save_options = options;
574
575 0     GlobusFuncName(wsse_PasswordString_serialize);
576 0     GlobusSoapMessageDebugEnter();
577
578
579 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
580     {
581         /* serialize wsse_PasswordString element */
582
583 0         result = globus_soap_message_invoke_ns_callouts(
584             message_handle,
585             element_qname,
586             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_SET,
587             &options);
588 0         if(result != GLOBUS_SUCCESS)
589         {
590 0             result = GlobusSoapMessageErrorSerializeFailed(
591                 result, NULL, element_qname);
592 0             goto exit;
593         }
594
595 0 result = globus_soap_message_element_ns_set(
596             message_handle,
597             element_qname->Namespace,
598             &options);
599 0         if(result != GLOBUS_SUCCESS)
600         {
601 0             result = GlobusSoapMessageErrorSerializeFailed(
602                 result, NULL, element_qname);
603 0             goto exit;
604         }
605
606 0         result = xsd_anyAttributes_namespace_set(
607             message_handle, instance->anyAttributes, &options);
608 0         if(result != GLOBUS_SUCCESS)
609         {
610 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
611                 result, "Failed to set namespace");
612 0             goto exit;
613         }
614
615 0         if(instance->_Id)
616         {
617
618 0         result = globus_soap_message_attribute_ns_set(
619             message_handle,
620             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
621              &options);
622
623 0         if(result != GLOBUS_SUCCESS)
624         {
625 0             xsd_QName               error_qname;
626 0             error_qname.local = prefix;
627 0             error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
628 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
629                                                            NULL, 
630                                                            &error_qname);
631 0             goto exit;
632         }
633
634
635         }
636
637 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
638    !globus_soap_message_serialize_is_c14n_subset(message_handle))
639         {
640 0             result = globus_soap_message_attribute_ns_set(
641                 message_handle,
642                 "http://www.w3.org/2001/XMLSchema-instance",
643                 &options);
644 0             if(result != GLOBUS_SUCCESS)
645             {
646 0                 result = GlobusSoapMessageErrorSerializeFailed(
647                     result, NULL, element_qname);
648 0                 goto exit;
649             }
650
651 0             result = globus_soap_message_attribute_ns_set(
652                 message_handle,
653                 wsse_PasswordString_qname.Namespace,
654                 &options);
655 0             if(result != GLOBUS_SUCCESS)
656             {
657 0                 result = GlobusSoapMessageErrorSerializeFailed(
658                     result, NULL, element_qname);
659 0                 goto exit;
660             }
661         }
662
663 0         if(instance->_Type)
664         {
665
666 0         result = globus_soap_message_attribute_ns_set(
667             message_handle,
668             NULL,
669              &options);
670
671 0         if(result != GLOBUS_SUCCESS)
672         {
673 0             xsd_QName               error_qname;
674 0             error_qname.local = prefix;
675 0             error_qname.Namespace = "";
676 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
677                                                            NULL, 
678                                                            &error_qname);
679 0             goto exit;
680         }
681
682
683         }
684
685 0         result = globus_soap_message_invoke_callouts(
686             message_handle,
687             element_qname,
688             GLOBUS_SOAP_MESSAGE_CALLOUT_BEGIN);
689 0         if(result != GLOBUS_SUCCESS)
690         {
691 0             result = GlobusSoapMessageErrorSerializeFailed(
692                 result, NULL, element_qname);
693 0             goto exit;
694         }
695
696 0         result = globus_soap_message_serialize_element(
697             message_handle,
698             element_qname,
699             options,
700             &wsse_PasswordString_qname);
701 0         if(result != GLOBUS_SUCCESS)
702         {
703 0             result = GlobusSoapMessageErrorSerializeFailed(
704                 result, NULL, element_qname);
705 0             goto exit;
706         }
707
708 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
709    !globus_soap_message_serialize_is_c14n_subset(message_handle))
710         {
711 0            xsd_QName_init(&type_attr);
712        
713 0            type_attr->local = globus_libc_strdup("type");
714 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
715         }
716
717         /* serialize namespaces */
718         
719 0 result = globus_soap_message_invoke_ns_callouts(
720             message_handle,
721             element_qname,
722             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_ADD,
723             &options);
724 0         if(result != GLOBUS_SUCCESS)
725         {
726 0             result = GlobusSoapMessageErrorSerializeFailed(
727                 result, NULL, element_qname);
728 0             goto exit;
729         }
730
731 0 result = globus_soap_message_element_ns_add(
732             message_handle,
733             element_qname->Namespace,
734             &options);
735 0         if(result != GLOBUS_SUCCESS)
736         {
737 0             result = GlobusSoapMessageErrorSerializeFailed(
738                 result, NULL, element_qname);
739 0             goto exit;
740         }
741
742 0         result = xsd_anyAttributes_namespace_add(
743             message_handle, instance->anyAttributes, &options);
744 0         if(result != GLOBUS_SUCCESS)
745         {
746 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
747                 result, "Failed to add namespace");
748 0             goto exit;
749         }
750
751 0         if(instance->_Id)
752         {
753
754 0         result = globus_soap_message_attribute_ns_add(
755             message_handle,
756             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
757              &options);
758
759 0         if(result != GLOBUS_SUCCESS)
760         {
761 0             xsd_QName               error_qname;
762 0             error_qname.local = prefix;
763 0             error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
764 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
765                                                            NULL, 
766                                                            &error_qname);
767 0             goto exit;
768         }
769
770
771         }
772
773 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
774    !globus_soap_message_serialize_is_c14n_subset(message_handle))
775         {
776 0             result = globus_soap_message_attribute_ns_add(
777                 message_handle,
778                 "http://www.w3.org/2001/XMLSchema-instance",
779                 &options);
780 0             if(result != GLOBUS_SUCCESS)
781             {
782 0                 result = GlobusSoapMessageErrorSerializeFailed(
783                     result, NULL, element_qname);
784 0                 goto exit;
785             }
786
787 0             result = globus_soap_message_attribute_ns_add(
788                 message_handle,
789                 wsse_PasswordString_qname.Namespace,
790                 &options);
791 0             if(result != GLOBUS_SUCCESS)
792             {
793 0                 result = GlobusSoapMessageErrorSerializeFailed(
794                     result, NULL, element_qname);
795 0                 goto exit;
796             }
797         }
798
799 0         if(instance->_Type)
800         {
801
802 0         result = globus_soap_message_attribute_ns_add(
803             message_handle,
804             NULL,
805              &options);
806
807 0         if(result != GLOBUS_SUCCESS)
808         {
809 0             xsd_QName               error_qname;
810 0             error_qname.local = prefix;
811 0             error_qname.Namespace = "";
812 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
813                                                            NULL, 
814                                                            &error_qname);
815 0             goto exit;
816         }
817
818
819         }
820
821         /* serialize attributes */
822
823 0         if(instance->anyAttributes)
824         {
825 0             any_attr_keys = xsd_anyAttributes_lex_sort(
826                 instance->anyAttributes);
827 0             any_attr_keys_iterator = any_attr_keys;
828         }
829
830 0         subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
831 0         subelement.local = "Id";
832
833 0         if(any_attr_keys_iterator)
834         {
835 0             result = xsd_anyAttributes_serialize_lex_before(
836                 message_handle,
837                 &any_attr_keys_iterator,
838                 instance->anyAttributes,
839                 &subelement);
840 0             if(result != GLOBUS_SUCCESS)
841             {
842 0                 result = GlobusSoapMessageErrorSerializeFailed(result, 
843                                                                NULL, 
844                                                                element_qname);
845 0                 goto exit;
846             }
847         }
848
849 0         if(instance->_Id)
850         {
851
852 0         result = xsd_ID_serialize_attribute(
853             &subelement,
854             instance->_Id,
855             message_handle,
856             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
857 0         if(result != GLOBUS_SUCCESS)
858         {
859 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
860                                                            NULL, 
861                                                            element_qname);
862 0             goto exit;
863         }
864
865         }
866
867 0         if(any_attr_keys_iterator)
868         {
869 0             result = xsd_anyAttributes_serialize_lex_before(
870                 message_handle,
871                 &any_attr_keys_iterator,
872                 instance->anyAttributes,
873                 &subelement);
874 0             if(result != GLOBUS_SUCCESS)
875             {
876 0                 result = GlobusSoapMessageErrorSerializeFailed(result, 
877                                                                NULL, 
878                                                                element_qname);
879 0                 goto exit;
880             }
881         }
882
883 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
884    !globus_soap_message_serialize_is_c14n_subset(message_handle))
885         {
886 0             result = globus_soap_message_serialize_QName_attribute(
887                 message_handle,
888                 type_attr,
889                 &wsse_PasswordString_qname);
890 0             if(result != GLOBUS_SUCCESS)
891             {
892 0                 result = GlobusSoapMessageErrorSerializeFailed(
893                     result, NULL, element_qname);
894 0                 goto exit;
895             }
896         }
897
898 0         subelement.Namespace = "";
899 0         subelement.local = "Type";
900
901 0         if(instance->_Type)
902         {
903
904 0         result = xsd_anyURI_serialize_attribute(
905             &subelement,
906             instance->_Type,
907             message_handle,
908             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
909 0         if(result != GLOBUS_SUCCESS)
910         {
911 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
912                                                            NULL, 
913                                                            element_qname);
914 0             goto exit;
915         }
916
917         }
918
919
920 0         result = globus_soap_message_invoke_callouts(
921             message_handle,
922             element_qname,
923             GLOBUS_SOAP_MESSAGE_CALLOUT_ATTR);
924 0         if(result != GLOBUS_SUCCESS)
925         {
926 0             result = GlobusSoapMessageErrorSerializeFailed(
927                 result, NULL, element_qname);
928 0             goto exit;
929         }
930     }
931
932 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
933     {
934 0         result = globus_soap_message_serialize_element_begin_close(
935             message_handle);
936 0         if(result != GLOBUS_SUCCESS)
937         {
938 0             result = GlobusSoapMessageErrorSerializeFailed(
939                 result, NULL, element_qname);
940 0             goto exit;
941         }
942     }
943 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
944
945     /* serialize contents of type */
946
947 0     subelement.local = "base_value";
948 0     subelement.Namespace = NULL;
949
950 0     result = xsd_string_serialize(
951         &subelement,
952         &instance->base_value,
953         message_handle,
954         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
955 0     if(result != GLOBUS_SUCCESS)
956     {
957 0         result = GlobusSoapMessageErrorSerializeFailed(
958             result, NULL,  &xsd_string_qname);
959 0         goto exit;
960     }
961
962 0     options = save_options;
963
964 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
965     {
966         /* add end element */
967 0         result = globus_soap_message_serialize_element_end(
968             message_handle,
969             element_qname,
970             options,
971             &wsse_PasswordString_qname);
972 0         if(result != GLOBUS_SUCCESS)
973         {
974 0             result = GlobusSoapMessageErrorSerializeFailed(
975                 result, NULL, element_qname);
976 0             goto exit;
977         }
978
979 0         globus_soap_message_element_ns_remove(
980             message_handle,
981             element_qname->Namespace,
982             &options);
983
984     /* remove namespace/prefix mappings for these types */
985
986 0         result = xsd_anyAttributes_namespace_remove(
987             message_handle, instance->anyAttributes, &options);
988 0         if(result != GLOBUS_SUCCESS)
989         {
990 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
991                 result, "Failed to remove namespace");
992 0             goto exit;
993         }
994
995 0         if(instance->_Id)
996         {
997
998 0         globus_soap_message_attribute_ns_remove(
999             message_handle,
1000             "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
1001              &options);
1002
1003         }
1004
1005 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1006    !globus_soap_message_serialize_is_c14n_subset(message_handle))
1007         {
1008 0             globus_soap_message_attribute_ns_remove(
1009                 message_handle,
1010                 "http://www.w3.org/2001/XMLSchema-instance",
1011                 &options);
1012            
1013 0             globus_soap_message_attribute_ns_remove(
1014                 message_handle,
1015                 wsse_PasswordString_qname.Namespace,
1016                 &options);
1017         }           
1018
1019 0         if(instance->_Type)
1020         {
1021
1022 0         globus_soap_message_attribute_ns_remove(
1023             message_handle,
1024             NULL,
1025              &options);
1026
1027         }
1028
1029 0         result = globus_soap_message_invoke_ns_callouts(
1030             message_handle,
1031             element_qname,
1032             GLOBUS_SOAP_MESSAGE_CALLOUT_NS_REMOVE,
1033             &options);
1034 0         if(result != GLOBUS_SUCCESS)
1035         {
1036 0             result  = GlobusSoapMessageErrorSerializeFailed(
1037                 result, NULL, element_qname);
1038 0             goto exit;
1039         }
1040
1041 0         result = globus_soap_message_invoke_callouts(
1042             message_handle,
1043             element_qname,
1044             GLOBUS_SOAP_MESSAGE_CALLOUT_END);
1045 0         if(result != GLOBUS_SUCCESS)
1046         {
1047 0             result = GlobusSoapMessageErrorSerializeFailed(
1048                 result, NULL, element_qname);
1049             goto exit;
1050         }
1051     }
1052
1053  exit:
1054 0     if (type_attr)
1055     {
1056 0         xsd_QName_destroy(type_attr);
1057     }
1058
1059 0     if(any_attr_keys)
1060     {
1061 0         globus_list_free(any_attr_keys);
1062     }
1063
1064 0     GlobusSoapMessageDebugExit();
1065 0     return result;
1066 }
1067
1068
1069
1070 globus_result_t
1071 wsse_PasswordString_deserialize_contents(
1072     xsd_QName *                         element_qname, /* ignored */
1073     wsse_PasswordString * inst,
1074     globus_soap_message_handle_t        message_handle,
1075     globus_xsd_element_options_t        options)
1076 0 {
1077 0     globus_result_t                     result = GLOBUS_SUCCESS;
1078 0     GlobusFuncName(wsse_PasswordString_deserialize_contents);
1079 0     GlobusSoapMessageDebugEnter();
1080
1081 0     result = wsse_PasswordString_deserialize(
1082         NULL,
1083         inst,
1084         message_handle,
1085         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1086 0     if(result != GLOBUS_SUCCESS)
1087     {
1088 0         result = GlobusSoapMessageErrorDeserializeFailed(
1089             result, element_qname);
1090         goto exit;
1091     }
1092
1093  exit:
1094
1095 0     GlobusSoapMessageDebugExit();
1096 0     return result;
1097 }
1098
1099
1100
1101 globus_result_t
1102 wsse_PasswordString_deserialize(
1103     xsd_QName *                         element_qname,
1104     wsse_PasswordString * instance,
1105     globus_soap_message_handle_t        message_handle,
1106     globus_xsd_element_options_t        options)
1107 0 {
1108 0     globus_result_t                     result = GLOBUS_SUCCESS;
1109 0     xsd_QName                           subelement;
1110 0     GlobusFuncName(wsse_PasswordString_deserialize);
1111 0     GlobusSoapMessageDebugEnter();
1112
1113
1114 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1115     {
1116 0         result = globus_soap_message_deserialize_element(
1117             message_handle, element_qname);
1118 0         if(result != GLOBUS_SUCCESS)
1119         {
1120 0             result = GlobusSoapMessageErrorDeserializeFailed(
1121                 result, element_qname);
1122 0             goto exit;
1123         }
1124
1125 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1126 0         if(result != GLOBUS_SUCCESS)
1127         {
1128 0             result = GlobusSoapMessageErrorDeserializeFailed(
1129                 result, element_qname);
1130 0             goto xsd_anyAttributes_after_destroy;
1131         }
1132
1133 0         result = xsd_anyAttributes_deserialize(
1134             message_handle,
1135             instance->anyAttributes);
1136 0         if(result != GLOBUS_SUCCESS)
1137         {
1138 0             result = GlobusSoapMessageErrorDeserializeFailed(
1139                 result, element_qname);
1140 0             goto xsd_anyAttributes_destroy;
1141         }
1142
1143 0     subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
1144 0     subelement.local = "Id";
1145
1146 0     result = xsd_ID_deserialize_attribute_pointer(
1147         &subelement,
1148         &instance->_Id,
1149         message_handle,
1150         0);
1151 0     if(result != GLOBUS_SUCCESS)
1152     {
1153 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1154 0         goto _Id_destroy;
1155     }
1156
1157
1158 0     subelement.Namespace = "";
1159 0     subelement.local = "Type";
1160
1161 0     result = xsd_anyURI_deserialize_attribute_pointer(
1162         &subelement,
1163         &instance->_Type,
1164         message_handle,
1165         0);
1166 0     if(result != GLOBUS_SUCCESS)
1167     {
1168 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1169 0         goto _Type_destroy;
1170     }
1171
1172
1173
1174 0         result = globus_soap_message_deserialize_element_begin_close(
1175             message_handle);
1176 0         if(result != GLOBUS_SUCCESS)
1177         {
1178 0             result = GlobusSoapMessageErrorDeserializeFailed(
1179                 result, element_qname);
1180 0             goto fail_deserialize;
1181         }
1182     }
1183
1184 0     subelement.local = "base_value";
1185 0     subelement.Namespace = NULL;
1186
1187 0     result = xsd_string_deserialize(
1188         &subelement,
1189         &instance->base_value,
1190         message_handle,
1191         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1192 0     if(result != GLOBUS_SUCCESS)
1193     {
1194 0         result = GlobusSoapMessageErrorDeserializeFailed(
1195             result,
1196             &xsd_string_qname);
1197 0         goto base_value_destroy;
1198     }
1199
1200 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1201     {
1202 0         result = globus_soap_message_deserialize_element_end(
1203             message_handle,
1204             element_qname);
1205 0         if(result != GLOBUS_SUCCESS)
1206         {
1207 0             result = GlobusSoapMessageErrorDeserializeFailed(
1208                 result, element_qname);
1209             goto fail_deserialize;
1210         }
1211     }
1212
1213 0     goto exit;
1214
1215  fail_deserialize:
1216
1217  xsd_anyAttributes_destroy:
1218 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1219 0         instance->anyAttributes = NULL;
1220  xsd_anyAttributes_after_destroy:
1221 0         xsd_string_destroy_contents(
1222             &instance->base_value);
1223
1224  base_value_destroy:
1225
1226  _Id_destroy:
1227
1228 0     if(instance->_Id)
1229     {
1230 0         xsd_ID_destroy(
1231             instance->_Id);
1232 0         instance->_Id = NULL;
1233     }
1234
1235  _Type_destroy:
1236
1237 0     if(instance->_Type)
1238     {
1239 0         xsd_anyURI_destroy(
1240             instance->_Type);
1241 0         instance->_Type = NULL;
1242     }
1243
1244
1245  exit:
1246
1247 0     GlobusSoapMessageDebugExit();
1248 0     return result;
1249 }
1250
1251
1252
1253 globus_result_t
1254 wsse_PasswordString_deserialize_pointer(
1255     xsd_QName *                         element_qname,
1256     wsse_PasswordString ** ip,
1257     globus_soap_message_handle_t        message_handle,
1258     globus_xsd_element_options_t        options)
1259 0 {
1260 0     wsse_PasswordString * instance = NULL;
1261 0     globus_result_t                     result = GLOBUS_SUCCESS;
1262 0     xsd_QName                           subelement;
1263 0     int                                 found_attrs = 0;
1264 0     int                                 empty_element = 0;
1265 0     GlobusFuncName(wsse_PasswordString_deserialize_pointer);
1266 0     GlobusSoapMessageDebugEnter();
1267
1268 0     *ip = NULL;
1269
1270 0     result = globus_soap_message_deserialize_element(
1271         message_handle, element_qname);
1272 0     if(result != GLOBUS_SUCCESS &&
1273        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1274         GlobusSoapMessageStatusFailedElementCheck(result) ||
1275         GlobusSoapMessageStatusFailedWithTextCheck(result)))
1276     {
1277 0         *ip = NULL;
1278 0         result = GLOBUS_SUCCESS;
1279 0         goto exit;
1280     }
1281
1282 0     if(result != GLOBUS_SUCCESS)
1283     {
1284 0         result = GlobusSoapMessageErrorDeserializeFailed(
1285             result, element_qname);
1286 0         goto exit;
1287     }
1288
1289 0     if(globus_soap_message_deserialize_element_is_empty(
1290            message_handle))
1291     {
1292 0         empty_element = 1;
1293     }
1294
1295
1296
1297 0     result = wsse_PasswordString_init(&instance);
1298 0     if(result != GLOBUS_SUCCESS)
1299     {
1300 0         result = GlobusSoapMessageErrorDeserializeFailed(
1301             result, element_qname);
1302 0         goto exit;
1303     }
1304
1305
1306 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1307 0         if(result != GLOBUS_SUCCESS)
1308         {
1309 0             result = GlobusSoapMessageErrorDeserializeFailed(
1310                 result, element_qname);
1311 0             goto xsd_anyAttributes_after_destroy;
1312         }
1313
1314 0         result = xsd_anyAttributes_deserialize(
1315             message_handle,
1316             instance->anyAttributes);
1317 0         if(result != GLOBUS_SUCCESS)
1318         {
1319 0             result = GlobusSoapMessageErrorDeserializeFailed(
1320                 result, element_qname);
1321 0             goto xsd_anyAttributes_destroy;
1322         }
1323
1324 0         if(instance->anyAttributes &&
1325            xsd_anyAttributes_size(instance->anyAttributes) > 0)
1326         {
1327 0             found_attrs++;
1328         }
1329
1330 0     subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
1331 0     subelement.local = "Id";
1332
1333 0     result = xsd_ID_deserialize_attribute_pointer(
1334         &subelement,
1335         &instance->_Id,
1336         message_handle,
1337         0);
1338 0     if(result != GLOBUS_SUCCESS)
1339     {
1340 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1341 0         goto _Id_destroy;
1342     }
1343
1344
1345 0     if(instance->_Id)
1346     {
1347 0         found_attrs++;
1348     }
1349
1350 0     subelement.Namespace = "";
1351 0     subelement.local = "Type";
1352
1353 0     result = xsd_anyURI_deserialize_attribute_pointer(
1354         &subelement,
1355         &instance->_Type,
1356         message_handle,
1357         0);
1358 0     if(result != GLOBUS_SUCCESS)
1359     {
1360 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1361 0         goto _Type_destroy;
1362     }
1363
1364
1365 0     if(instance->_Type)
1366     {
1367 0         found_attrs++;
1368     }
1369
1370
1371 0     if(empty_element)
1372     {
1373 0         result = globus_soap_message_deserialize_element_end(
1374             message_handle,
1375             element_qname);
1376 0         if(result != GLOBUS_SUCCESS)
1377         {
1378 0             result = GlobusSoapMessageErrorDeserializeFailed(
1379                 result, element_qname);
1380 0             goto fail_deserialize;
1381         }
1382
1383 0         *ip = instance;
1384 0         goto exit;
1385     }
1386
1387 0     result = globus_soap_message_deserialize_element_begin_close(
1388         message_handle);
1389 0     if(result != GLOBUS_SUCCESS)
1390     {
1391 0         result = GlobusSoapMessageErrorDeserializeFailed(
1392             result, element_qname);
1393 0         goto exit;
1394     }
1395
1396
1397 0     subelement.local = "base_value";
1398 0     subelement.Namespace = NULL;
1399
1400 0     result = xsd_string_deserialize(
1401         &subelement,
1402         &instance->base_value,
1403         message_handle,
1404         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1405 0     if(result != GLOBUS_SUCCESS)
1406     {
1407 0         result = GlobusSoapMessageErrorDeserializeFailed(
1408             result,
1409             &xsd_string_qname);
1410 0         goto base_value_destroy;
1411     }
1412
1413
1414 0     result = globus_soap_message_deserialize_element_end(
1415         message_handle,
1416         element_qname);
1417 0     if(result != GLOBUS_SUCCESS)
1418     {
1419 0         result = GlobusSoapMessageErrorDeserializeFailed(
1420             result, element_qname);
1421 0         goto fail_deserialize;
1422     }
1423
1424 0     *ip = instance;
1425
1426 0     goto exit;
1427
1428  fail_deserialize:
1429
1430  xsd_anyAttributes_destroy:
1431 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1432 0         instance->anyAttributes = NULL;
1433  xsd_anyAttributes_after_destroy:
1434 0         xsd_string_destroy_contents(
1435             &instance->base_value);
1436
1437  base_value_destroy:
1438
1439  _Id_destroy:
1440
1441 0     if(instance->_Id)
1442     {
1443 0         xsd_ID_destroy(
1444             instance->_Id);
1445 0         instance->_Id = NULL;
1446     }
1447
1448  _Type_destroy:
1449
1450 0     if(instance->_Type)
1451     {
1452 0         xsd_anyURI_destroy(
1453             instance->_Type);
1454 0         instance->_Type = NULL;
1455     }
1456
1457  exit:
1458
1459 0     GlobusSoapMessageDebugExit();
1460 0     return result;
1461 }
1462
1463
1464 globus_result_t
1465 wsse_PasswordString_array_init_contents(
1466     wsse_PasswordString_array * array)
1467 0 {
1468 0     GlobusFuncName(wsse_PasswordString_array_init_contents);
1469 0     GlobusSoapMessageDebugEnter();
1470
1471 0     memset(array, 0, sizeof(wsse_PasswordString_array));
1472
1473 0     GlobusSoapMessageDebugExit();
1474 0     return GLOBUS_SUCCESS;
1475 }
1476
1477 globus_result_t
1478 wsse_PasswordString_array_init(
1479     wsse_PasswordString_array ** arr)
1480 0 {
1481 0     wsse_PasswordString_array * array;
1482 0     globus_result_t                     result;
1483 0     GlobusFuncName(wsse_PasswordString_array_init);
1484 0     GlobusSoapMessageDebugEnter();
1485
1486 0     array = (wsse_PasswordString_array *)
1487         globus_malloc(sizeof(wsse_PasswordString_array));
1488 0     if(!array)
1489     {
1490 0         result = GlobusSoapMessageErrorOutOfMemory;
1491 0         goto exit;
1492     }
1493
1494 0     result = wsse_PasswordString_array_init_contents(array);
1495 0     if(result != GLOBUS_SUCCESS)
1496     {
1497 0         globus_free(array);
1498 0         array = NULL;
1499
1500     }
1501
1502 0     *arr = array;
1503
1504  exit:
1505 0     GlobusSoapMessageDebugExit();
1506 0     return result;
1507 }
1508
1509 void
1510 wsse_PasswordString_array_destroy_contents(
1511     wsse_PasswordString_array * array)
1512 0 {
1513 0     int                                 i = 0;
1514 0     GlobusFuncName(wsse_PasswordString_array_destroy_contents);
1515 0     GlobusSoapMessageDebugEnter();
1516
1517 0     for(; i < array->length; ++i)
1518     {
1519 0         wsse_PasswordString_destroy_contents(&array->elements[i]);
1520     }
1521
1522 0     if(array->elements)
1523     {
1524 0         globus_free(array->elements);
1525 0         array->elements = NULL;
1526     }
1527 0     array->length = 0;
1528
1529 0     GlobusSoapMessageDebugExit();
1530 }
1531
1532 void
1533 wsse_PasswordString_array_destroy(
1534     wsse_PasswordString_array * array)
1535 0 {
1536 0     GlobusFuncName(wsse_PasswordString_array_destroy);
1537 0     GlobusSoapMessageDebugEnter();
1538
1539 0     wsse_PasswordString_array_destroy_contents(array);
1540 0     globus_free(array);
1541
1542 0     GlobusSoapMessageDebugExit();
1543 }
1544
1545 globus_result_t
1546 wsse_PasswordString_array_copy(
1547     wsse_PasswordString_array ** dest_arr,
1548     const wsse_PasswordString_array * src_arr)
1549 0 {
1550 0     wsse_PasswordString_array * array;
1551 0     globus_result_t                     result;
1552 0     GlobusFuncName(wsse_PasswordString_array_copy);
1553 0     GlobusSoapMessageDebugEnter();
1554
1555 0     array = (wsse_PasswordString_array *) globus_malloc(
1556         sizeof(wsse_PasswordString_array));
1557 0     if(!array)
1558     {
1559 0         result = GlobusSoapMessageErrorOutOfMemory;
1560 0         GlobusSoapMessageDebugExit();
1561 0         return result;
1562     }
1563
1564 0     result = wsse_PasswordString_array_copy_contents(array, src_arr);
1565 0     if(result != GLOBUS_SUCCESS)
1566     {
1567 0         globus_free(array);
1568 0         GlobusSoapMessageDebugExit();
1569 0         return result;
1570     }
1571
1572 0     *dest_arr = array;
1573
1574 0     GlobusSoapMessageDebugExit();
1575 0     return GLOBUS_SUCCESS;
1576 }
1577
1578 globus_result_t
1579 wsse_PasswordString_array_copy_contents(
1580     wsse_PasswordString_array * dest_arr,
1581     const wsse_PasswordString_array * src_arr)
1582 0 {
1583 0     int                                 i;
1584 0     globus_result_t                     result = GLOBUS_SUCCESS;
1585 0     GlobusFuncName(wsse_PasswordString_array_copy_contents);
1586 0     GlobusSoapMessageDebugEnter();
1587
1588 0     dest_arr->length = src_arr->length;
1589 0     if(dest_arr->length > 0)
1590     {
1591 0         dest_arr->elements = (wsse_PasswordString *) malloc(
1592             sizeof(wsse_PasswordString) * dest_arr->length);
1593 0         if(!dest_arr->elements)
1594         {
1595 0             result = GlobusSoapMessageErrorOutOfMemory;
1596 0             GlobusSoapMessageDebugExit();
1597 0             return result;
1598         }
1599     }
1600     else
1601     {
1602 0         dest_arr->elements = NULL;
1603     }
1604     
1605 0     for(i = 0; i < dest_arr->length; i++)
1606     {
1607 0         result = wsse_PasswordString_copy_contents(
1608             &dest_arr->elements[i], &src_arr->elements[i]);
1609 0         if(result != GLOBUS_SUCCESS)
1610         {
1611 0             while(i--)
1612             {
1613 0                 wsse_PasswordString_destroy_contents(&dest_arr->elements[i]);
1614             }
1615
1616 0             globus_free(dest_arr->elements);
1617 0             dest_arr->elements = NULL;
1618 0             dest_arr->length = 0;
1619 0             break;
1620         }
1621     }
1622
1623 0     GlobusSoapMessageDebugExit();
1624 0     return result;
1625 }
1626
1627 wsse_PasswordString *
1628 wsse_PasswordString_array_push(
1629     wsse_PasswordString_array * array)
1630 0 {
1631 0     GlobusFuncName(wsse_PasswordString_array_push);
1632 0     GlobusSoapMessageDebugEnter();
1633
1634 0     array->elements = realloc(array->elements,
1635                               sizeof(wsse_PasswordString) *
1636                               (array->length + 1));
1637 0     memset(&array->elements[array->length], 0, sizeof(wsse_PasswordString));
1638 0     array->length++;
1639
1640 0     GlobusSoapMessageDebugExit();
1641 0     return (&array->elements[array->length - 1]);
1642 }
1643
1644 void *
1645 wsse_PasswordString_array_push_wrapper(
1646     void * array)
1647 0 {
1648 0     return (void *) wsse_PasswordString_array_push((wsse_PasswordString_array *) array);
1649 }
1650
1651 globus_result_t
1652 wsse_PasswordString_array_serialize(
1653     xsd_QName *                         element_qname,
1654     wsse_PasswordString_array * array,
1655     globus_soap_message_handle_t        message,
1656     globus_xsd_element_options_t        options)
1657 0 {
1658 0     globus_result_t                     result = GLOBUS_SUCCESS;
1659 0     int                                 i = 0;
1660 0     GlobusFuncName(wsse_PasswordString_array_serialize);
1661 0     GlobusSoapMessageDebugEnter();
1662
1663 0     for(; i < array->length; ++i)
1664     {
1665 0         result = wsse_PasswordString_serialize(
1666             element_qname,
1667             &array->elements[i],
1668             message,
1669             options);
1670 0         if(result != GLOBUS_SUCCESS)
1671         {
1672 0             goto exit;
1673         }
1674     }
1675
1676 exit:
1677
1678 0     GlobusSoapMessageDebugExit();
1679 0     return result;
1680 }
1681
1682 globus_result_t
1683 wsse_PasswordString_array_deserialize(
1684     xsd_QName *                         element_qname,
1685     wsse_PasswordString_array * array,
1686     globus_soap_message_handle_t        message,
1687     globus_xsd_element_options_t        options)
1688 0 {
1689 0     globus_result_t                     result = GLOBUS_SUCCESS;
1690 0     int                                 i = 0;
1691 0     int                                 pre_length;
1692 0     GlobusFuncName(wsse_PasswordString_array_deserialize);
1693 0     GlobusSoapMessageDebugEnter();
1694
1695 0     pre_length = array->length;
1696
1697 0     for(i = 0; i < pre_length; ++i)
1698     {
1699 0         result = wsse_PasswordString_deserialize(
1700             element_qname,
1701             &array->elements[i],
1702             message,
1703             options);
1704 0         if(result != GLOBUS_SUCCESS)
1705         {
1706 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1707                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1708                GlobusSoapMessageStatusFailedWithTextCheck(result))
1709             {
1710 0                 result = GLOBUS_SUCCESS;
1711 0                 break;
1712             }
1713
1714 0             result = GlobusSoapMessageErrorDeserializeFailed(
1715                 result, element_qname);
1716 0             goto exit;
1717         }
1718     }
1719
1720 0     while(result == GLOBUS_SUCCESS)
1721     {
1722 0         wsse_PasswordString                  next;
1723 0         memset(&next, 0, sizeof(wsse_PasswordString));
1724
1725 0         result = wsse_PasswordString_deserialize(
1726             element_qname,
1727             &next,
1728             message,
1729             options);
1730 0         if(result != GLOBUS_SUCCESS)
1731         {
1732 0             if(GlobusSoapMessageStatusFailedElementCheck(result) ||
1733                GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1734                GlobusSoapMessageStatusFailedWithTextCheck(result))
1735             {
1736 0                 result = GLOBUS_SUCCESS;
1737 0                 break;
1738             }
1739
1740 0             result = GlobusSoapMessageErrorDeserializeFailed(
1741                 result, element_qname);
1742 0             goto exit;
1743         }
1744
1745 0         array->elements = realloc(
1746             array->elements,
1747             (array->length + 1) * sizeof(wsse_PasswordString));
1748 0         if(!array->elements)
1749         {
1750 0             result = GlobusSoapMessageErrorOutOfMemory;
1751 0             goto exit;
1752         }
1753 0         array->elements[array->length] = next;
1754 0         array->length++;
1755 0         ++i;
1756     }
1757
1758   exit:
1759
1760 0     if(result != GLOBUS_SUCCESS)
1761     {
1762 0         int                             di = 0;
1763 0         for(; di < i; ++di)
1764         {
1765 0             wsse_PasswordString_destroy_contents(
1766                 &array->elements[di]);
1767 0             memset(&array->elements[di], 0, sizeof(wsse_PasswordString));
1768         }
1769     }
1770
1771 0     GlobusSoapMessageDebugExit();
1772 0     return result;