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 "wsp_MessagePredicateAssertion.h"
26
27 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
28 xsd_QName wsp_MessagePredicateAssertion_qname =
29 {
30     WSP_MESSAGEPREDICATEASSERTION_NS,
31     WSP_MESSAGEPREDICATEASSERTION_LOCAL
32 };
33 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
34
35 globus_result_t
36 wsp_MessagePredicateAssertion_serialize_wrapper(
37     const xsd_QName *                   element_qname,
38     const void *                        instance,
39     globus_soap_message_handle_t        message_handle,
40     globus_xsd_element_options_t        options)
41 0 {
42 0     return wsp_MessagePredicateAssertion_serialize(
43         element_qname,
44         (const wsp_MessagePredicateAssertion *) instance,
45         message_handle, options);
46 }
47
48 globus_result_t
49 wsp_MessagePredicateAssertion_deserialize_pointer_wrapper(
50     const xsd_QName *                   element_qname,
51     void **                             ip,
52     globus_soap_message_handle_t        message_handle,
53     globus_xsd_element_options_t        options)
54 0 {
55 0     return wsp_MessagePredicateAssertion_deserialize_pointer(
56         element_qname,
57         (wsp_MessagePredicateAssertion **) ip,
58         message_handle, options);
59 }
60
61 globus_result_t
62 wsp_MessagePredicateAssertion_init_wrapper(void **object)
63 0 {
64 0     return wsp_MessagePredicateAssertion_init(
65         (wsp_MessagePredicateAssertion **) object);
66 }
67
68 void
69 wsp_MessagePredicateAssertion_destroy_wrapper(
70     void *                          object)
71 0 {
72 0     wsp_MessagePredicateAssertion_destroy(
73         (wsp_MessagePredicateAssertion *) object);
74 }
75
76 globus_result_t
77 wsp_MessagePredicateAssertion_copy_wrapper(
78     void **                         dest_obj,
79     const void *                    src_obj)
80 0 {
81 0     return wsp_MessagePredicateAssertion_copy(
82         (wsp_MessagePredicateAssertion **) dest_obj,
83         (wsp_MessagePredicateAssertion *) src_obj);
84 }
85
86 globus_result_t
87 wsp_MessagePredicateAssertion_init_contents_wrapper(void *object)
88 0 {
89 0     return wsp_MessagePredicateAssertion_init_contents(
90         (wsp_MessagePredicateAssertion *) object);
91 }
92
93 void
94 wsp_MessagePredicateAssertion_destroy_contents_wrapper(
95     void *                          object)
96 0 {
97 0     wsp_MessagePredicateAssertion_destroy_contents(
98         (wsp_MessagePredicateAssertion *) object);
99 }
100
101 globus_result_t
102 wsp_MessagePredicateAssertion_copy_contents_wrapper(
103     void *                          dest_obj,
104     const void *                    src_obj)
105 0 {
106 0     return wsp_MessagePredicateAssertion_copy_contents(
107         (wsp_MessagePredicateAssertion *) dest_obj,
108         (const wsp_MessagePredicateAssertion *) src_obj);
109 }
110
111 globus_result_t
112 wsp_MessagePredicateAssertion_serialize_contents_wrapper(
113     const xsd_QName *                   element_qname,
114     const void *                        instance,
115     globus_soap_message_handle_t        message_handle,
116     globus_xsd_element_options_t        options)
117 0 {
118 0     return wsp_MessagePredicateAssertion_serialize_contents(
119         element_qname,
120         (wsp_MessagePredicateAssertion *) instance,
121         message_handle, options);
122 }
123
124 globus_result_t
125 wsp_MessagePredicateAssertion_deserialize_contents_wrapper(
126     const xsd_QName *                   element_qname,
127     void **                             instance,
128     globus_soap_message_handle_t        message_handle,
129     globus_xsd_element_options_t        options)
130 0 {
131 0     globus_result_t                     result;
132 0     GlobusFuncName(wsp_MessagePredicateAssertion_deserialize_contents_wrapper);
133 0     GlobusSoapMessageDebugEnter();
134
135 0     if(!*instance)
136     {
137 0         result = wsp_MessagePredicateAssertion_init(
138             (wsp_MessagePredicateAssertion **)instance);
139 0         if(result != GLOBUS_SUCCESS)
140         {
141 0             goto error;
142         }
143     }
144
145 0     result = wsp_MessagePredicateAssertion_deserialize_contents(
146         element_qname,
147         *(wsp_MessagePredicateAssertion **)instance,
148         message_handle, options);
149 error:
150 0     GlobusSoapMessageDebugExit();
151 0     return result;
152 }
153
154 globus_result_t
155 wsp_MessagePredicateAssertion_array_serialize_wrapper(
156     const xsd_QName *               element,
157     const void *                    instance,
158     globus_soap_message_handle_t    message,
159     globus_xsd_element_options_t    options)
160 0 {
161 0     return wsp_MessagePredicateAssertion_array_serialize(
162         element,
163         (wsp_MessagePredicateAssertion_array *) instance,
164         message, options);
165 }
166
167 globus_result_t
168 wsp_MessagePredicateAssertion_array_deserialize_wrapper(
169     const xsd_QName *                   element_qname,
170     void **                             inst,
171     globus_soap_message_handle_t        message,
172     globus_xsd_element_options_t        options)
173 0 {
174 0     if(!*inst)
175     {
176 0         globus_result_t                 result;
177
178 0         result = wsp_MessagePredicateAssertion_array_init(
179             (wsp_MessagePredicateAssertion_array **)inst);
180 0         if(result != GLOBUS_SUCCESS)
181         {
182 0             return result;
183         }
184     }
185
186 0     return wsp_MessagePredicateAssertion_array_deserialize(
187         element_qname,
188         *(wsp_MessagePredicateAssertion_array **) inst,
189         message, options);
190 }
191
192 globus_result_t
193 wsp_MessagePredicateAssertion_array_init_wrapper(
194     void **                             arr)
195 0 {
196 0     return wsp_MessagePredicateAssertion_array_init(
197         (wsp_MessagePredicateAssertion_array **) arr);
198 }
199
200 void
201 wsp_MessagePredicateAssertion_array_destroy_wrapper(
202     void *                              arr)
203 0 {
204 0     wsp_MessagePredicateAssertion_array_destroy(
205         (wsp_MessagePredicateAssertion_array *) arr);
206 }
207
208 globus_result_t
209 wsp_MessagePredicateAssertion_array_copy_wrapper(
210     void **                             dest_arr,
211     const void *                        src_arr)
212 0 {
213 0     return wsp_MessagePredicateAssertion_array_copy(
214         (wsp_MessagePredicateAssertion_array **) dest_arr,
215         (const wsp_MessagePredicateAssertion_array *) src_arr);
216 }
217
218 globus_result_t
219 wsp_MessagePredicateAssertion_array_init_contents_wrapper(
220     void *                              arr)
221 0 {
222 0     return wsp_MessagePredicateAssertion_array_init_contents(
223         (wsp_MessagePredicateAssertion_array *) arr);
224 }
225
226 void
227 wsp_MessagePredicateAssertion_array_destroy_contents_wrapper(
228     void *                              arr)
229 0 {
230 0     wsp_MessagePredicateAssertion_array_destroy_contents(
231         (wsp_MessagePredicateAssertion_array *) arr);
232 }
233
234 globus_result_t
235 wsp_MessagePredicateAssertion_array_copy_contents_wrapper(
236     void *                              dest_arr,
237     const void *                        src_arr)
238 0 {
239 0     return wsp_MessagePredicateAssertion_array_copy_contents(
240         (wsp_MessagePredicateAssertion_array *) dest_arr,
241         (const wsp_MessagePredicateAssertion_array *) src_arr);
242 }
243
244 struct globus_xsd_type_info_s wsp_MessagePredicateAssertion_contents_info =
245 {
246     &wsp_MessagePredicateAssertion_qname,
247     wsp_MessagePredicateAssertion_serialize_contents_wrapper,
248     wsp_MessagePredicateAssertion_deserialize_contents_wrapper,
249     wsp_MessagePredicateAssertion_init_wrapper,
250     wsp_MessagePredicateAssertion_destroy_wrapper,
251     wsp_MessagePredicateAssertion_copy_wrapper,
252     wsp_MessagePredicateAssertion_init_contents_wrapper,
253     wsp_MessagePredicateAssertion_destroy_contents_wrapper,
254     wsp_MessagePredicateAssertion_copy_contents_wrapper,
255     sizeof(wsp_MessagePredicateAssertion),
256     NULL,
257     NULL,
258     NULL
259 };
260
261 struct globus_xsd_type_info_s wsp_MessagePredicateAssertion_array_info =
262 {
263     &wsp_MessagePredicateAssertion_qname,
264     wsp_MessagePredicateAssertion_array_serialize_wrapper,
265     wsp_MessagePredicateAssertion_array_deserialize_wrapper,
266     wsp_MessagePredicateAssertion_array_init_wrapper,
267     wsp_MessagePredicateAssertion_array_destroy_wrapper,
268     wsp_MessagePredicateAssertion_array_copy_wrapper,
269     wsp_MessagePredicateAssertion_array_init_contents_wrapper,
270     wsp_MessagePredicateAssertion_array_destroy_contents_wrapper,
271     wsp_MessagePredicateAssertion_array_copy_contents_wrapper,
272     sizeof(wsp_MessagePredicateAssertion),
273     wsp_MessagePredicateAssertion_array_push_wrapper,
274     NULL,
275     NULL
276 };
277
278 struct globus_xsd_type_info_s wsp_MessagePredicateAssertion_info =
279 {
280     &wsp_MessagePredicateAssertion_qname,
281     wsp_MessagePredicateAssertion_serialize_wrapper,
282     wsp_MessagePredicateAssertion_deserialize_pointer_wrapper,
283     wsp_MessagePredicateAssertion_init_wrapper,
284     wsp_MessagePredicateAssertion_destroy_wrapper,
285     wsp_MessagePredicateAssertion_copy_wrapper,
286     wsp_MessagePredicateAssertion_init_contents_wrapper,
287     wsp_MessagePredicateAssertion_destroy_contents_wrapper,
288     wsp_MessagePredicateAssertion_copy_contents_wrapper,
289     sizeof(wsp_MessagePredicateAssertion),
290     NULL,
291     &wsp_MessagePredicateAssertion_contents_info,
292     &wsp_MessagePredicateAssertion_array_info
293 };
294
295 globus_result_t
296 wsp_MessagePredicateAssertion_init_contents(
297     wsp_MessagePredicateAssertion * instance)
298 0 {
299 0     globus_result_t                     result = GLOBUS_SUCCESS;
300 0     GlobusFuncName(wsp_MessagePredicateAssertion_init_contents);
301 0     GlobusSoapMessageDebugEnter();
302
303 0     memset(instance, 0, sizeof(wsp_MessagePredicateAssertion));
304
305 0     GlobusSoapMessageDebugExit();
306 0     return result;
307 }
308
309 globus_result_t
310 wsp_MessagePredicateAssertion_init(
311     wsp_MessagePredicateAssertion ** object)
312 0 {
313 0     wsp_MessagePredicateAssertion * instance;
314 0     globus_result_t                     result = GLOBUS_SUCCESS;
315 0     GlobusFuncName(wsp_MessagePredicateAssertion_init);
316 0     GlobusSoapMessageDebugEnter();
317
318 0     instance = globus_malloc(sizeof(wsp_MessagePredicateAssertion));
319 0     if(!instance)
320     {
321 0         result = GlobusSoapMessageErrorOutOfMemory;
322 0         goto exit;
323     }
324
325 0     memset(instance, 0, sizeof(wsp_MessagePredicateAssertion));
326
327 0     *object = instance;
328
329  exit:
330 0     GlobusSoapMessageDebugExit();
331 0     return result;
332 }
333
334 void
335 wsp_MessagePredicateAssertion_destroy(
336     wsp_MessagePredicateAssertion * instance)
337 0 {
338 0     GlobusFuncName(wsp_MessagePredicateAssertion_destroy);
339 0     GlobusSoapMessageDebugEnter();
340
341 0     if(!instance)
342     {
343 0         goto exit;
344     }
345
346 0     wsp_MessagePredicateAssertion_destroy_contents(instance);
347 0     globus_free(instance);
348
349  exit:
350
351 0     GlobusSoapMessageDebugExit();
352 }
353
354
355 void
356 wsp_MessagePredicateAssertion_destroy_contents(
357     wsp_MessagePredicateAssertion * instance)
358 0 {
359 0     GlobusFuncName(wsp_MessagePredicateAssertion_destroy_contents);
360 0     GlobusSoapMessageDebugEnter();
361
362 0     if(instance)
363     {
364
365
366 0     xsd_string_destroy_contents(
367          &instance->base_value);
368
369 0     if(instance->_Dialect)
370     {
371 0         xsd_anyURI_destroy(
372             instance->_Dialect);
373 0         instance->_Dialect = NULL;
374     }
375
376 0     if(instance->_Id)
377     {
378 0         xsd_ID_destroy(
379             instance->_Id);
380 0         instance->_Id = NULL;
381     }
382
383 0     if(instance->_Preference)
384     {
385 0         xsd_int_destroy(
386             instance->_Preference);
387 0         instance->_Preference = NULL;
388     }
389
390 0     if(instance->_Usage)
391     {
392 0         wsp_OpenUsageType_destroy(
393             instance->_Usage);
394 0         instance->_Usage = NULL;
395     }
396
397 0         xsd_anyAttributes_destroy(instance->anyAttributes);
398 0         instance->anyAttributes = NULL;
399
400     }
401
402 0     GlobusSoapMessageDebugExit();
403 }
404
405
406 globus_result_t
407 wsp_MessagePredicateAssertion_copy(
408     wsp_MessagePredicateAssertion ** dest_obj,
409     const wsp_MessagePredicateAssertion * src_obj)
410 0 {
411 0     globus_result_t                     result = GLOBUS_SUCCESS;
412 0     wsp_MessagePredicateAssertion * instance;
413 0     GlobusFuncName(wsp_MessagePredicateAssertion_copy);
414
415 0     GlobusSoapMessageDebugEnter();
416
417 0     instance = calloc(1, sizeof(wsp_MessagePredicateAssertion));
418 0     if (instance == NULL)
419     {
420 0         GlobusSoapMessageDebugExit();
421 0         return GlobusSoapMessageErrorOutOfMemory;
422     }
423
424 0     result = wsp_MessagePredicateAssertion_copy_contents(instance, src_obj);
425 0     if(result != GLOBUS_SUCCESS)
426     {
427 0         globus_free(instance);
428 0         GlobusSoapMessageDebugExit();
429 0         return GlobusSoapMessageErrorOutOfMemory;
430     }
431
432 0     *dest_obj = instance;
433 0     GlobusSoapMessageDebugExit();
434 0     return result;
435 }
436
437 globus_result_t
438 wsp_MessagePredicateAssertion_copy_contents(
439     wsp_MessagePredicateAssertion * instance,
440     const wsp_MessagePredicateAssertion * src_obj)
441 0 {
442 0     globus_result_t                     result = GLOBUS_SUCCESS;
443 0     GlobusFuncName(wsp_MessagePredicateAssertion_copy_contents);
444
445 0     GlobusSoapMessageDebugEnter();
446
447 0     if(src_obj->_Dialect)
448     {
449 0         result = xsd_anyURI_copy(
450             &instance->_Dialect,
451             src_obj->_Dialect);
452 0         if(result != GLOBUS_SUCCESS)
453         {
454 0             result = GlobusSoapMessageErrorCopyFailed(
455                 result, NULL, &xsd_anyURI_qname);
456 0             goto _Dialect_destroy;
457         }
458     }
459     else
460     {
461 0         instance->_Dialect = NULL;
462     }
463
464 0     if(src_obj->_Id)
465     {
466 0         result = xsd_ID_copy(
467             &instance->_Id,
468             src_obj->_Id);
469 0         if(result != GLOBUS_SUCCESS)
470         {
471 0             result = GlobusSoapMessageErrorCopyFailed(
472                 result, NULL, &xsd_ID_qname);
473 0             goto _Id_destroy;
474         }
475     }
476     else
477     {
478 0         instance->_Id = NULL;
479     }
480
481 0     if(src_obj->_Preference)
482     {
483 0         result = xsd_int_copy(
484             &instance->_Preference,
485             src_obj->_Preference);
486 0         if(result != GLOBUS_SUCCESS)
487         {
488 0             result = GlobusSoapMessageErrorCopyFailed(
489                 result, NULL, &xsd_int_qname);
490 0             goto _Preference_destroy;
491         }
492     }
493     else
494     {
495 0         instance->_Preference = NULL;
496     }
497
498 0     if(src_obj->_Usage)
499     {
500 0         result = wsp_OpenUsageType_copy(
501             &instance->_Usage,
502             src_obj->_Usage);
503 0         if(result != GLOBUS_SUCCESS)
504         {
505 0             result = GlobusSoapMessageErrorCopyFailed(
506                 result, NULL, &wsp_OpenUsageType_qname);
507 0             goto _Usage_destroy;
508         }
509     }
510     else
511     {
512 0         instance->_Usage = NULL;
513     }
514
515 0     if(src_obj->anyAttributes)
516     {
517 0         result = xsd_anyAttributes_copy(&instance->anyAttributes, 
518                                         src_obj->anyAttributes);
519 0         if(result != GLOBUS_SUCCESS)
520         {
521 0             result = GlobusSoapMessageErrorCopyAnyAttrsFailed(
522                 result, NULL);
523 0             goto xsd_anyAttributes_after_destroy;
524         }
525     }
526     else
527     {
528 0         instance->anyAttributes = NULL;
529     }
530
531 0     result = xsd_string_copy_contents(
532         &instance->base_value,
533         &src_obj->base_value);
534 0     if(result != GLOBUS_SUCCESS)
535     {
536 0         result = GlobusSoapMessageErrorCopyFailed(
537             result, NULL,  &xsd_string_qname);
538 0         goto base_value_destroy;
539     }
540
541 0     goto exit;
542
543  fail_deserialize:
544
545  xsd_anyAttributes_destroy:
546 0         xsd_anyAttributes_destroy(instance->anyAttributes);
547 0         instance->anyAttributes = NULL;
548  xsd_anyAttributes_after_destroy:
549 0         xsd_string_destroy_contents(
550             &instance->base_value);
551
552  base_value_destroy:
553
554  _Dialect_destroy:
555
556 0     if(instance->_Dialect)
557     {
558 0         xsd_anyURI_destroy(
559             instance->_Dialect);
560 0         instance->_Dialect = NULL;
561     }
562
563  _Id_destroy:
564
565 0     if(instance->_Id)
566     {
567 0         xsd_ID_destroy(
568             instance->_Id);
569 0         instance->_Id = NULL;
570     }
571
572  _Preference_destroy:
573
574 0     if(instance->_Preference)
575     {
576 0         xsd_int_destroy(
577             instance->_Preference);
578 0         instance->_Preference = NULL;
579     }
580
581  _Usage_destroy:
582
583 0     if(instance->_Usage)
584     {
585 0         wsp_OpenUsageType_destroy(
586             instance->_Usage);
587 0         instance->_Usage = NULL;
588     }
589
590
591  exit:
592
593 0     GlobusSoapMessageDebugExit();
594 0     return result;
595 }
596
597
598
599 globus_result_t
600 wsp_MessagePredicateAssertion_serialize_contents(
601     const xsd_QName *                   element_qname, /* ignored */
602     const wsp_MessagePredicateAssertion *              inst,
603     globus_soap_message_handle_t        message_handle,
604     globus_xsd_element_options_t        options)
605 0 {
606 0     globus_result_t                     result = GLOBUS_SUCCESS;
607 0     GlobusFuncName(wsp_MessagePredicateAssertion_serialize_contents);
608 0     GlobusSoapMessageDebugEnter();
609
610 0     result = wsp_MessagePredicateAssertion_serialize(
611         NULL,
612         inst,
613         message_handle,
614         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
615 0     if(result != GLOBUS_SUCCESS)
616     {
617 0         result = GlobusSoapMessageErrorSerializeFailed(
618             result, NULL, element_qname);
619         goto exit;
620     }
621
622  exit:
623
624 0     GlobusSoapMessageDebugExit();
625 0     return result;
626 }
627
628
629
630 globus_result_t
631 wsp_MessagePredicateAssertion_serialize(
632     const xsd_QName *                   element_qname,
633     const wsp_MessagePredicateAssertion *              instance,
634     globus_soap_message_handle_t        message_handle,
635     globus_xsd_element_options_t        options)
636 0 {
637 0     globus_result_t                     result = GLOBUS_SUCCESS;
638 0     xsd_QName                           subelement;
639 0     globus_list_t *                     any_attr_keys = NULL;
640 0     globus_list_t *                     any_attr_keys_iterator = NULL;
641 0     xsd_QName *                         type_attr = NULL;
642
643 0     char *                              prefix = NULL;
644 0     int                                 prefix_created;
645 0     int                                 define_prefix = 0;
646 0     int                                 save_options = options;
647
648 0     GlobusFuncName(wsp_MessagePredicateAssertion_serialize);
649 0     GlobusSoapMessageDebugEnter();
650
651
652 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
653     {
654         /* serialize wsp_MessagePredicateAssertion element */
655 0 result = globus_soap_message_element_ns_set(
656             message_handle,
657             element_qname,
658             element_qname->Namespace,
659             &options);
660 0         if(result != GLOBUS_SUCCESS)
661         {
662 0             result = GlobusSoapMessageErrorSerializeFailed(
663                 result, NULL, element_qname);
664 0             goto exit;
665         }
666
667 0         if(instance->_Dialect)
668         {
669
670 0         result = globus_soap_message_attribute_ns_set(
671             message_handle,
672             element_qname,
673             NULL,
674              &options);
675
676 0         if(result != GLOBUS_SUCCESS)
677         {
678 0             xsd_QName               error_qname;
679 0             error_qname.local = prefix;
680 0             error_qname.Namespace = "";
681 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
682                                                            NULL, 
683                                                            &error_qname);
684 0             goto exit;
685         }
686
687
688         }
689
690 0         if(instance->_Id)
691         {
692
693 0         result = globus_soap_message_attribute_ns_set(
694             message_handle,
695             element_qname,
696             "http://schemas.xmlsoap.org/ws/2002/07/utility",
697              &options);
698
699 0         if(result != GLOBUS_SUCCESS)
700         {
701 0             xsd_QName               error_qname;
702 0             error_qname.local = prefix;
703 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
704 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
705                                                            NULL, 
706                                                            &error_qname);
707 0             goto exit;
708         }
709
710
711         }
712
713 0         if(instance->_Preference)
714         {
715
716 0         result = globus_soap_message_attribute_ns_set(
717             message_handle,
718             element_qname,
719             "http://schemas.xmlsoap.org/ws/2002/12/policy",
720              &options);
721
722 0         if(result != GLOBUS_SUCCESS)
723         {
724 0             xsd_QName               error_qname;
725 0             error_qname.local = prefix;
726 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
727 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
728                                                            NULL, 
729                                                            &error_qname);
730 0             goto exit;
731         }
732
733
734         }
735
736 0         if(instance->_Usage)
737         {
738
739 0         result = globus_soap_message_attribute_ns_set(
740             message_handle,
741             element_qname,
742             "http://schemas.xmlsoap.org/ws/2002/12/policy",
743              &options);
744
745 0         if(result != GLOBUS_SUCCESS)
746         {
747 0             xsd_QName               error_qname;
748 0             error_qname.local = prefix;
749 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
750 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
751                                                            NULL, 
752                                                            &error_qname);
753 0             goto exit;
754         }
755
756
757         }
758
759 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
760    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
761         {
762 0             result = globus_soap_message_attribute_ns_set(
763                 message_handle,
764                 element_qname,
765                 "http://www.w3.org/2001/XMLSchema-instance",
766                 &options);
767 0             if(result != GLOBUS_SUCCESS)
768             {
769 0                 result = GlobusSoapMessageErrorSerializeFailed(
770                     result, NULL, element_qname);
771 0                 goto exit;
772             }
773         }
774
775 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
776    !globus_soap_message_serialize_is_c14n_subset(message_handle))
777         {
778
779 0             result = globus_soap_message_attribute_ns_set(
780                 message_handle,
781                 element_qname,
782                 wsp_MessagePredicateAssertion_qname.Namespace,
783                 &options);
784 0             if(result != GLOBUS_SUCCESS)
785             {
786 0                 result = GlobusSoapMessageErrorSerializeFailed(
787                     result, NULL, element_qname);
788 0                 goto exit;
789             }
790         }
791
792 0         result = xsd_anyAttributes_namespace_set(
793             message_handle, element_qname, instance->anyAttributes, &options);
794 0         if(result != GLOBUS_SUCCESS)
795         {
796 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
797                 result, "Failed to set namespace");
798 0             goto exit;
799         }
800
801 0         result = globus_soap_message_serialize_element(
802             message_handle,
803             element_qname,
804             options,
805             &wsp_MessagePredicateAssertion_qname);
806 0         if(result != GLOBUS_SUCCESS)
807         {
808 0             result = GlobusSoapMessageErrorSerializeFailed(
809                 result, NULL, element_qname);
810 0             goto exit;
811         }
812
813 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
814    !globus_soap_message_serialize_is_c14n_subset(message_handle))
815         {
816 0            xsd_QName_init(&type_attr);
817        
818 0            type_attr->local = globus_libc_strdup("type");
819 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
820         }
821
822
823         /* serialize namespaces */
824 0 result = globus_soap_message_element_ns_add(
825             message_handle,
826             element_qname,
827             element_qname->Namespace,
828             &options);
829 0         if(result != GLOBUS_SUCCESS)
830         {
831 0             result = GlobusSoapMessageErrorSerializeFailed(
832                 result, NULL, element_qname);
833 0             goto exit;
834         }
835
836 0         if(instance->_Dialect)
837         {
838
839 0         result = globus_soap_message_attribute_ns_add(
840             message_handle,
841             element_qname,
842             NULL,
843              &options);
844
845 0         if(result != GLOBUS_SUCCESS)
846         {
847 0             xsd_QName               error_qname;
848 0             error_qname.local = prefix;
849 0             error_qname.Namespace = "";
850 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
851                                                            NULL, 
852                                                            &error_qname);
853 0             goto exit;
854         }
855
856
857         }
858
859 0         if(instance->_Id)
860         {
861
862 0         result = globus_soap_message_attribute_ns_add(
863             message_handle,
864             element_qname,
865             "http://schemas.xmlsoap.org/ws/2002/07/utility",
866              &options);
867
868 0         if(result != GLOBUS_SUCCESS)
869         {
870 0             xsd_QName               error_qname;
871 0             error_qname.local = prefix;
872 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
873 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
874                                                            NULL, 
875                                                            &error_qname);
876 0             goto exit;
877         }
878
879
880         }
881
882 0         if(instance->_Preference)
883         {
884
885 0         result = globus_soap_message_attribute_ns_add(
886             message_handle,
887             element_qname,
888             "http://schemas.xmlsoap.org/ws/2002/12/policy",
889              &options);
890
891 0         if(result != GLOBUS_SUCCESS)
892         {
893 0             xsd_QName               error_qname;
894 0             error_qname.local = prefix;
895 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
896 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
897                                                            NULL, 
898                                                            &error_qname);
899 0             goto exit;
900         }
901
902
903         }
904
905 0         if(instance->_Usage)
906         {
907
908 0         result = globus_soap_message_attribute_ns_add(
909             message_handle,
910             element_qname,
911             "http://schemas.xmlsoap.org/ws/2002/12/policy",
912              &options);
913
914 0         if(result != GLOBUS_SUCCESS)
915         {
916 0             xsd_QName               error_qname;
917 0             error_qname.local = prefix;
918 0             error_qname.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
919 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
920                                                            NULL, 
921                                                            &error_qname);
922 0             goto exit;
923         }
924
925
926         }
927
928 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
929    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
930         {
931 0             result = globus_soap_message_attribute_ns_add(
932                 message_handle,
933                 element_qname,
934                 "http://www.w3.org/2001/XMLSchema-instance",
935                 &options);
936 0             if(result != GLOBUS_SUCCESS)
937             {
938 0                 result = GlobusSoapMessageErrorSerializeFailed(
939                     result, NULL, element_qname);
940 0                 goto exit;
941             }
942         }
943 0         if ((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
944    !globus_soap_message_serialize_is_c14n_subset(message_handle))
945         {
946
947 0             result = globus_soap_message_attribute_ns_add(
948                 message_handle,
949                 element_qname,
950                 wsp_MessagePredicateAssertion_qname.Namespace,
951                 &options);
952 0             if(result != GLOBUS_SUCCESS)
953             {
954 0                 result = GlobusSoapMessageErrorSerializeFailed(
955                     result, NULL, element_qname);
956 0                 goto exit;
957             }
958         }
959
960 0         result = xsd_anyAttributes_namespace_add(
961             message_handle, element_qname, instance->anyAttributes, &options);
962 0         if(result != GLOBUS_SUCCESS)
963         {
964 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
965                 result, "Failed to add namespace");
966 0             goto exit;
967         }
968
969         /* serialize attributes */
970
971 0         subelement.Namespace = "";
972 0         subelement.local = "Dialect";
973
974 0         if(instance->_Dialect)
975         {
976
977 0         result = xsd_anyURI_serialize_attribute(
978             &subelement,
979             instance->_Dialect,
980             message_handle,
981             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
982 0         if(result != GLOBUS_SUCCESS)
983         {
984 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
985                                                            NULL, 
986                                                            element_qname);
987 0             goto exit;
988         }
989
990         }
991
992 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
993 0         subelement.local = "Id";
994
995 0         if(instance->_Id)
996         {
997
998 0         result = xsd_ID_serialize_attribute(
999             &subelement,
1000             instance->_Id,
1001             message_handle,
1002             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
1003 0         if(result != GLOBUS_SUCCESS)
1004         {
1005 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
1006                                                            NULL, 
1007                                                            element_qname);
1008 0             goto exit;
1009         }
1010
1011         }
1012
1013 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
1014 0         subelement.local = "Preference";
1015
1016 0         if(instance->_Preference)
1017         {
1018
1019 0         result = xsd_int_serialize_attribute(
1020             &subelement,
1021             instance->_Preference,
1022             message_handle,
1023             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
1024 0         if(result != GLOBUS_SUCCESS)
1025         {
1026 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
1027                                                            NULL, 
1028                                                            element_qname);
1029 0             goto exit;
1030         }
1031
1032         }
1033
1034 0         subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
1035 0         subelement.local = "Usage";
1036
1037 0         if(instance->_Usage)
1038         {
1039
1040 0         result = wsp_OpenUsageType_serialize_attribute(
1041             &subelement,
1042             instance->_Usage,
1043             message_handle,
1044             options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
1045 0         if(result != GLOBUS_SUCCESS)
1046         {
1047 0             result = GlobusSoapMessageErrorSerializeFailed(result, 
1048                                                            NULL, 
1049                                                            element_qname);
1050 0             goto exit;
1051         }
1052
1053         }
1054
1055 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1056    !globus_soap_message_serialize_is_c14n_subset(message_handle))
1057         {
1058 0             result = globus_soap_message_serialize_QName_attribute(
1059                 message_handle,
1060                 type_attr,
1061                 &wsp_MessagePredicateAssertion_qname);
1062 0             if(result != GLOBUS_SUCCESS)
1063             {
1064 0                 result = GlobusSoapMessageErrorSerializeFailed(
1065                     result, NULL, element_qname);
1066 0                 goto exit;
1067             }
1068         }
1069
1070 0         if(instance->anyAttributes)
1071         {
1072 0             any_attr_keys = xsd_anyAttributes_lex_sort(
1073                 instance->anyAttributes);
1074 0             any_attr_keys_iterator = any_attr_keys;
1075         }
1076
1077
1078     }
1079
1080 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1081     {
1082 0         result = globus_soap_message_serialize_element_begin_close(
1083             message_handle, element_qname);
1084 0         if(result != GLOBUS_SUCCESS)
1085         {
1086 0             result = GlobusSoapMessageErrorSerializeFailed(
1087                 result, NULL, element_qname);
1088 0             goto exit;
1089         }
1090     }
1091 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
1092
1093
1094     /* serialize contents of type */
1095
1096 0     subelement.local = "base_value";
1097 0     subelement.Namespace = NULL;
1098
1099 0     result = xsd_string_serialize(
1100         &subelement,
1101         &instance->base_value,
1102         message_handle,
1103         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1104 0     if(result != GLOBUS_SUCCESS)
1105     {
1106 0         result = GlobusSoapMessageErrorSerializeFailed(
1107             result, NULL,  &xsd_string_qname);
1108 0         goto exit;
1109     }
1110
1111 0     options = save_options;
1112
1113 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1114     {
1115         /* add end element */
1116 0         result = globus_soap_message_serialize_element_end(
1117             message_handle,
1118             element_qname,
1119             options,
1120             &wsp_MessagePredicateAssertion_qname);
1121 0         if(result != GLOBUS_SUCCESS)
1122         {
1123 0             result = GlobusSoapMessageErrorSerializeFailed(
1124                 result, NULL, element_qname);
1125 0             goto exit;
1126         }
1127
1128 0         globus_soap_message_element_ns_remove(
1129             message_handle,
1130             element_qname->Namespace,
1131             &options);
1132
1133     /* remove namespace/prefix mappings for these types */
1134
1135 0         if(instance->_Dialect)
1136         {
1137
1138 0         globus_soap_message_attribute_ns_remove(
1139             message_handle,
1140             NULL,
1141              &options);
1142
1143         }
1144
1145 0         if(instance->_Id)
1146         {
1147
1148 0         globus_soap_message_attribute_ns_remove(
1149             message_handle,
1150             "http://schemas.xmlsoap.org/ws/2002/07/utility",
1151              &options);
1152
1153         }
1154
1155 0         if(instance->_Preference)
1156         {
1157
1158 0         globus_soap_message_attribute_ns_remove(
1159             message_handle,
1160             "http://schemas.xmlsoap.org/ws/2002/12/policy",
1161              &options);
1162
1163         }
1164
1165 0         if(instance->_Usage)
1166         {
1167
1168 0         globus_soap_message_attribute_ns_remove(
1169             message_handle,
1170             "http://schemas.xmlsoap.org/ws/2002/12/policy",
1171              &options);
1172
1173         }
1174
1175 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1176    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
1177         {
1178 0             globus_soap_message_attribute_ns_remove(
1179                 message_handle,
1180                 "http://www.w3.org/2001/XMLSchema-instance",
1181                 &options);
1182         }           
1183 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
1184    !globus_soap_message_serialize_is_c14n_subset(message_handle))
1185         {
1186 0             globus_soap_message_attribute_ns_remove(
1187                 message_handle,
1188                 wsp_MessagePredicateAssertion_qname.Namespace,
1189                 &options);
1190         }           
1191
1192 0         result = xsd_anyAttributes_namespace_remove(
1193             message_handle, instance->anyAttributes, &options);
1194 0         if(result != GLOBUS_SUCCESS)
1195         {
1196 0             result = GlobusSoapMessageErrorSerializeAnyAttrsFailed(
1197                 result, "Failed to remove namespace");
1198             goto exit;
1199         }
1200
1201     }
1202
1203  exit:
1204 0     if (type_attr)
1205     {
1206 0         xsd_QName_destroy(type_attr);
1207     }
1208
1209
1210 0     if(any_attr_keys)
1211     {
1212 0         globus_list_free(any_attr_keys);
1213     }
1214
1215 0     GlobusSoapMessageDebugExit();
1216 0     return result;
1217 }
1218
1219
1220
1221 globus_result_t
1222 wsp_MessagePredicateAssertion_deserialize_contents(
1223     const xsd_QName *                   element_qname, /* ignored */
1224     wsp_MessagePredicateAssertion *                    inst,
1225     globus_soap_message_handle_t        message_handle,
1226     globus_xsd_element_options_t        options)
1227 0 {
1228 0     globus_result_t                     result = GLOBUS_SUCCESS;
1229 0     GlobusFuncName(wsp_MessagePredicateAssertion_deserialize_contents);
1230 0     GlobusSoapMessageDebugEnter();
1231
1232 0     result = wsp_MessagePredicateAssertion_deserialize(
1233         NULL,
1234         inst,
1235         message_handle,
1236         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1237 0     if(result != GLOBUS_SUCCESS)
1238     {
1239 0         result = GlobusSoapMessageErrorDeserializeFailed(
1240             result, element_qname);
1241         goto exit;
1242     }
1243
1244  exit:
1245
1246 0     GlobusSoapMessageDebugExit();
1247 0     return result;
1248 }
1249
1250
1251
1252 globus_result_t
1253 wsp_MessagePredicateAssertion_deserialize(
1254     const xsd_QName *                   element_qname,
1255     wsp_MessagePredicateAssertion *                    instance,
1256     globus_soap_message_handle_t        message_handle,
1257     globus_xsd_element_options_t        options)
1258 0 {
1259 0     globus_result_t                     result = GLOBUS_SUCCESS;
1260 0     xsd_QName                           subelement;
1261 0     GlobusFuncName(wsp_MessagePredicateAssertion_deserialize);
1262 0     GlobusSoapMessageDebugEnter();
1263
1264
1265 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1266     {
1267 0         result = globus_soap_message_deserialize_element(
1268             message_handle, element_qname);
1269 0         if(result != GLOBUS_SUCCESS)
1270         {
1271 0             result = GlobusSoapMessageErrorDeserializeFailed(
1272                 result, element_qname);
1273 0             goto exit;
1274         }
1275
1276 0     subelement.Namespace = "";
1277 0     subelement.local = "Dialect";
1278
1279 0     result = xsd_anyURI_deserialize_attribute_pointer(
1280         &subelement,
1281         &instance->_Dialect,
1282         message_handle,
1283         0);
1284 0     if(result != GLOBUS_SUCCESS)
1285     {
1286 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1287 0         goto _Dialect_destroy;
1288     }
1289
1290
1291 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
1292 0     subelement.local = "Id";
1293
1294 0     result = xsd_ID_deserialize_attribute_pointer(
1295         &subelement,
1296         &instance->_Id,
1297         message_handle,
1298         0);
1299 0     if(result != GLOBUS_SUCCESS)
1300     {
1301 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1302 0         goto _Id_destroy;
1303     }
1304
1305
1306 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
1307 0     subelement.local = "Preference";
1308
1309 0     result = xsd_int_deserialize_attribute_pointer(
1310         &subelement,
1311         &instance->_Preference,
1312         message_handle,
1313         0);
1314 0     if(result != GLOBUS_SUCCESS)
1315     {
1316 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1317 0         goto _Preference_destroy;
1318     }
1319
1320
1321 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
1322 0     subelement.local = "Usage";
1323
1324 0     result = wsp_OpenUsageType_deserialize_attribute_pointer(
1325         &subelement,
1326         &instance->_Usage,
1327         message_handle,
1328         0);
1329 0     if(result != GLOBUS_SUCCESS)
1330     {
1331 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1332 0         goto _Usage_destroy;
1333     }
1334
1335
1336 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1337 0         if(result != GLOBUS_SUCCESS)
1338         {
1339 0             result = GlobusSoapMessageErrorDeserializeFailed(
1340                 result, element_qname);
1341 0             goto xsd_anyAttributes_after_destroy;
1342         }
1343
1344 0         result = xsd_anyAttributes_deserialize(
1345             message_handle,
1346             instance->anyAttributes);
1347 0         if(result != GLOBUS_SUCCESS)
1348         {
1349 0             result = GlobusSoapMessageErrorDeserializeFailed(
1350                 result, element_qname);
1351 0             goto xsd_anyAttributes_destroy;
1352         }
1353
1354
1355 0         result = globus_soap_message_deserialize_element_begin_close(
1356             message_handle);
1357 0         if(result != GLOBUS_SUCCESS)
1358         {
1359 0             result = GlobusSoapMessageErrorDeserializeFailed(
1360                 result, element_qname);
1361 0             goto fail_deserialize;
1362         }
1363     }
1364
1365 0     subelement.local = "base_value";
1366 0     subelement.Namespace = NULL;
1367
1368 0     result = xsd_string_deserialize(
1369         &subelement,
1370         &instance->base_value,
1371         message_handle,
1372         GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1373 0     if(result != GLOBUS_SUCCESS)
1374     {
1375 0         result = GlobusSoapMessageErrorDeserializeFailed(
1376             result,
1377             &xsd_string_qname);
1378 0         goto base_value_destroy;
1379     }
1380
1381 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
1382     {
1383 0         result = globus_soap_message_deserialize_element_end(
1384             message_handle,
1385             element_qname);
1386 0         if(result != GLOBUS_SUCCESS)
1387         {
1388 0             result = GlobusSoapMessageErrorDeserializeFailed(
1389                 result, element_qname);
1390             goto fail_deserialize;
1391         }
1392     }
1393
1394 0     goto exit;
1395
1396  fail_deserialize:
1397
1398  xsd_anyAttributes_destroy:
1399 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1400 0         instance->anyAttributes = NULL;
1401  xsd_anyAttributes_after_destroy:
1402 0         xsd_string_destroy_contents(
1403             &instance->base_value);
1404
1405  base_value_destroy:
1406
1407  _Dialect_destroy:
1408     /* output_fail_destroy_attribute() */
1409
1410 0     if(instance->_Dialect)
1411     {
1412 0         xsd_anyURI_destroy(
1413             instance->_Dialect);
1414 0         instance->_Dialect = NULL;
1415     }
1416
1417  _Id_destroy:
1418     /* output_fail_destroy_attribute() */
1419
1420 0     if(instance->_Id)
1421     {
1422 0         xsd_ID_destroy(
1423             instance->_Id);
1424 0         instance->_Id = NULL;
1425     }
1426
1427  _Preference_destroy:
1428     /* output_fail_destroy_attribute() */
1429
1430 0     if(instance->_Preference)
1431     {
1432 0         xsd_int_destroy(
1433             instance->_Preference);
1434 0         instance->_Preference = NULL;
1435     }
1436
1437  _Usage_destroy:
1438     /* output_fail_destroy_attribute() */
1439
1440 0     if(instance->_Usage)
1441     {
1442 0         wsp_OpenUsageType_destroy(
1443             instance->_Usage);
1444 0         instance->_Usage = NULL;
1445     }
1446
1447
1448  exit:
1449
1450 0     GlobusSoapMessageDebugExit();
1451 0     return result;
1452 }
1453
1454
1455
1456 globus_result_t
1457 wsp_MessagePredicateAssertion_deserialize_pointer(
1458     const xsd_QName *                   element_qname,
1459     wsp_MessagePredicateAssertion **                   ip,
1460     globus_soap_message_handle_t        message_handle,
1461     globus_xsd_element_options_t        options)
1462 0 {
1463 0     wsp_MessagePredicateAssertion * instance = NULL;
1464 0     globus_result_t                     result = GLOBUS_SUCCESS;
1465 0     xsd_QName                           subelement;
1466 0     int                                 found_attrs = 0;
1467 0     int                                 empty_element = 0;
1468 0     GlobusFuncName(wsp_MessagePredicateAssertion_deserialize_pointer);
1469 0     GlobusSoapMessageDebugEnter();
1470
1471 0     *ip = NULL;
1472
1473 0     result = globus_soap_message_deserialize_element(
1474         message_handle, element_qname);
1475 0     if(result != GLOBUS_SUCCESS &&
1476        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
1477         GlobusSoapMessageStatusFailedElementCheck(result) ||
1478         GlobusSoapMessageStatusFailedWithTextCheck(result)))
1479     {
1480 0         result = GLOBUS_SUCCESS;
1481 0         goto exit;
1482     }
1483
1484 0     if(result != GLOBUS_SUCCESS)
1485     {
1486 0         result = GlobusSoapMessageErrorDeserializeFailed(
1487             result, element_qname);
1488 0         goto exit;
1489     }
1490
1491 0     if(globus_soap_message_deserialize_element_is_empty(
1492            message_handle))
1493     {
1494 0         empty_element = 1;
1495     }
1496
1497 0     result = wsp_MessagePredicateAssertion_init(&instance);
1498 0     if(result != GLOBUS_SUCCESS)
1499     {
1500 0         result = GlobusSoapMessageErrorDeserializeFailed(
1501             result, element_qname);
1502 0         goto exit;
1503     }
1504
1505
1506 0     subelement.Namespace = "";
1507 0     subelement.local = "Dialect";
1508
1509 0     result = xsd_anyURI_deserialize_attribute_pointer(
1510         &subelement,
1511         &instance->_Dialect,
1512         message_handle,
1513         0);
1514 0     if(result != GLOBUS_SUCCESS)
1515     {
1516 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1517 0         goto _Dialect_destroy;
1518     }
1519
1520
1521 0     if(instance->_Dialect)
1522     {
1523 0         found_attrs++;
1524     }
1525
1526 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
1527 0     subelement.local = "Id";
1528
1529 0     result = xsd_ID_deserialize_attribute_pointer(
1530         &subelement,
1531         &instance->_Id,
1532         message_handle,
1533         0);
1534 0     if(result != GLOBUS_SUCCESS)
1535     {
1536 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1537 0         goto _Id_destroy;
1538     }
1539
1540
1541 0     if(instance->_Id)
1542     {
1543 0         found_attrs++;
1544     }
1545
1546 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
1547 0     subelement.local = "Preference";
1548
1549 0     result = xsd_int_deserialize_attribute_pointer(
1550         &subelement,
1551         &instance->_Preference,
1552         message_handle,
1553         0);
1554 0     if(result != GLOBUS_SUCCESS)
1555     {
1556 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1557 0         goto _Preference_destroy;
1558     }
1559
1560
1561 0     if(instance->_Preference)
1562     {
1563 0         found_attrs++;
1564     }
1565
1566 0     subelement.Namespace = "http://schemas.xmlsoap.org/ws/2002/12/policy";
1567 0     subelement.local = "Usage";
1568
1569 0     result = wsp_OpenUsageType_deserialize_attribute_pointer(
1570         &subelement,
1571         &instance->_Usage,
1572         message_handle,
1573         0);
1574 0     if(result != GLOBUS_SUCCESS)
1575     {
1576 0         result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement);
1577 0         goto _Usage_destroy;
1578     }
1579
1580
1581 0     if(instance->_Usage)
1582     {
1583 0         found_attrs++;
1584     }
1585
1586 0         result = xsd_anyAttributes_init(&instance->anyAttributes);
1587 0         if(result != GLOBUS_SUCCESS)
1588         {
1589 0             result = GlobusSoapMessageErrorDeserializeFailed(
1590                 result, element_qname);
1591 0             goto xsd_anyAttributes_after_destroy;
1592         }
1593
1594 0         result = xsd_anyAttributes_deserialize(
1595             message_handle,
1596             instance->anyAttributes);
1597 0         if(result != GLOBUS_SUCCESS)
1598         {
1599 0             result = GlobusSoapMessageErrorDeserializeFailed(
1600                 result, element_qname);
1601 0             goto xsd_anyAttributes_destroy;
1602         }
1603
1604 0         if(instance->anyAttributes &&
1605            xsd_anyAttributes_size(instance->anyAttributes) > 0)
1606         {
1607 0             found_attrs++;
1608         }
1609
1610
1611 0     if(empty_element)
1612     {
1613 0         result = globus_soap_message_deserialize_element_end(
1614             message_handle,
1615             element_qname);
1616 0         if(result != GLOBUS_SUCCESS)
1617         {
1618 0             result = GlobusSoapMessageErrorDeserializeFailed(
1619                 result, element_qname);
1620 0             goto fail_deserialize;
1621         }
1622
1623 0         *ip = instance;
1624 0         goto exit;
1625     }
1626
1627 0     result = globus_soap_message_deserialize_element_begin_close(
1628         message_handle);
1629 0     if(result != GLOBUS_SUCCESS)
1630     {
1631 0         result = GlobusSoapMessageErrorDeserializeFailed(
1632             result, element_qname);
1633 0         goto exit;
1634     }
1635
1636 0     result = wsp_MessagePredicateAssertion_deserialize(
1637             element_qname,
1638             instance,
1639             message_handle,
1640             options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
1641
1642 0     result = globus_soap_message_deserialize_element_end(
1643         message_handle,
1644         element_qname);
1645 0     if(result != GLOBUS_SUCCESS)
1646     {
1647 0         result = GlobusSoapMessageErrorDeserializeFailed(
1648             result, element_qname);
1649 0         goto fail_deserialize;
1650     }
1651
1652 0     *ip = instance;
1653
1654 0     goto exit;
1655
1656  fail_deserialize:
1657
1658  xsd_anyAttributes_destroy:
1659 0         xsd_anyAttributes_destroy(instance->anyAttributes);
1660 0         instance->anyAttributes = NULL;
1661  xsd_anyAttributes_after_destroy:
1662 0         xsd_string_destroy_contents(
1663             &instance->base_value);
1664
1665  base_value_destroy:
1666
1667  _Dialect_destroy:
1668     /* output_fail_destroy_attribute() */
1669
1670 0     if(instance->_Dialect)
1671     {
1672 0         xsd_anyURI_destroy(
1673             instance->_Dialect);
1674 0         instance->_Dialect = NULL;
1675     }
1676
1677  _Id_destroy:
1678     /* output_fail_destroy_attribute() */
1679
1680 0     if(instance->_Id)
1681     {
1682 0         xsd_ID_destroy(
1683             instance->_Id);
1684 0         instance->_Id = NULL;
1685     }
1686
1687  _Preference_destroy:
1688     /* output_fail_destroy_attribute() */
1689
1690 0     if(instance->_Preference)
1691     {
1692 0         xsd_int_destroy(
1693             instance->_Preference);
1694 0         instance->_Preference = NULL;
1695     }
1696
1697  _Usage_destroy:
1698     /* output_fail_destroy_attribute() */
1699
1700 0     if(instance->_Usage)
1701     {
1702 0         wsp_OpenUsageType_destroy(
1703             instance->_Usage);
1704 0         instance->_Usage = NULL;
1705     }
1706
1707  exit:
1708
1709 0     GlobusSoapMessageDebugExit();
1710 0     return result;
1711 }
1712
1713
1714 globus_result_t
1715 wsp_MessagePredicateAssertion_array_init_contents(
1716     wsp_MessagePredicateAssertion_array * array)
1717 0 {
1718 0     return globus_xsd_generic_array_init_contents(
1719         (globus_xsd_generic_array_t *) array,
1720         &wsp_MessagePredicateAssertion_info);
1721 }
1722 /* wsp_MessagePredicateAssertion_array_init_contents() */
1723
1724 globus_result_t
1725 wsp_MessagePredicateAssertion_array_init(
1726     wsp_MessagePredicateAssertion_array ** arr)
1727 0 {
1728 0     return globus_xsd_generic_array_init(
1729         (globus_xsd_generic_array_t **) arr,
1730         &wsp_MessagePredicateAssertion_info);
1731 }
1732 /* wsp_MessagePredicateAssertion_array_init() */
1733
1734 void
1735 wsp_MessagePredicateAssertion_array_destroy_contents(
1736     wsp_MessagePredicateAssertion_array * array)
1737 0 {
1738 0     globus_xsd_generic_array_destroy_contents(
1739         (globus_xsd_generic_array_t *) array);
1740 }
1741 /* wsp_MessagePredicateAssertion_array_destroy_contents() */
1742
1743 void
1744 wsp_MessagePredicateAssertion_array_destroy(
1745     wsp_MessagePredicateAssertion_array * array)
1746 0 {
1747 0     globus_xsd_generic_array_destroy(
1748         (globus_xsd_generic_array_t *) array);
1749 }
1750 /* wsp_MessagePredicateAssertion_array_destroy() */
1751
1752 globus_result_t
1753 wsp_MessagePredicateAssertion_array_copy(
1754     wsp_MessagePredicateAssertion_array ** dest_arr,
1755     const wsp_MessagePredicateAssertion_array * src_arr)
1756 0 {
1757 0     return globus_xsd_generic_array_copy(
1758         (globus_xsd_generic_array_t **) dest_arr,
1759         (globus_xsd_generic_array_t *) src_arr);
1760 }
1761 /* wsp_MessagePredicateAssertion_array_copy() */
1762
1763 globus_result_t
1764 wsp_MessagePredicateAssertion_array_copy_contents(
1765     wsp_MessagePredicateAssertion_array * dest_arr,
1766     const wsp_MessagePredicateAssertion_array * src_arr)
1767 0 {
1768 0     return globus_xsd_generic_array_copy_contents(
1769         (globus_xsd_generic_array_t *) dest_arr,
1770         (globus_xsd_generic_array_t *) src_arr);
1771 }
1772 /* wsp_MessagePredicateAssertion_array_copy_contents() */
1773
1774 wsp_MessagePredicateAssertion *
1775 wsp_MessagePredicateAssertion_array_push(
1776     wsp_MessagePredicateAssertion_array * array)
1777 0 {
1778     /* Some contents initializers don't initialize subelments but to set their
1779      * values to be NULL
1780      */
1781 0     if (array->type_info == NULL)
1782     {
1783 0         array->type_info = &wsp_MessagePredicateAssertion_info;
1784     }
1785
1786 0     return globus_xsd_generic_array_push(
1787         (globus_xsd_generic_array_t *) array);
1788 }
1789 /* wsp_MessagePredicateAssertion_array_push() */
1790
1791 void *
1792 wsp_MessagePredicateAssertion_array_push_wrapper(
1793     void * array)
1794 0 {
1795 0     return (void *) wsp_MessagePredicateAssertion_array_push((wsp_MessagePredicateAssertion_array *) array);
1796 }
1797
1798 globus_result_t
1799 wsp_MessagePredicateAssertion_array_serialize(
1800     const xsd_QName *                   element_qname,
1801     const wsp_MessagePredicateAssertion_array *        array,
1802     globus_soap_message_handle_t        message,
1803     globus_xsd_element_options_t        options)
1804 0 {
1805 0     return globus_xsd_generic_array_serialize(
1806         element_qname,
1807         (const globus_xsd_generic_array_t *) array,
1808         message,
1809         options);
1810 }
1811 /* wsp_MessagePredicateAssertion_array_serialize() */
1812
1813 globus_result_t
1814 wsp_MessagePredicateAssertion_array_deserialize(
1815     const xsd_QName *                   element_qname,
1816     wsp_MessagePredicateAssertion_array * array,
1817     globus_soap_message_handle_t        message,
1818     globus_xsd_element_options_t        options)
1819 0 {
1820     /* Some initializers set the array's contents to NULL */
1821 0     if (array->type_info == NULL)
1822     {
1823 0         array->type_info = &wsp_MessagePredicateAssertion_info;
1824     }
1825 0     return globus_xsd_generic_array_deserialize(
1826         element_qname,
1827         (globus_xsd_generic_array_t *) array,
1828         message,
1829         options);