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