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