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