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