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