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