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