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 from source-type-builtin.tmpl
20 */
21
22 #include "globus_common.h"
23 #include "globus_xsd_types.h"
24 #include "globus_soap_message.h"
25 #include "globus_xsd_type_info.h"
26 #include "xsd_QName.h"
27 #include "globus_xsd_generic.h"
28 #include "globus_xsd_generic_array.h"
29 #include "globus_i_soap_message.h"
30 #include "xsd_QName.h"
31 #include "libxml/schemasInternals.h"
32 #include "libxml/xmlschemastypes.h"
33
34 /**
35 * QName of the xsd_QName builtin type
36 * @ingroup xsd_QName
37 */
38 xsd_QName xsd_QName_qname =
39 {
40 "http://www.w3.org/2001/XMLSchema",
41 "QName"
42
43 };
44
45 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
46 static
47 globus_result_t
48 xsd_QName_serialize_wrapper(
49 const xsd_QName * element_qname,
50 const void * instance,
51 globus_soap_message_handle_t message_handle,
52 globus_xsd_element_options_t options)
53 2626867 {
54 2626867 return xsd_QName_serialize(
55 element_qname,
56 (xsd_QName *) instance,
57 message_handle, options);
58 }
59 /* xsd_QName_serialize_wrapper() */
60
61 static
62 globus_result_t
63 xsd_QName_deserialize_pointer_wrapper(
64 const xsd_QName * element_qname,
65 void ** ip,
66 globus_soap_message_handle_t message_handle,
67 globus_xsd_element_options_t options)
68 2180328 {
69 2180328 return xsd_QName_deserialize_pointer(
70 element_qname,
71 (xsd_QName **) ip,
72 message_handle, options);
73 }
74 /* xsd_QName_deserialize_pointer_wrapper() */
75
76 static
77 globus_result_t
78 xsd_QName_init_wrapper(void **object)
79 2180340 {
80 2180340 return xsd_QName_init(
81 (xsd_QName **) object);
82 }
83 /* xsd_QName_init_wrapper() */
84
85 static
86 void
87 xsd_QName_destroy_wrapper(
88 void * object)
89 2191138 {
90 2191138 xsd_QName_destroy(
91 (xsd_QName *) object);
92 2191138 }
93 /* xsd_QName_destroy_wrapper() */
94
95 static
96 globus_result_t
97 xsd_QName_copy_wrapper(
98 void ** dest_obj,
99 const void * src_obj)
100 10818 {
101 10818 return xsd_QName_copy(
102 (xsd_QName **) dest_obj,
103 (const xsd_QName *) src_obj);
104 }
105 /* xsd_QName_copy_wrapper() */
106
107 static
108 globus_result_t
109 xsd_QName_init_contents_wrapper(void *object)
110 0 {
111 0 return xsd_QName_init_contents(
112 (xsd_QName *) object);
113 }
114 /* xsd_QName_init_contents_wrapper() */
115
116 static
117 void
118 xsd_QName_destroy_contents_wrapper(
119 void * object)
120 7065387 {
121 7065387 xsd_QName_destroy_contents(
122 (xsd_QName *) object);
123 7065387 }
124 /* xsd_QName_destroy_contents_wrapper() */
125
126 static
127 globus_result_t
128 xsd_QName_copy_contents_wrapper(
129 void * dest_obj,
130 const void * src_obj)
131 6987200 {
132 6987200 return xsd_QName_copy_contents(
133 (xsd_QName *) dest_obj,
134 (const xsd_QName *) src_obj);
135 }
136 /* xsd_QName_copy_contents_wrapper() */
137
138 static
139 globus_result_t
140 xsd_QName_serialize_contents_wrapper(
141 const xsd_QName * element_qname,
142 const void * instance,
143 globus_soap_message_handle_t message_handle,
144 globus_xsd_element_options_t options)
145 0 {
146 0 return xsd_QName_serialize_contents(
147 element_qname,
148 (xsd_QName *) instance,
149 message_handle, options);
150 }
151 /* xsd_QName_serialize_contents_wrapper() */
152
153 static
154 globus_result_t
155 xsd_QName_deserialize_contents_wrapper(
156 const xsd_QName * element_qname,
157 void ** instance,
158 globus_soap_message_handle_t message_handle,
159 globus_xsd_element_options_t options)
160 2182687 {
161 globus_result_t result;
162 2182687 globus_bool_t allocated = GLOBUS_FALSE;
163 GlobusFuncName(xsd_QName_deserialize_contents_wrapper);
164 2182687 GlobusSoapMessageDebugEnter();
165
166 2182687 if(!*instance)
167 {
168 9 result = xsd_QName_init(
169 (xsd_QName **)instance);
170 9 if(result != GLOBUS_SUCCESS)
171 {
172 0 goto error;
173 }
174 9 allocated = GLOBUS_TRUE;
175 }
176
177 2182687 result = xsd_QName_deserialize_contents(
178 element_qname,
179 *(xsd_QName **)instance,
180 message_handle, options);
181 2182687 error:
182 2182687 if (result != GLOBUS_SUCCESS && allocated)
183 {
184 0 xsd_QName_destroy(*(xsd_QName **)instance);
185 0 *instance = NULL;
186 }
187 2182687 GlobusSoapMessageDebugExit();
188 2182687 return result;
189 }
190 /* xsd_QName_deserialize_contents_wrapper() */
191
192 static
193 globus_result_t
194 xsd_QName_array_serialize_wrapper(
195 const xsd_QName * element,
196 const void * instance,
197 globus_soap_message_handle_t message,
198 globus_xsd_element_options_t options)
199 0 {
200 0 return xsd_QName_array_serialize(
201 element,
202 (xsd_QName_array *) instance,
203 message, options);
204 }
205 /* xsd_QName_array_serialize_wrapper() */
206
207 static
208 globus_result_t
209 xsd_QName_array_deserialize_wrapper(
210 const xsd_QName * element_qname,
211 void ** inst,
212 globus_soap_message_handle_t message,
213 globus_xsd_element_options_t options)
214 0 {
215 0 globus_bool_t allocated = GLOBUS_FALSE;
216
217 globus_result_t result;
218 0 if(!*inst)
219 {
220 0 result = xsd_QName_array_init(
221 (xsd_QName_array **)inst);
222 0 if(result != GLOBUS_SUCCESS)
223 {
224 0 return result;
225 }
226 0 allocated = GLOBUS_TRUE;
227 }
228
229 0 result = xsd_QName_array_deserialize(
230 element_qname,
231 *(xsd_QName_array **) inst,
232 message, options);
233 0 if (result != GLOBUS_SUCCESS && allocated)
234 {
235 0 xsd_QName_array_destroy(*(xsd_QName_array **) inst);
236 0 *inst = NULL;
237 }
238 0 return result;
239 }
240 /* xsd_QName_array_deserialize_wrapper() */
241
242 static
243 globus_result_t
244 xsd_QName_array_init_wrapper(
245 void ** arr)
246 0 {
247 0 return xsd_QName_array_init(
248 (xsd_QName_array **) arr);
249 }
250 /* xsd_QName_array_init_wrapper() */
251
252 static
253 void
254 xsd_QName_array_destroy_wrapper(
255 void * arr)
256 0 {
257 0 xsd_QName_array_destroy(
258 (xsd_QName_array *) arr);
259 0 }
260 /* xsd_QName_array_destroy_wrapper() */
261
262 static
263 globus_result_t
264 xsd_QName_array_copy_wrapper(
265 void ** dest_arr,
266 const void * src_arr)
267 0 {
268 0 return xsd_QName_array_copy(
269 (xsd_QName_array **) dest_arr,
270 (const xsd_QName_array *) src_arr);
271 }
272 /* xsd_QName_array_copy_wrapper() */
273
274 static
275 globus_result_t
276 xsd_QName_array_init_contents_wrapper(
277 void * arr)
278 0 {
279 0 return xsd_QName_array_init_contents(
280 (xsd_QName_array *) arr);
281 }
282 /* xsd_QName_array_init_contents_wrapper() */
283
284 static
285 void
286 xsd_QName_array_destroy_contents_wrapper(
287 void * arr)
288 370 {
289 370 xsd_QName_array_destroy_contents(
290 (xsd_QName_array *) arr);
291 370 }
292 /* xsd_QName_array_destroy_contents_wrapper() */
293
294 static
295 globus_result_t
296 xsd_QName_array_copy_contents_wrapper(
297 void * dest_arr,
298 const void * src_arr)
299 0 {
300 0 return xsd_QName_array_copy_contents(
301 (xsd_QName_array *) dest_arr,
302 (const xsd_QName_array *) src_arr);
303 }
304 /* xsd_QName_array_copy_contents_wrapper() */
305
306 static
307 void *
308 xsd_QName_array_push_wrapper(
309 void * array)
310 2180328 {
311 2180328 return (void *) xsd_QName_array_push((xsd_QName_array *) array);
312 }
313 /* xsd_QName_array_push_wrapper() */
314 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
315
316 /**
317 * Type info for xsd_QName
318 * @ingroup xsd_QName
319 * This type info is used when serializing/deserializing an xsd:any
320 * which contains array values of this type.
321 */
322 struct globus_xsd_type_info_s xsd_QName_array_info =
323 {
324 &xsd_QName_qname,
325 xsd_QName_array_serialize_wrapper,
326 xsd_QName_array_deserialize_wrapper,
327 xsd_QName_array_init_wrapper,
328 xsd_QName_array_destroy_wrapper,
329 xsd_QName_array_copy_wrapper,
330 xsd_QName_array_init_contents_wrapper,
331 xsd_QName_array_destroy_contents_wrapper,
332 xsd_QName_array_copy_contents_wrapper,
333 sizeof(xsd_QName),
334 xsd_QName_array_push_wrapper,
335 NULL,
336 NULL
337 };
338
339 /**
340 * Type info for xsd_QName
341 * @ingroup xsd_QName
342 * This type info is used when serializing/deserializing an xsd:anyType
343 * which contains values of this type.
344 */
345 struct globus_xsd_type_info_s xsd_QName_contents_info =
346 {
347 &xsd_QName_qname,
348 xsd_QName_serialize_contents_wrapper,
349 xsd_QName_deserialize_contents_wrapper,
350 xsd_QName_init_wrapper,
351 xsd_QName_destroy_wrapper,
352 xsd_QName_copy_wrapper,
353 xsd_QName_init_contents_wrapper,
354 xsd_QName_destroy_contents_wrapper,
355 xsd_QName_copy_contents_wrapper,
356 sizeof(xsd_QName),
357 NULL,
358 NULL,
359 NULL
360 };
361
362 /**
363 * Type info for xsd_QName
364 * @ingroup xsd_QName
365 * This type info is used when serializing/deserializing an xsd:any
366 * which contains values of this type.
367 */
368 struct globus_xsd_type_info_s xsd_QName_info =
369 {
370 &xsd_QName_qname,
371 xsd_QName_serialize_wrapper,
372 xsd_QName_deserialize_pointer_wrapper,
373 xsd_QName_init_wrapper,
374 xsd_QName_destroy_wrapper,
375 xsd_QName_copy_wrapper,
376 xsd_QName_init_contents_wrapper,
377 xsd_QName_destroy_contents_wrapper,
378 xsd_QName_copy_contents_wrapper,
379 sizeof(xsd_QName),
380 NULL,
381 &xsd_QName_contents_info,
382 &xsd_QName_array_info
383 };
384
385
386 /**
387 * Initialize the contents of a xsd_QName
388 * @ingroup xsd_QName
389 *
390 * Initialize the contents of a xsd_QName. This should be used
391 * when the structure is allocated on the stack or by a some allocator besides
392 * xsd_QName_init(). The contents may be freed
393 * by calling xsd_QName_destroy_contents().
394 *
395 * @param instance
396 * Pointer to an allocated but uninitialized xsd_QName.
397 */
398 globus_result_t
399 xsd_QName_init_contents(
400 xsd_QName * instance)
401 5010268 {
402 5010268 globus_result_t result = GLOBUS_SUCCESS;
403 GlobusFuncName(xsd_QName_init_contents);
404 5010268 GlobusSoapMessageDebugEnter();
405
406 5010268 memset(instance, 0, sizeof(xsd_QName));
407
408 5010268 GlobusSoapMessageDebugExit();
409 5010268 return result;
410 }
411
412
413
414 /**
415 * Initialize a xsd_QName
416 * @ingroup xsd_QName
417 *
418 * Allocates a new xsd_QName and initializes its contents. When the
419 * structure is no longer needed, it should be freed by calling
420 * xsd_QName_destroy().
421 *
422 * @param object
423 * Pointer to set to a newly allocated instance.
424 */
425 globus_result_t
426 xsd_QName_init(
427 xsd_QName ** object)
428 5006755 {
429 5006755 globus_result_t result = GLOBUS_SUCCESS;
430 GlobusFuncName(xsd_QName_init);
431 5006755 GlobusSoapMessageDebugEnter();
432
433 5006755 *object = malloc(sizeof(xsd_QName));
434 5006755 if (*object == NULL)
435 {
436 0 result = GlobusSoapMessageErrorOutOfMemory;
437
438 0 goto exit;
439 }
440 5006755 result = xsd_QName_init_contents(*object);
441 5006755 if (result != GLOBUS_SUCCESS)
442 {
443 0 free(*object);
444 0 *object = NULL;
445 }
446 5006755 exit:
447 5006755 GlobusSoapMessageDebugExit();
448 5006755 return result;
449 }
450 /* xsd_QName_init() */
451
452
453
454 /**
455 * Destroy a xsd_QName
456 * @ingroup xsd_QName
457 *
458 * Frees a xsd_QName.
459 *
460 * @param instance
461 * Pointer to the instance to destroy.
462 */
463 void
464 xsd_QName_destroy(
465 xsd_QName * instance)
466 9937021 {
467 GlobusFuncName(xsd_QName_destroy);
468 9937021 GlobusSoapMessageDebugEnter();
469
470 9937021 if(!instance)
471 {
472 617 goto exit;
473 }
474
475 9936404 xsd_QName_destroy_contents(instance);
476 9936404 free(instance);
477
478 9937021 exit:
479
480 9937021 GlobusSoapMessageDebugExit();
481 9937021 }
482 /* xsd_QName_destroy() */
483
484
485
486
487
488
489 /**
490 * Copy a xsd_QName
491 * @ingroup xsd_QName
492 *
493 * Perform a copy of a xsd_QName.
494 * The @a dest_obj will be allocated, and then a copy of the contents
495 * of @a src to it. The caller is responsible for destroying @a dest_objb
496 *
497 * @param dest_obj
498 * The xsd_QName to be initialized with a copy of the
499 * contents of the @a src_obj structure.
500 * @param src_obj
501 * Source xsd_QName to be copied.
502 */
503 globus_result_t
504 xsd_QName_copy(
505 xsd_QName ** dest_obj,
506 const xsd_QName * src_obj)
507 5085183 {
508 5085183 globus_result_t result = GLOBUS_SUCCESS;
509 xsd_QName * instance;
510 GlobusFuncName(xsd_QName_copy);
511
512 5085183 GlobusSoapMessageDebugEnter();
513
514 5085183 instance = malloc(sizeof(xsd_QName));
515 5085183 if (instance == NULL)
516 {
517 0 GlobusSoapMessageDebugExit();
518 0 return GlobusSoapMessageErrorOutOfMemory;
519 }
520
521 5085183 result = xsd_QName_copy_contents(instance, src_obj);
522 5085183 if(result != GLOBUS_SUCCESS)
523 {
524 0 free(instance);
525 0 instance = NULL;
526 0 result = GlobusSoapMessageErrorOutOfMemory;
527 }
528
529 5085183 *dest_obj = instance;
530 5085183 GlobusSoapMessageDebugExit();
531 5085183 return result;
532 }
533 /* xsd_QName_copy() */
534
535
536
537
538 /**
539 * @fn globus_result_t xsd_QName_serialize_contents(const xsd_QName *element_qname, const xsd_QName * inst, globus_soap_message_handle_t message_handle, globus_xsd_element_options_t options)
540 * Serialize the contents of a xsd_QName
541 * @ingroup xsd_QName
542 * Serialize a xsd_QName without an enclosing element.
543 *
544 * @param element_qname
545 * Ignored parameter.
546 * @param inst
547 * The xsd_QName to serialize.
548 * @param message_handle
549 * The handle to serialize the contents on.
550 * @param options
551 * Serialization options.
552 */
553
554 globus_result_t
555 xsd_QName_serialize_contents(
556 const xsd_QName * element_qname, /* ignored */
557 const xsd_QName * inst,
558 globus_soap_message_handle_t message_handle,
559 globus_xsd_element_options_t options)
560 2627719 {
561 2627719 globus_result_t result = GLOBUS_SUCCESS;
562 GlobusFuncName(xsd_QName_serialize_contents);
563 2627719 GlobusSoapMessageDebugEnter();
564
565
566 2627719 result = globus_soap_message_serialize_QName(
567 message_handle,
568 inst);
569 2627719 if(result != GLOBUS_SUCCESS)
570 {
571 0 result = GlobusSoapMessageErrorSerializeFailed(
572 result, NULL, element_qname);
573 }
574
575
576 2627719 GlobusSoapMessageDebugExit();
577 2627719 return result;
578 }
579 /* xsd_QName_serialize_contents() */
580
581
582
583
584
585 globus_result_t
586 xsd_QName_deserialize_contents(
587 const xsd_QName * element_qname, /* ignored */
588 xsd_QName * inst,
589 globus_soap_message_handle_t message_handle,
590 globus_xsd_element_options_t options)
591 2182687 {
592 2182687 globus_result_t result = GLOBUS_SUCCESS;
593 GlobusFuncName(xsd_QName_deserialize_contents);
594 2182687 GlobusSoapMessageDebugEnter();
595
596
597 2182687 if (options & GLOBUS_XSD_ELEMENT_ATTRIBUTE)
598 {
599 0 result = globus_soap_message_deserialize_QName_attribute(
600 message_handle, element_qname, inst);
601 }
602 else
603 {
604 2182687 result = globus_soap_message_deserialize_QName(
605 message_handle, inst);
606 }
607
608
609 2182687 GlobusSoapMessageDebugExit();
610 2182687 return result;
611 }
612 /* xsd_QName_deserialize_contents() */
613
614
615
616 globus_result_t
617 xsd_QName_deserialize(
618 const xsd_QName * element_qname,
619 xsd_QName * instance,
620 globus_soap_message_handle_t message_handle,
621 globus_xsd_element_options_t options)
622 2338 {
623 2338 globus_result_t result = GLOBUS_SUCCESS;
624 GlobusFuncName(xsd_QName_deserialize);
625 2338 GlobusSoapMessageDebugEnter();
626
627 2338 result = globus_xsd_generic_deserialize(
628 element_qname,
629 &xsd_QName_info,
630 (void **) &instance,
631 message_handle,
632 options);
633
634 2338 GlobusSoapMessageDebugExit();
635 2338 return result;
636 }
637 /* xsd_QName_deserialize() */
638
639 globus_result_t
640 xsd_QName_deserialize_pointer(
641 const xsd_QName * element_qname,
642 xsd_QName ** ip,
643 globus_soap_message_handle_t message_handle,
644 globus_xsd_element_options_t options)
645 2180462 {
646 2180462 globus_result_t result = GLOBUS_SUCCESS;
647 GlobusFuncName(xsd_QName_deserialize_pointer);
648 2180462 GlobusSoapMessageDebugEnter();
649
650 2180462 result = globus_xsd_generic_deserialize_pointer(
651 element_qname,
652 &xsd_QName_info,
653 (void **)ip,
654 message_handle,
655 options);
656
657 2180462 return result;
658 }
659 /* xsd_QName_deserialize_pointer() */
660
661
662
663 globus_result_t
664 xsd_QName_array_init_contents(
665 xsd_QName_array * array)
666 0 {
667 GlobusFuncName(xsd_QName_array_init_contents);
668 0 GlobusSoapMessageDebugEnter();
669
670 0 array->elements = NULL;
671 0 array->length = 0;
672 0 array->type_info = &xsd_QName_info;
673
674 0 GlobusSoapMessageDebugExit();
675 0 return GLOBUS_SUCCESS;
676 }
677 /* xsd_QName_array_init_contents() */
678
679
680
681 globus_result_t
682 xsd_QName_array_init(
683 xsd_QName_array ** arr)
684 390 {
685 390 return globus_xsd_generic_array_init(
686 (globus_xsd_generic_array_t **) arr,
687 &xsd_QName_info);
688 }
689 /* xsd_QName_array_init() */
690
691
692
693 void
694 xsd_QName_array_destroy_contents(
695 xsd_QName_array * array)
696 26366 {
697 26366 globus_xsd_generic_array_destroy_contents(
698 (globus_xsd_generic_array_t *) array);
699 26366 }
700 /* xsd_QName_array_destroy_contents() */
701
702
703
704 void
705 xsd_QName_array_destroy(
706 xsd_QName_array * array)
707 370 {
708
709 370 globus_xsd_generic_array_destroy(
710 (globus_xsd_generic_array_t *) array);
711 370 }
712 /* xsd_QName_array_destroy() */
713
714
715
716
717 globus_result_t
718 xsd_QName_array_copy(
719 xsd_QName_array ** dest_arr,
720 const xsd_QName_array * src_arr)
721 0 {
722 0 return globus_xsd_generic_array_copy(
723 (globus_xsd_generic_array_t **) dest_arr,
724 (const globus_xsd_generic_array_t *) src_arr);
725 }
726 /* xsd_QName_array_copy() */
727
728
729
730 globus_result_t
731 xsd_QName_array_copy_contents(
732 xsd_QName_array * dest_arr,
733 const xsd_QName_array * src_arr)
734 17614 {
735 17614 return globus_xsd_generic_array_copy_contents(
736 (globus_xsd_generic_array_t *) dest_arr,
737 (const globus_xsd_generic_array_t *) src_arr);
738 }
739 /* xsd_QName_array_copy_contents() */
740
741
742
743 xsd_QName *
744 xsd_QName_array_push(
745 xsd_QName_array * array)
746 2258583 {
747 /* Some contents initializers don't initialize subelments but to set their
748 * values to be NULL
749 */
750 2258583 if (array->type_info == NULL)
751 {
752 334 array->type_info = &xsd_QName_info;
753 }
754 2258583 return globus_xsd_generic_array_push(
755 (globus_xsd_generic_array_t *) array);
756 }
757 /* xsd_QName_array_push() */
758
759
760
761 globus_result_t
762 xsd_QName_array_serialize(
763 const xsd_QName * element_qname,
764 const xsd_QName_array * array,
765 globus_soap_message_handle_t message,
766 globus_xsd_element_options_t options)
767 9480 {
768 9480 return globus_xsd_generic_array_serialize(
769 element_qname,
770 (const globus_xsd_generic_array_t *) array,
771 message,
772 options);
773 }
774 /* xsd_QName_array_serialize() */
775
776
777
778
779 globus_result_t
780 xsd_QName_array_deserialize(
781 const xsd_QName * element_qname,
782 xsd_QName_array * array,
783 globus_soap_message_handle_t message,
784 globus_xsd_element_options_t options)
785 8064 {
786 /* Some initializers set the array contents to NULL */
787 8064 if (array->type_info == NULL)
788 {
789 8064 array->type_info = &xsd_QName_info;
790 }
791
792 8064 return globus_xsd_generic_array_deserialize(
793 element_qname,
794 (globus_xsd_generic_array_t *) array,
795 message,
796 options);
797 }
798 /* xsd_QName_array_deserialize() */
799
800
801
802 globus_result_t
803 xsd_QName_serialize_attribute(
804 const xsd_QName * attr_qname,
805 const xsd_QName * val,
806 globus_soap_message_handle_t handle,
807 globus_xsd_element_options_t options)
808 120 {
809 120 globus_result_t result = GLOBUS_SUCCESS;
810 GlobusFuncName(xsd_QName_serialize_attribute);
811 120 GlobusSoapMessageDebugEnter();
812
813 120 result = globus_soap_message_serialize_QName_attribute(
814 handle, attr_qname, val);
815 120 if(result != GLOBUS_SUCCESS)
816 {
817 0 result = GlobusSoapMessageErrorSerializeFailed(
818 result, NULL, attr_qname);
819 0 goto exit;
820 }
821 120 exit:
822
823 120 GlobusSoapMessageDebugExit();
824 120 return result;
825 }
826 /* xsd_QName_serialize_attribute() */
827
828
829
830
831 globus_result_t
832 xsd_QName_deserialize_attribute(
833 const xsd_QName * attr_qname,
834 xsd_QName * instance,
835 globus_soap_message_handle_t message,
836 globus_xsd_element_options_t options)
837 387 {
838 387 globus_result_t result = GLOBUS_SUCCESS;
839 GlobusFuncName(xsd_QName_deserialize_attribute);
840 387 GlobusSoapMessageDebugEnter();
841
842 387 result = globus_soap_message_deserialize_QName_attribute(
843 message, attr_qname, instance);
844
845 387 if(result != GLOBUS_SUCCESS)
846 {
847 0 result = GlobusSoapMessageErrorDeserializeFailed(
848 result, attr_qname);
849 }
850
851 387 GlobusSoapMessageDebugExit();
852 387 return result;
853 }
854 /* xsd_QName_deserialize_attribute() */
855
856
857
858 globus_result_t
859 xsd_QName_deserialize_attribute_pointer(
860 const xsd_QName * attr_qname,
861 xsd_QName ** ip,
862 globus_soap_message_handle_t message,
863 globus_xsd_element_options_t options)
864 23531 {
865 23531 xsd_QName * instance = NULL;
866 23531 globus_result_t result = GLOBUS_SUCCESS;
867 GlobusFuncName(xsd_QName_deserialize_attribute_pointer);
868 23531 GlobusSoapMessageDebugEnter();
869
870
871 23531 result = xsd_QName_init(&instance);
872
873 23531 if (result != GLOBUS_SUCCESS)
874 {
875 0 goto exit;
876 }
877
878 23531 result = globus_soap_message_deserialize_QName_attribute(
879 message,
880 attr_qname,
881 instance);
882
883 23531 if(GlobusSoapMessageStatusAttributeNotFoundCheck(result))
884 {
885 21359 result = GLOBUS_SUCCESS;
886 21359 xsd_QName_destroy(instance);
887 21359 instance = NULL;
888 goto exit;
889 }
890
891 23531 exit:
892 23531 *ip = instance;
893
894 23531 GlobusSoapMessageDebugExit();
895 23531 return result;
896 }
897 /* xsd_QName_deserialize_attribute_pointer() */
898
899
900
901 globus_result_t
902 xsd_QName_list_serialize(
903 const xsd_QName * element_qname,
904 const xsd_QName_array * inst,
905 globus_soap_message_handle_t message_handle,
906 globus_xsd_element_options_t options)
907 0 {
908 0 globus_result_t result = GLOBUS_SUCCESS;
909 GlobusFuncName(xsd_QName_list_serialize);
910 0 GlobusSoapMessageDebugEnter();
911
912 0 if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
913 {
914 /* add begin element */
915 0 result = globus_soap_message_element_ns_set(
916 message_handle,
917 element_qname,
918 element_qname->Namespace,
919 &options);
920 0 if(result != GLOBUS_SUCCESS)
921 {
922 0 result = GlobusSoapMessageErrorSerializeFailed(
923 result, NULL, element_qname);
924 0 goto exit;
925 }
926
927 0 result = globus_soap_message_serialize_element(
928 message_handle,
929 element_qname,
930 options,
931 &xsd_QName_qname);
932 0 if(result != GLOBUS_SUCCESS)
933 {
934 0 result = GlobusSoapMessageErrorSerializeFailed(
935 result, NULL, element_qname);
936 0 goto exit;
937 }
938
939 0 if(options & GLOBUS_XSD_ELEMENT_TYPE_ATTR &&
940 !globus_soap_message_serialize_is_c14n_subset(message_handle))
941 {
942 xsd_QName type_attr;
943 0 type_attr.local = "type";
944 0 type_attr.Namespace =
945 "http://www.w3.org/2001/XMLSchema-instance";
946 0 result = globus_soap_message_serialize_QName_attribute(
947 message_handle,
948 &type_attr,
949 &xsd_QName_qname);
950 0 if(result != GLOBUS_SUCCESS)
951 {
952 0 result = GlobusSoapMessageErrorSerializeFailed(
953 result, NULL, element_qname);
954 0 goto exit;
955 }
956 }
957
958 0 result = globus_soap_message_serialize_element_begin_close(
959 message_handle, element_qname);
960 0 if(result != GLOBUS_SUCCESS)
961 {
962 0 result = GlobusSoapMessageErrorSerializeFailed(
963 result, NULL, element_qname);
964 0 goto exit;
965 }
966 }
967
968 0 result = xsd_QName_list_serialize_contents(
969 inst,
970 message_handle,
971 options);
972 0 if(result != GLOBUS_SUCCESS)
973 {
974 0 result = GlobusSoapMessageErrorSerializeFailed(
975 result, NULL, element_qname);
976 0 goto exit;
977 }
978
979 0 if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
980 {
981 /* add end element */
982 0 result = globus_soap_message_serialize_element_end(
983 message_handle,
984 element_qname,
985 options,
986 &xsd_QName_qname);
987 0 if(result != GLOBUS_SUCCESS)
988 {
989 0 result = GlobusSoapMessageErrorSerializeFailed(
990 result, NULL, element_qname);
991 0 goto exit;
992 }
993
994 0 globus_soap_message_element_ns_remove(
995 message_handle,
996 element_qname->Namespace,
997 &options);
998 }
999
1000 0 exit:
1001
1002 0 GlobusSoapMessageDebugExit();
1003 0 return result;
1004 }
1005
1006
1007
1008
1009 globus_result_t
1010 xsd_QName_list_serialize_contents(
1011 const xsd_QName_array * inst,
1012 globus_soap_message_handle_t message_handle,
1013 globus_xsd_element_options_t options)
1014 0 {
1015 0 globus_result_t result = GLOBUS_SUCCESS;
1016 GlobusFuncName(xsd_QName_list_serialize_contents);
1017 0 GlobusSoapMessageDebugEnter();
1018
1019 0 result = globus_soap_message_serialize_QName_list(
1020 message_handle,
1021 inst);
1022 0 if(result != GLOBUS_SUCCESS)
1023 {
1024 0 result = GlobusSoapMessageErrorSerializeFailed(
1025 result, "could not serialize as list", &xsd_QName_qname);
1026 0 goto exit;
1027 }
1028
1029 0 exit:
1030
1031 0 GlobusSoapMessageDebugExit();
1032 0 return result;
1033 }
1034 /* xsd_QName_list_serialize_contents() */
1035
1036
1037
1038 globus_result_t
1039 xsd_QName_list_serialize_attribute(
1040 const xsd_QName * attr_qname,
1041 const xsd_QName_array * inst,
1042 globus_soap_message_handle_t message_handle,
1043 globus_xsd_element_options_t options)
1044 10 {
1045 10 globus_result_t result = GLOBUS_SUCCESS;
1046 GlobusFuncName(xsd_QName_list_serialize_attribute);
1047 10 GlobusSoapMessageDebugEnter();
1048
1049 10 result = globus_soap_message_serialize_QName_attribute_list(
1050 message_handle,
1051 attr_qname,
1052 inst);
1053 10 if(result != GLOBUS_SUCCESS)
1054 {
1055 0 result = GlobusSoapMessageErrorSerializeFailed(
1056 result, NULL, attr_qname);
1057 0 goto exit;
1058 }
1059
1060 10 exit:
1061
1062 10 GlobusSoapMessageDebugExit();
1063 10 return result;
1064 }
1065 /* xsd_QName_list_serialize_attribute() */
1066
1067
1068
1069 globus_result_t
1070 xsd_QName_list_deserialize_attribute(
1071 const xsd_QName * attr_qname,
1072 xsd_QName_array * ip,
1073 globus_soap_message_handle_t message_handle,
1074 globus_xsd_element_options_t options)
1075 40 {
1076 40 globus_result_t result = GLOBUS_SUCCESS;
1077 GlobusFuncName(xsd_QName_list_deserialize_attribute);
1078 40 GlobusSoapMessageDebugEnter();
1079
1080 40 result =
1081 globus_soap_message_deserialize_QName_attribute_list(
1082 message_handle, attr_qname, ip);
1083 40 if(result != GLOBUS_SUCCESS)
1084 {
1085 20 result = GlobusSoapMessageErrorDeserializeFailed(
1086 result, attr_qname);
1087 }
1088
1089 40 return result;
1090 }
1091 /* xsd_QName_list_deserialize_attribute() */
1092
1093
1094
1095 globus_result_t
1096 xsd_QName_list_deserialize(
1097 const xsd_QName * element_qname,
1098 xsd_QName_array * ip,
1099 globus_soap_message_handle_t message_handle,
1100 globus_xsd_element_options_t options)
1101 0 {
1102 0 globus_result_t result = GLOBUS_SUCCESS;
1103 GlobusFuncName(xsd_QName_list_deserialize);
1104 0 GlobusSoapMessageDebugEnter();
1105
1106 0 if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1107 {
1108 0 result = globus_soap_message_deserialize_element(
1109 message_handle, element_qname);
1110 0 if(result != GLOBUS_SUCCESS)
1111 {
1112 0 goto error_exit;
1113 }
1114
1115 0 result =
1116 globus_soap_message_deserialize_element_begin_close(
1117 message_handle);
1118 0 if(result != GLOBUS_SUCCESS)
1119 {
1120 0 goto error_exit;
1121 }
1122 }
1123
1124 0 result =
1125 xsd_QName_list_deserialize_contents(
1126 ip, message_handle, options);
1127 0 if(result != GLOBUS_SUCCESS)
1128 {
1129 0 goto error_exit;
1130 }
1131
1132 0 if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1133 {
1134 0 result =
1135 globus_soap_message_deserialize_element_end(
1136 message_handle,
1137 element_qname);
1138 0 if(result != GLOBUS_SUCCESS)
1139 {
1140 0 goto error_exit;
1141 }
1142 }
1143
1144 0 goto exit;
1145
1146 0 error_exit:
1147
1148 0 if(!GlobusSoapMessageStatusCheck(result))
1149 {
1150 0 result = GlobusSoapMessageErrorDeserializeFailed(
1151 result, element_qname);
1152 }
1153
1154 0 exit:
1155
1156 0 GlobusSoapMessageDebugExit();
1157 0 return result;
1158 }
1159 /* xsd_QName_list_deserialize() */
1160
1161
1162
1163 globus_result_t
1164 xsd_QName_list_deserialize_contents(
1165 xsd_QName_array * ip,
1166 globus_soap_message_handle_t message_handle,
1167 globus_xsd_element_options_t options)
1168 0 {
1169 0 globus_result_t result = GLOBUS_SUCCESS;
1170 GlobusFuncName(xsd_QName_list_deserialize_contents);
1171 0 GlobusSoapMessageDebugEnter();
1172
1173 0 result =
1174 globus_soap_message_deserialize_QName_list(
1175 message_handle, ip);
1176 if(result != GLOBUS_SUCCESS)
1177 {
1178 0 goto exit;
1179 }
1180
1181 0 exit:
1182
1183 0 result = GlobusSoapMessageErrorDeserializeFailed(
1184 result, &xsd_QName_qname);
1185 0 return result;
1186 }
1187 /* xsd_QName_list_deserialize_contents() */
1188
1189
1190
1191 globus_result_t
1192 globus_soap_message_serialize_QName(
1193 globus_soap_message_handle_t handle,
1194 const xsd_QName * val)
1195 4810778 {
1196 4810778 int res = 0;
1197 4810778 globus_result_t result = GLOBUS_SUCCESS;
1198 GlobusFuncName(globus_soap_message_serialize_QName);
1199 4810778 GlobusSoapMessageDebugEnter();
1200
1201
1202 {
1203 const xmlChar * prefix;
1204
1205 4810778 if (val->local == NULL)
1206 {
1207 0 result = GlobusSoapMessageErrorSerializeFailed(
1208 result, NULL, val);
1209 0 goto exit;
1210 }
1211 4810778 prefix = globus_soap_message_get_element_prefix(
1212 handle, val);
1213 4810778 res = xmlTextWriterWriteFormatString(
1214 handle->writer,
1215 "%s%s%s",
1216 (prefix ? (char *) prefix : ""),
1217 (prefix ? ":" : ""),
1218 val->local);
1219
1220 4810778 if (res < 0)
1221 {
1222 0 xmlErrorPtr err = xmlGetLastError();
1223 0 result = GlobusSoapMessageErrorSerializeFailed(
1224 handle->result,
1225 (err ? err->message : ""),
1226 &xsd_QName_qname);
1227 }
1228 }
1229
1230
1231 4810778 exit:
1232
1233 4810778 GlobusSoapMessageDebugExit();
1234 4810778 return result;
1235 }
1236 /* globus_soap_message_serialize_QName() */
1237
1238 globus_result_t
1239 globus_soap_message_deserialize_QName(
1240 globus_soap_message_handle_t handle,
1241 xsd_QName * val)
1242 2182687 {
1243 2182687 globus_result_t result = GLOBUS_SUCCESS;
1244 const xmlChar * content;
1245 const xmlChar * content_save;
1246 GlobusFuncName(globus_soap_message_deserialize_QName);
1247 2182687 GlobusSoapMessageDebugEnter();
1248
1249 2182687 result = globus_i_soap_message_deserialize_next_content(handle);
1250 2182687 if(result != GLOBUS_SUCCESS)
1251 {
1252 0 result = GlobusSoapMessageErrorDeserializeFailed(
1253 result, &xsd_QName_qname);
1254 0 goto exit;
1255 }
1256
1257 2182687 content = xmlTextReaderConstValue(handle->reader);
1258 2182687 if (!content)
1259 {
1260 0 result = GlobusSoapMessageErrorDeserializeFailed(
1261 GLOBUS_SUCCESS, &xsd_QName_qname);
1262 }
1263 2182687 content_save = content;
1264 {
1265
1266 {
1267 const xmlChar * prefix;
1268 const xmlChar * local;
1269 xmlChar * pfx_copy;
1270 char * tmp;
1271
1272 4377703 while(*content != 0 && isspace(*content))
1273 {
1274 12329 content++;
1275 }
1276
1277 2182687 prefix = content;
1278
1279 13097198 while (*content != 0 && *content != ':')
1280 {
1281 8731824 content++;
1282 }
1283
1284 2182687 if (*content == 0)
1285 {
1286 /* no explicit prefix, check default NS */
1287 6 local = prefix;
1288 6 prefix = 0;
1289
1290 6 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1291 handle->reader, NULL);
1292 }
1293 else
1294 {
1295 2182681 pfx_copy = (xmlChar *) globus_libc_strdup((char *) prefix);
1296 2182681 if (pfx_copy == NULL)
1297 {
1298 0 result = GlobusSoapMessageErrorOutOfMemory;
1299 0 goto exit;
1300 }
1301 2182681 pfx_copy[content-prefix] = 0;
1302 2182681 local = content+1;
1303 2182681 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1304 handle->reader, pfx_copy);
1305 2182681 if (val->Namespace == NULL)
1306 {
1307 0 free(pfx_copy);
1308 0 result = GlobusSoapMessageErrorOutOfMemory;
1309 0 goto exit;
1310 }
1311 2182681 free(pfx_copy);
1312 }
1313 2182687 if (val->Namespace && val->Namespace[0] == 0)
1314 {
1315 3 free(val->Namespace);
1316 3 val->Namespace = NULL;
1317 }
1318 2182687 val->local = globus_libc_strdup((char *) local);
1319 2182687 if (val->local == NULL)
1320 {
1321 0 result = GlobusSoapMessageErrorOutOfMemory;
1322 0 if (val->Namespace)
1323 {
1324 0 free(val->Namespace);
1325 0 val->Namespace = 0;
1326 }
1327 0 goto exit;
1328 }
1329 2182687 tmp = val->local;
1330 37083922 while (*tmp && !isspace(*tmp))
1331 {
1332 32718548 tmp++;
1333 }
1334 2182687 if (isspace(*tmp))
1335 {
1336 625 *tmp = 0;
1337 }
1338 4365374 while (*tmp && isspace(*tmp))
1339 {
1340 0 tmp++;
1341 }
1342 2182687 if (*tmp != 0)
1343 {
1344 0 if (val->Namespace)
1345 {
1346 0 free(val->Namespace);
1347 0 val->Namespace = 0;
1348 }
1349 0 if (val->local)
1350 {
1351 0 free(val->local);
1352 0 val->local = 0;
1353 }
1354 0 result = GlobusSoapMessageErrorDeserializeContentFailed(
1355 &xsd_QName_qname, content);
1356 0 goto exit;
1357 }
1358 }
1359
1360 }
1361
1362 2182687 exit:
1363 2182687 GlobusSoapMessageDebugExit();
1364 2182687 return result;
1365 }
1366 /* globus_soap_message_deserialize_QName() */
1367
1368 globus_result_t
1369 globus_soap_message_serialize_QName_list(
1370 globus_soap_message_handle_t handle,
1371 const xsd_QName_array * inst)
1372 10 {
1373 10 int i = 0;
1374 10 globus_result_t result = GLOBUS_SUCCESS;
1375 int res;
1376 GlobusFuncName(globus_soap_message_serialize_string_list);
1377 10 GlobusSoapMessageDebugEnter();
1378
1379 24 for(i = 0; i < inst->length; ++i)
1380 {
1381 14 result = globus_soap_message_serialize_QName(
1382 handle,
1383 &inst->elements[i]);
1384
1385 14 if (result != GLOBUS_SUCCESS)
1386 {
1387 0 goto exit;
1388 }
1389
1390 14 if (i != (inst->length-1))
1391 {
1392 4 res = xmlTextWriterWriteString(handle->writer, (xmlChar *) " ");
1393 4 if(res < 0)
1394 {
1395 0 xmlErrorPtr err = xmlGetLastError();
1396 0 result = GlobusSoapMessageErrorSerializeFailed(
1397 (handle->result ? handle->result : GLOBUS_SUCCESS),
1398 (err ? err->message : ""),
1399 &xsd_QName_qname);
1400 0 goto exit;
1401 }
1402 }
1403 }
1404
1405 10 exit:
1406
1407 10 GlobusSoapMessageDebugExit();
1408 10 return result;
1409 }
1410 /* globus_soap_message_serialize_QName_list() */
1411
1412 globus_result_t
1413 globus_soap_message_deserialize_QName_list(
1414 globus_soap_message_handle_t handle,
1415 xsd_QName_array * array_val)
1416 0 {
1417 0 globus_result_t result = GLOBUS_SUCCESS;
1418 0 xmlChar * content_value = NULL;
1419 0 xmlChar * content = NULL;
1420 char * saveptr;
1421 xsd_QName * val;
1422 GlobusFuncName(globus_soap_message_deserialize_QName_list);
1423 0 GlobusSoapMessageDebugEnter();
1424
1425 0 result = globus_i_soap_message_deserialize_next_content(handle);
1426 0 if(result != GLOBUS_SUCCESS)
1427 {
1428 0 result = GlobusSoapMessageErrorDeserializeFailed(
1429 result, &xsd_QName_qname);
1430 0 goto exit;
1431 }
1432
1433 0 content_value = xmlTextReaderValue(handle->reader);
1434 0 if (!content_value)
1435 {
1436 0 result = GlobusSoapMessageErrorDeserializeFailed(
1437 GLOBUS_SUCCESS, &xsd_QName_qname);
1438 0 goto exit;
1439 }
1440
1441 0 for (content = (xmlChar *) strtok_r((char *) content_value, " \t\r\n", &saveptr);
1442 0 content != NULL;
1443 0 content = (xmlChar *) strtok_r(NULL, " \t\r\n", &saveptr))
1444 {
1445 0 val = xsd_QName_array_push(array_val);
1446 {
1447
1448 {
1449 const xmlChar * prefix;
1450 const xmlChar * local;
1451 xmlChar * pfx_copy;
1452 char * tmp;
1453
1454 0 while(*content != 0 && isspace(*content))
1455 {
1456 0 content++;
1457 }
1458
1459 0 prefix = content;
1460
1461 0 while (*content != 0 && *content != ':')
1462 {
1463 0 content++;
1464 }
1465
1466 0 if (*content == 0)
1467 {
1468 /* no explicit prefix, check default NS */
1469 0 local = prefix;
1470 0 prefix = 0;
1471
1472 0 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1473 handle->reader, NULL);
1474 }
1475 else
1476 {
1477 0 pfx_copy = (xmlChar *) globus_libc_strdup((char *) prefix);
1478 0 if (pfx_copy == NULL)
1479 {
1480 0 result = GlobusSoapMessageErrorOutOfMemory;
1481 0 goto exit;
1482 }
1483 0 pfx_copy[content-prefix] = 0;
1484 0 local = content+1;
1485 0 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1486 handle->reader, pfx_copy);
1487 0 if (val->Namespace == NULL)
1488 {
1489 0 free(pfx_copy);
1490 0 result = GlobusSoapMessageErrorOutOfMemory;
1491 0 goto exit;
1492 }
1493 0 free(pfx_copy);
1494 }
1495 0 if (val->Namespace && val->Namespace[0] == 0)
1496 {
1497 0 free(val->Namespace);
1498 0 val->Namespace = NULL;
1499 }
1500 0 val->local = globus_libc_strdup((char *) local);
1501 0 if (val->local == NULL)
1502 {
1503 0 result = GlobusSoapMessageErrorOutOfMemory;
1504 0 if (val->Namespace)
1505 {
1506 0 free(val->Namespace);
1507 0 val->Namespace = 0;
1508 }
1509 0 goto exit;
1510 }
1511 0 tmp = val->local;
1512 0 while (*tmp && !isspace(*tmp))
1513 {
1514 0 tmp++;
1515 }
1516 0 if (isspace(*tmp))
1517 {
1518 0 *tmp = 0;
1519 }
1520 0 while (*tmp && isspace(*tmp))
1521 {
1522 0 tmp++;
1523 }
1524 0 if (*tmp != 0)
1525 {
1526 0 if (val->Namespace)
1527 {
1528 0 free(val->Namespace);
1529 0 val->Namespace = 0;
1530 }
1531 0 if (val->local)
1532 {
1533 0 free(val->local);
1534 0 val->local = 0;
1535 }
1536 0 result = GlobusSoapMessageErrorDeserializeContentFailed(
1537 &xsd_QName_qname, content);
1538 0 goto exit;
1539 }
1540 }
1541
1542 }
1543 }
1544
1545 0 exit:
1546 0 if (content_value != NULL)
1547 {
1548 0 xmlFree(content_value);
1549 }
1550 0 if (result != GLOBUS_SUCCESS)
1551 {
1552 0 xsd_QName_array_destroy_contents(array_val);
1553 }
1554 0 GlobusSoapMessageDebugExit();
1555 0 return result;
1556 }
1557 /* globus_soap_message_deserialize_QName_list() */
1558
1559 globus_result_t
1560 globus_soap_message_serialize_QName_attribute(
1561 globus_soap_message_handle_t handle,
1562 const xsd_QName * attr_name,
1563 const xsd_QName * val)
1564 2183045 {
1565 2183045 globus_result_t result = GLOBUS_SUCCESS;
1566 GlobusFuncName(globus_soap_message_serialize_QName_attribute);
1567 2183045 GlobusSoapMessageDebugEnter();
1568
1569 2183045 if (val == NULL)
1570 {
1571 0 result = GlobusSoapMessageErrorNullParam;
1572
1573 0 goto exit;
1574 }
1575
1576 2183045 result = globus_soap_message_serialize_attribute(
1577 handle,
1578 attr_name);
1579 2183045 if (result != GLOBUS_SUCCESS)
1580 {
1581 0 goto exit;
1582 }
1583
1584 2183045 result = globus_soap_message_serialize_QName(
1585 handle,
1586 val);
1587 2183045 if(result != GLOBUS_SUCCESS)
1588 {
1589 0 goto exit;
1590 }
1591
1592 2183045 result = globus_soap_message_serialize_attribute_end(
1593 handle,
1594 attr_name);
1595
1596 2183045 exit:
1597
1598 2183045 GlobusSoapMessageDebugExit();
1599 2183045 return result;
1600 }
1601 /* globus_soap_message_serialize_QName_attribute() */
1602
1603 globus_result_t
1604 globus_soap_message_deserialize_QName_attribute(
1605 globus_soap_message_handle_t handle,
1606 const xsd_QName * attr_qname,
1607 xsd_QName * val)
1608 23918 {
1609 23918 globus_result_t result = GLOBUS_SUCCESS;
1610 23918 xmlChar * content = NULL;
1611 23918 xmlChar * content_save = NULL;
1612 GlobusFuncName(globus_soap_message_deserialize_QName_attribute);
1613 23918 GlobusSoapMessageDebugEnter();
1614
1615 23918 if (val == NULL || attr_qname == NULL || attr_qname->local == NULL)
1616 {
1617 0 result = GlobusSoapMessageErrorNullParam;
1618
1619 0 goto exit;
1620 }
1621
1622 23918 result = globus_soap_message_deserialize_attribute(
1623 handle,
1624 attr_qname,
1625 &content);
1626 23918 if (result != GLOBUS_SUCCESS)
1627 {
1628 21359 goto exit;
1629 }
1630 2559 content_save = content;
1631
1632 {
1633
1634 {
1635 const xmlChar * prefix;
1636 const xmlChar * local;
1637 xmlChar * pfx_copy;
1638 char * tmp;
1639
1640 5118 while(*content != 0 && isspace(*content))
1641 {
1642 0 content++;
1643 }
1644
1645 2559 prefix = content;
1646
1647 14509 while (*content != 0 && *content != ':')
1648 {
1649 9391 content++;
1650 }
1651
1652 2559 if (*content == 0)
1653 {
1654 /* no explicit prefix, check default NS */
1655 72 local = prefix;
1656 72 prefix = 0;
1657
1658 72 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1659 handle->reader, NULL);
1660 }
1661 else
1662 {
1663 2487 pfx_copy = (xmlChar *) globus_libc_strdup((char *) prefix);
1664 2487 if (pfx_copy == NULL)
1665 {
1666 0 result = GlobusSoapMessageErrorOutOfMemory;
1667 0 goto exit;
1668 }
1669 2487 pfx_copy[content-prefix] = 0;
1670 2487 local = content+1;
1671 2487 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1672 handle->reader, pfx_copy);
1673 2487 if (val->Namespace == NULL)
1674 {
1675 0 free(pfx_copy);
1676 0 result = GlobusSoapMessageErrorOutOfMemory;
1677 0 goto exit;
1678 }
1679 2487 free(pfx_copy);
1680 }
1681 2559 if (val->Namespace && val->Namespace[0] == 0)
1682 {
1683 36 free(val->Namespace);
1684 36 val->Namespace = NULL;
1685 }
1686 2559 val->local = globus_libc_strdup((char *) local);
1687 2559 if (val->local == NULL)
1688 {
1689 0 result = GlobusSoapMessageErrorOutOfMemory;
1690 0 if (val->Namespace)
1691 {
1692 0 free(val->Namespace);
1693 0 val->Namespace = 0;
1694 }
1695 0 goto exit;
1696 }
1697 2559 tmp = val->local;
1698 25438 while (*tmp && !isspace(*tmp))
1699 {
1700 20320 tmp++;
1701 }
1702 2559 if (isspace(*tmp))
1703 {
1704 0 *tmp = 0;
1705 }
1706 5118 while (*tmp && isspace(*tmp))
1707 {
1708 0 tmp++;
1709 }
1710 2559 if (*tmp != 0)
1711 {
1712 0 if (val->Namespace)
1713 {
1714 0 free(val->Namespace);
1715 0 val->Namespace = 0;
1716 }
1717 0 if (val->local)
1718 {
1719 0 free(val->local);
1720 0 val->local = 0;
1721 }
1722 0 result = GlobusSoapMessageErrorDeserializeContentFailed(
1723 &xsd_QName_qname, content);
1724 0 goto exit;
1725 }
1726 }
1727
1728 }
1729 23918 exit:
1730 23918 if (content_save != NULL)
1731 {
1732 2559 xmlFree(content_save);
1733 }
1734
1735 23918 GlobusSoapMessageDebugExit();
1736 23918 return result;
1737 }
1738 /* globus_soap_message_deserialize_QName_attribute() */
1739
1740 globus_result_t
1741 globus_soap_message_serialize_QName_attribute_list(
1742 globus_soap_message_handle_t handle,
1743 const xsd_QName * attr_name,
1744 const xsd_QName_array * val)
1745 10 {
1746 10 globus_result_t result = GLOBUS_SUCCESS;
1747 GlobusFuncName(globus_soap_message_serialize_QName_attribute_list);
1748 10 GlobusSoapMessageDebugEnter();
1749
1750 10 if (val == NULL)
1751 {
1752 0 result = GlobusSoapMessageErrorNullParam;
1753
1754 0 goto exit;
1755 }
1756
1757 10 result = globus_soap_message_serialize_attribute(
1758 handle,
1759 attr_name);
1760 10 if (result != GLOBUS_SUCCESS)
1761 {
1762 0 goto exit;
1763 }
1764
1765 10 result = globus_soap_message_serialize_QName_list(
1766 handle,
1767 val);
1768
1769 10 if(result != GLOBUS_SUCCESS)
1770 {
1771 0 goto exit;
1772 }
1773
1774 10 result = globus_soap_message_serialize_attribute_end(
1775 handle,
1776 attr_name);
1777
1778 10 exit:
1779
1780 10 GlobusSoapMessageDebugExit();
1781 10 return result;
1782 }
1783 /* globus_soap_message_serialize_QName_attribute_list() */
1784
1785 globus_result_t
1786 globus_soap_message_deserialize_QName_attribute_list(
1787 globus_soap_message_handle_t handle,
1788 const xsd_QName * attr_qname,
1789 xsd_QName_array * list_val)
1790 40 {
1791 40 globus_result_t result = GLOBUS_SUCCESS;
1792 40 xmlChar * content_value = NULL;
1793 40 xmlChar * content = NULL;
1794 char * saveptr;
1795 xsd_QName * val;
1796 GlobusFuncName(globus_soap_message_deserialize_QName_attribute_list);
1797 40 GlobusSoapMessageDebugEnter();
1798
1799 40 if (list_val == NULL || attr_qname == NULL || attr_qname->local == NULL)
1800 {
1801 0 result = GlobusSoapMessageErrorNullParam;
1802
1803 0 goto exit;
1804 }
1805
1806 40 result = globus_soap_message_deserialize_attribute(
1807 handle,
1808 attr_qname,
1809 &content_value);
1810 40 if (result != GLOBUS_SUCCESS)
1811 {
1812 20 goto exit;
1813 }
1814
1815 for (content = (xmlChar *) strtok_r((char *) content_value, " \t\r\n",
1816 20 &saveptr);
1817 68 content != NULL;
1818 28 content = (xmlChar *) strtok_r(NULL, " \t\r\n", &saveptr))
1819 {
1820 28 val = xsd_QName_array_push(list_val);
1821 {
1822
1823 {
1824 const xmlChar * prefix;
1825 const xmlChar * local;
1826 xmlChar * pfx_copy;
1827 char * tmp;
1828
1829 56 while(*content != 0 && isspace(*content))
1830 {
1831 0 content++;
1832 }
1833
1834 28 prefix = content;
1835
1836 186 while (*content != 0 && *content != ':')
1837 {
1838 130 content++;
1839 }
1840
1841 28 if (*content == 0)
1842 {
1843 /* no explicit prefix, check default NS */
1844 0 local = prefix;
1845 0 prefix = 0;
1846
1847 0 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1848 handle->reader, NULL);
1849 }
1850 else
1851 {
1852 28 pfx_copy = (xmlChar *) globus_libc_strdup((char *) prefix);
1853 28 if (pfx_copy == NULL)
1854 {
1855 0 result = GlobusSoapMessageErrorOutOfMemory;
1856 0 goto exit;
1857 }
1858 28 pfx_copy[content-prefix] = 0;
1859 28 local = content+1;
1860 28 val->Namespace = (char *) xmlTextReaderLookupNamespace(
1861 handle->reader, pfx_copy);
1862 28 if (val->Namespace == NULL)
1863 {
1864 0 free(pfx_copy);
1865 0 result = GlobusSoapMessageErrorOutOfMemory;
1866 0 goto exit;
1867 }
1868 28 free(pfx_copy);
1869 }
1870 28 if (val->Namespace && val->Namespace[0] == 0)
1871 {
1872 0 free(val->Namespace);
1873 0 val->Namespace = NULL;
1874 }
1875 28 val->local = globus_libc_strdup((char *) local);
1876 28 if (val->local == NULL)
1877 {
1878 0 result = GlobusSoapMessageErrorOutOfMemory;
1879 0 if (val->Namespace)
1880 {
1881 0 free(val->Namespace);
1882 0 val->Namespace = 0;
1883 }
1884 0 goto exit;
1885 }
1886 28 tmp = val->local;
1887 252 while (*tmp && !isspace(*tmp))
1888 {
1889 196 tmp++;
1890 }
1891 28 if (isspace(*tmp))
1892 {
1893 0 *tmp = 0;
1894 }
1895 56 while (*tmp && isspace(*tmp))
1896 {
1897 0 tmp++;
1898 }
1899 28 if (*tmp != 0)
1900 {
1901 0 if (val->Namespace)
1902 {
1903 0 free(val->Namespace);
1904 0 val->Namespace = 0;
1905 }
1906 0 if (val->local)
1907 {
1908 0 free(val->local);
1909 0 val->local = 0;
1910 }
1911 0 result = GlobusSoapMessageErrorDeserializeContentFailed(
1912 &xsd_QName_qname, content);
1913 0 goto exit;
1914 }
1915 }
1916
1917 }
1918 }
1919 40 exit:
1920 40 if (content_value != NULL)
1921 {
1922 20 xmlFree(content_value);
1923 }
1924 40 if (result != GLOBUS_SUCCESS)
1925 {
1926 20 xsd_QName_array_destroy_contents(list_val);
1927 }
1928
1929 40 GlobusSoapMessageDebugExit();
1930 40 return result;
1931 }