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