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