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 "nptest_DestroyTopicTestType.h"
26
27 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
28 xsd_QName nptest_DestroyTopicTestType_qname =
29 {
30     NPTEST_DESTROYTOPICTESTTYPE_NS,
31     NPTEST_DESTROYTOPICTESTTYPE_LOCAL
32 };
33 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
34
35 globus_result_t
36 nptest_DestroyTopicTestType_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 nptest_DestroyTopicTestType_serialize(
43         element_qname,
44         (const nptest_DestroyTopicTestType *) instance,
45         message_handle, options);
46 }
47
48 globus_result_t
49 nptest_DestroyTopicTestType_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 nptest_DestroyTopicTestType_deserialize_pointer(
56         element_qname,
57         (nptest_DestroyTopicTestType **) ip,
58         message_handle, options);
59 }
60
61 globus_result_t
62 nptest_DestroyTopicTestType_init_wrapper(void **object)
63 0 {
64 0     return nptest_DestroyTopicTestType_init(
65         (nptest_DestroyTopicTestType **) object);
66 }
67
68 void
69 nptest_DestroyTopicTestType_destroy_wrapper(
70     void *                          object)
71 0 {
72 0     nptest_DestroyTopicTestType_destroy(
73         (nptest_DestroyTopicTestType *) object);
74 }
75
76 globus_result_t
77 nptest_DestroyTopicTestType_copy_wrapper(
78     void **                         dest_obj,
79     const void *                    src_obj)
80 0 {
81 0     return nptest_DestroyTopicTestType_copy(
82         (nptest_DestroyTopicTestType **) dest_obj,
83         (nptest_DestroyTopicTestType *) src_obj);
84 }
85
86 globus_result_t
87 nptest_DestroyTopicTestType_init_contents_wrapper(void *object)
88 0 {
89 0     return nptest_DestroyTopicTestType_init_contents(
90         (nptest_DestroyTopicTestType *) object);
91 }
92
93 void
94 nptest_DestroyTopicTestType_destroy_contents_wrapper(
95     void *                          object)
96 0 {
97 0     nptest_DestroyTopicTestType_destroy_contents(
98         (nptest_DestroyTopicTestType *) object);
99 }
100
101 globus_result_t
102 nptest_DestroyTopicTestType_copy_contents_wrapper(
103     void *                          dest_obj,
104     const void *                    src_obj)
105 0 {
106 0     return nptest_DestroyTopicTestType_copy_contents(
107         (nptest_DestroyTopicTestType *) dest_obj,
108         (const nptest_DestroyTopicTestType *) src_obj);
109 }
110
111 globus_result_t
112 nptest_DestroyTopicTestType_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 nptest_DestroyTopicTestType_serialize_contents(
119         element_qname,
120         (nptest_DestroyTopicTestType *) instance,
121         message_handle, options);
122 }
123
124 globus_result_t
125 nptest_DestroyTopicTestType_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(nptest_DestroyTopicTestType_deserialize_contents_wrapper);
133 0     GlobusSoapMessageDebugEnter();
134
135 0     if(!*instance)
136     {
137 0         result = nptest_DestroyTopicTestType_init(
138             (nptest_DestroyTopicTestType **)instance);
139 0         if(result != GLOBUS_SUCCESS)
140         {
141 0             goto error;
142         }
143     }
144
145 0     result = nptest_DestroyTopicTestType_deserialize_contents(
146         element_qname,
147         *(nptest_DestroyTopicTestType **)instance,
148         message_handle, options);
149 error:
150 0     GlobusSoapMessageDebugExit();
151 0     return result;
152 }
153
154 globus_result_t
155 nptest_DestroyTopicTestType_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 nptest_DestroyTopicTestType_array_serialize(
162         element,
163         (nptest_DestroyTopicTestType_array *) instance,
164         message, options);
165 }
166
167 globus_result_t
168 nptest_DestroyTopicTestType_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 = nptest_DestroyTopicTestType_array_init(
179             (nptest_DestroyTopicTestType_array **)inst);
180 0         if(result != GLOBUS_SUCCESS)
181         {
182 0             return result;
183         }
184     }
185
186 0     return nptest_DestroyTopicTestType_array_deserialize(
187         element_qname,
188         *(nptest_DestroyTopicTestType_array **) inst,
189         message, options);
190 }
191
192 globus_result_t
193 nptest_DestroyTopicTestType_array_init_wrapper(
194     void **                             arr)
195 0 {
196 0     return nptest_DestroyTopicTestType_array_init(
197         (nptest_DestroyTopicTestType_array **) arr);
198 }
199
200 void
201 nptest_DestroyTopicTestType_array_destroy_wrapper(
202     void *                              arr)
203 0 {
204 0     nptest_DestroyTopicTestType_array_destroy(
205         (nptest_DestroyTopicTestType_array *) arr);
206 }
207
208 globus_result_t
209 nptest_DestroyTopicTestType_array_copy_wrapper(
210     void **                             dest_arr,
211     const void *                        src_arr)
212 0 {
213 0     return nptest_DestroyTopicTestType_array_copy(
214         (nptest_DestroyTopicTestType_array **) dest_arr,
215         (const nptest_DestroyTopicTestType_array *) src_arr);
216 }
217
218 globus_result_t
219 nptest_DestroyTopicTestType_array_init_contents_wrapper(
220     void *                              arr)
221 0 {
222 0     return nptest_DestroyTopicTestType_array_init_contents(
223         (nptest_DestroyTopicTestType_array *) arr);
224 }
225
226 void
227 nptest_DestroyTopicTestType_array_destroy_contents_wrapper(
228     void *                              arr)
229 0 {
230 0     nptest_DestroyTopicTestType_array_destroy_contents(
231         (nptest_DestroyTopicTestType_array *) arr);
232 }
233
234 globus_result_t
235 nptest_DestroyTopicTestType_array_copy_contents_wrapper(
236     void *                              dest_arr,
237     const void *                        src_arr)
238 0 {
239 0     return nptest_DestroyTopicTestType_array_copy_contents(
240         (nptest_DestroyTopicTestType_array *) dest_arr,
241         (const nptest_DestroyTopicTestType_array *) src_arr);
242 }
243
244 struct globus_xsd_type_info_s nptest_DestroyTopicTestType_contents_info =
245 {
246     &nptest_DestroyTopicTestType_qname,
247     nptest_DestroyTopicTestType_serialize_contents_wrapper,
248     nptest_DestroyTopicTestType_deserialize_contents_wrapper,
249     nptest_DestroyTopicTestType_init_wrapper,
250     nptest_DestroyTopicTestType_destroy_wrapper,
251     nptest_DestroyTopicTestType_copy_wrapper,
252     nptest_DestroyTopicTestType_init_contents_wrapper,
253     nptest_DestroyTopicTestType_destroy_contents_wrapper,
254     nptest_DestroyTopicTestType_copy_contents_wrapper,
255     sizeof(nptest_DestroyTopicTestType),
256     NULL,
257     NULL,
258     NULL
259 };
260
261 struct globus_xsd_type_info_s nptest_DestroyTopicTestType_array_info =
262 {
263     &nptest_DestroyTopicTestType_qname,
264     nptest_DestroyTopicTestType_array_serialize_wrapper,
265     nptest_DestroyTopicTestType_array_deserialize_wrapper,
266     nptest_DestroyTopicTestType_array_init_wrapper,
267     nptest_DestroyTopicTestType_array_destroy_wrapper,
268     nptest_DestroyTopicTestType_array_copy_wrapper,
269     nptest_DestroyTopicTestType_array_init_contents_wrapper,
270     nptest_DestroyTopicTestType_array_destroy_contents_wrapper,
271     nptest_DestroyTopicTestType_array_copy_contents_wrapper,
272     sizeof(nptest_DestroyTopicTestType),
273     nptest_DestroyTopicTestType_array_push_wrapper,
274     NULL,
275     NULL
276 };
277
278 struct globus_xsd_type_info_s nptest_DestroyTopicTestType_info =
279 {
280     &nptest_DestroyTopicTestType_qname,
281     nptest_DestroyTopicTestType_serialize_wrapper,
282     nptest_DestroyTopicTestType_deserialize_pointer_wrapper,
283     nptest_DestroyTopicTestType_init_wrapper,
284     nptest_DestroyTopicTestType_destroy_wrapper,
285     nptest_DestroyTopicTestType_copy_wrapper,
286     nptest_DestroyTopicTestType_init_contents_wrapper,
287     nptest_DestroyTopicTestType_destroy_contents_wrapper,
288     nptest_DestroyTopicTestType_copy_contents_wrapper,
289     sizeof(nptest_DestroyTopicTestType),
290     NULL,
291     &nptest_DestroyTopicTestType_contents_info,
292     &nptest_DestroyTopicTestType_array_info
293 };
294
295 globus_result_t
296 nptest_DestroyTopicTestType_init_contents(
297     nptest_DestroyTopicTestType * instance)
298 0 {
299 0     globus_result_t                     result = GLOBUS_SUCCESS;
300 0     GlobusFuncName(nptest_DestroyTopicTestType_init_contents);
301 0     GlobusSoapMessageDebugEnter();
302
303 0     memset(instance, 0, sizeof(nptest_DestroyTopicTestType));
304
305 0     GlobusSoapMessageDebugExit();
306 0     return result;
307 }
308
309 globus_result_t
310 nptest_DestroyTopicTestType_init(
311     nptest_DestroyTopicTestType ** object)
312 0 {
313 0     nptest_DestroyTopicTestType * instance;
314 0     globus_result_t                     result = GLOBUS_SUCCESS;
315 0     GlobusFuncName(nptest_DestroyTopicTestType_init);
316 0     GlobusSoapMessageDebugEnter();
317
318 0     instance = globus_malloc(sizeof(nptest_DestroyTopicTestType));
319 0     if(!instance)
320     {
321 0         result = GlobusSoapMessageErrorOutOfMemory;
322 0         goto exit;
323     }
324
325 0     memset(instance, 0, sizeof(nptest_DestroyTopicTestType));
326
327 0     *object = instance;
328
329  exit:
330 0     GlobusSoapMessageDebugExit();
331 0     return result;
332 }
333
334 void
335 nptest_DestroyTopicTestType_destroy(
336     nptest_DestroyTopicTestType * instance)
337 0 {
338 0     GlobusFuncName(nptest_DestroyTopicTestType_destroy);
339 0     GlobusSoapMessageDebugEnter();
340
341 0     if(!instance)
342     {
343 0         goto exit;
344     }
345
346 0     nptest_DestroyTopicTestType_destroy_contents(instance);
347 0     globus_free(instance);
348
349  exit:
350
351 0     GlobusSoapMessageDebugExit();
352 }
353
354
355 void
356 nptest_DestroyTopicTestType_destroy_contents(
357     nptest_DestroyTopicTestType * instance)
358 1 {
359 1     GlobusFuncName(nptest_DestroyTopicTestType_destroy_contents);
360 1     GlobusSoapMessageDebugEnter();
361
362 1     if(instance)
363     {
364
365
366 1     wsnt_TopicExpressionType_destroy_contents(
367          &instance->DestroyTopic);
368
369 1     nptest_DestroyTopicTestType_choice_destroy_contents(
370          &instance->choice_value);
371
372     }
373
374 1     GlobusSoapMessageDebugExit();
375 }
376
377
378 globus_result_t
379 nptest_DestroyTopicTestType_copy(
380     nptest_DestroyTopicTestType ** dest_obj,
381     const nptest_DestroyTopicTestType * src_obj)
382 0 {
383 0     globus_result_t                     result = GLOBUS_SUCCESS;
384 0     nptest_DestroyTopicTestType * instance;
385 0     GlobusFuncName(nptest_DestroyTopicTestType_copy);
386
387 0     GlobusSoapMessageDebugEnter();
388
389 0     instance = calloc(1, sizeof(nptest_DestroyTopicTestType));
390 0     if (instance == NULL)
391     {
392 0         GlobusSoapMessageDebugExit();
393 0         return GlobusSoapMessageErrorOutOfMemory;
394     }
395
396 0     result = nptest_DestroyTopicTestType_copy_contents(instance, src_obj);
397 0     if(result != GLOBUS_SUCCESS)
398     {
399 0         globus_free(instance);
400 0         GlobusSoapMessageDebugExit();
401 0         return GlobusSoapMessageErrorOutOfMemory;
402     }
403
404 0     *dest_obj = instance;
405 0     GlobusSoapMessageDebugExit();
406 0     return result;
407 }
408
409 globus_result_t
410 nptest_DestroyTopicTestType_copy_contents(
411     nptest_DestroyTopicTestType * instance,
412     const nptest_DestroyTopicTestType * src_obj)
413 1 {
414 1     globus_result_t                     result = GLOBUS_SUCCESS;
415 1     GlobusFuncName(nptest_DestroyTopicTestType_copy_contents);
416
417 1     GlobusSoapMessageDebugEnter();
418
419 1     result = wsnt_TopicExpressionType_copy_contents(
420         &instance->DestroyTopic,
421         &src_obj->DestroyTopic);
422 1     if(result != GLOBUS_SUCCESS)
423     {
424 0         result = GlobusSoapMessageErrorCopyFailed(
425                 result, NULL, &wsnt_TopicExpressionType_qname);
426 0         goto DestroyTopic_destroy;
427     }
428
429 1     result = nptest_DestroyTopicTestType_choice_copy_contents(
430         &instance->choice_value,
431         &src_obj->choice_value);
432 1     if(result != GLOBUS_SUCCESS)
433     {
434 0         result = GlobusSoapMessageErrorCopyFailed(
435                 result, NULL, &nptest_DestroyTopicTestType_choice_qname);
436         goto choice_value_destroy;
437     }
438
439 0     goto exit;
440
441  fail_deserialize:
442 0         nptest_DestroyTopicTestType_choice_destroy_contents(
443              &instance->choice_value);
444
445  choice_value_destroy:
446 0         wsnt_TopicExpressionType_destroy_contents(
447              &instance->DestroyTopic);
448
449  DestroyTopic_destroy:
450
451
452  exit:
453
454 1     GlobusSoapMessageDebugExit();
455 1     return result;
456 }
457
458
459
460 globus_result_t
461 nptest_DestroyTopicTestType_serialize_contents(
462     const xsd_QName *                   element_qname, /* ignored */
463     const nptest_DestroyTopicTestType *              inst,
464     globus_soap_message_handle_t        message_handle,
465     globus_xsd_element_options_t        options)
466 0 {
467 0     globus_result_t                     result = GLOBUS_SUCCESS;
468 0     GlobusFuncName(nptest_DestroyTopicTestType_serialize_contents);
469 0     GlobusSoapMessageDebugEnter();
470
471 0     result = nptest_DestroyTopicTestType_serialize(
472         NULL,
473         inst,
474         message_handle,
475         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
476 0     if(result != GLOBUS_SUCCESS)
477     {
478 0         result = GlobusSoapMessageErrorSerializeFailed(
479             result, NULL, element_qname);
480         goto exit;
481     }
482
483  exit:
484
485 0     GlobusSoapMessageDebugExit();
486 0     return result;
487 }
488
489
490
491 globus_result_t
492 nptest_DestroyTopicTestType_serialize(
493     const xsd_QName *                   element_qname,
494     const nptest_DestroyTopicTestType *              instance,
495     globus_soap_message_handle_t        message_handle,
496     globus_xsd_element_options_t        options)
497 0 {
498 0     globus_result_t                     result = GLOBUS_SUCCESS;
499 0     xsd_QName                           subelement;
500 0     globus_list_t *                     any_attr_keys = NULL;
501 0     globus_list_t *                     any_attr_keys_iterator = NULL;
502 0     xsd_QName *                         type_attr = NULL;
503
504 0     char *                              prefix = NULL;
505 0     int                                 prefix_created;
506 0     int                                 define_prefix = 0;
507 0     int                                 save_options = options;
508
509 0     GlobusFuncName(nptest_DestroyTopicTestType_serialize);
510 0     GlobusSoapMessageDebugEnter();
511
512
513 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
514     {
515         /* serialize nptest_DestroyTopicTestType element */
516 0 result = globus_soap_message_element_ns_set(
517             message_handle,
518             element_qname,
519             element_qname->Namespace,
520             &options);
521 0         if(result != GLOBUS_SUCCESS)
522         {
523 0             result = GlobusSoapMessageErrorSerializeFailed(
524                 result, NULL, element_qname);
525 0             goto exit;
526         }
527
528 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
529    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
530         {
531 0             result = globus_soap_message_attribute_ns_set(
532                 message_handle,
533                 element_qname,
534                 "http://www.w3.org/2001/XMLSchema-instance",
535                 &options);
536 0             if(result != GLOBUS_SUCCESS)
537             {
538 0                 result = GlobusSoapMessageErrorSerializeFailed(
539                     result, NULL, element_qname);
540 0                 goto exit;
541             }
542         }
543
544 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
545    !globus_soap_message_serialize_is_c14n_subset(message_handle))
546         {
547
548 0             result = globus_soap_message_attribute_ns_set(
549                 message_handle,
550                 element_qname,
551                 nptest_DestroyTopicTestType_qname.Namespace,
552                 &options);
553 0             if(result != GLOBUS_SUCCESS)
554             {
555 0                 result = GlobusSoapMessageErrorSerializeFailed(
556                     result, NULL, element_qname);
557 0                 goto exit;
558             }
559         }
560
561 0         result = globus_soap_message_serialize_element(
562             message_handle,
563             element_qname,
564             options,
565             &nptest_DestroyTopicTestType_qname);
566 0         if(result != GLOBUS_SUCCESS)
567         {
568 0             result = GlobusSoapMessageErrorSerializeFailed(
569                 result, NULL, element_qname);
570 0             goto exit;
571         }
572
573 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
574    !globus_soap_message_serialize_is_c14n_subset(message_handle))
575         {
576 0            xsd_QName_init(&type_attr);
577        
578 0            type_attr->local = globus_libc_strdup("type");
579 0            type_attr->Namespace = globus_libc_strdup(XSI_NS);
580         }
581
582
583         /* serialize namespaces */
584 0 result = globus_soap_message_element_ns_add(
585             message_handle,
586             element_qname,
587             element_qname->Namespace,
588             &options);
589 0         if(result != GLOBUS_SUCCESS)
590         {
591 0             result = GlobusSoapMessageErrorSerializeFailed(
592                 result, NULL, element_qname);
593 0             goto exit;
594         }
595
596 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
597    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
598         {
599 0             result = globus_soap_message_attribute_ns_add(
600                 message_handle,
601                 element_qname,
602                 "http://www.w3.org/2001/XMLSchema-instance",
603                 &options);
604 0             if(result != GLOBUS_SUCCESS)
605             {
606 0                 result = GlobusSoapMessageErrorSerializeFailed(
607                     result, NULL, element_qname);
608 0                 goto exit;
609             }
610         }
611 0         if ((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
612    !globus_soap_message_serialize_is_c14n_subset(message_handle))
613         {
614
615 0             result = globus_soap_message_attribute_ns_add(
616                 message_handle,
617                 element_qname,
618                 nptest_DestroyTopicTestType_qname.Namespace,
619                 &options);
620 0             if(result != GLOBUS_SUCCESS)
621             {
622 0                 result = GlobusSoapMessageErrorSerializeFailed(
623                     result, NULL, element_qname);
624 0                 goto exit;
625             }
626         }
627
628         /* serialize attributes */
629
630 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
631    !globus_soap_message_serialize_is_c14n_subset(message_handle))
632         {
633 0             result = globus_soap_message_serialize_QName_attribute(
634                 message_handle,
635                 type_attr,
636                 &nptest_DestroyTopicTestType_qname);
637 0             if(result != GLOBUS_SUCCESS)
638             {
639 0                 result = GlobusSoapMessageErrorSerializeFailed(
640                     result, NULL, element_qname);
641 0                 goto exit;
642             }
643         }
644
645
646     }
647
648 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
649     {
650 0         result = globus_soap_message_serialize_element_begin_close(
651             message_handle, element_qname);
652 0         if(result != GLOBUS_SUCCESS)
653         {
654 0             result = GlobusSoapMessageErrorSerializeFailed(
655                 result, NULL, element_qname);
656 0             goto exit;
657         }
658     }
659 0     options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY;
660
661
662     /* serialize contents of type */
663
664 0     subelement.local = "DestroyTopic";
665 0     subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
666
667 0     result = wsnt_TopicExpressionType_serialize(
668          &subelement,
669          &instance->DestroyTopic,
670          message_handle,
671          options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
672 0     if(result != GLOBUS_SUCCESS)
673     {
674 0         result = GlobusSoapMessageErrorSerializeFailed(
675                 result, NULL, &wsnt_TopicExpressionType_qname);
676 0         goto exit;
677     }
678
679 0     subelement.local = "choice_value";
680 0     subelement.Namespace = NULL;
681
682 0     result = nptest_DestroyTopicTestType_choice_serialize(
683          &subelement,
684          &instance->choice_value,
685          message_handle,
686          options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS));
687 0     if(result != GLOBUS_SUCCESS)
688     {
689 0         result = GlobusSoapMessageErrorSerializeFailed(
690                 result, NULL, &nptest_DestroyTopicTestType_choice_qname);
691 0         goto exit;
692     }
693
694 0     options = save_options;
695
696 0     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
697     {
698         /* add end element */
699 0         result = globus_soap_message_serialize_element_end(
700             message_handle,
701             element_qname,
702             options,
703             &nptest_DestroyTopicTestType_qname);
704 0         if(result != GLOBUS_SUCCESS)
705         {
706 0             result = GlobusSoapMessageErrorSerializeFailed(
707                 result, NULL, element_qname);
708 0             goto exit;
709         }
710
711 0         globus_soap_message_element_ns_remove(
712             message_handle,
713             element_qname->Namespace,
714             &options);
715
716     /* remove namespace/prefix mappings for these types */
717
718 0         if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
719    !globus_soap_message_serialize_is_c14n_subset(message_handle)))
720         {
721 0             globus_soap_message_attribute_ns_remove(
722                 message_handle,
723                 "http://www.w3.org/2001/XMLSchema-instance",
724                 &options);
725         }           
726 0         if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) &&
727    !globus_soap_message_serialize_is_c14n_subset(message_handle))
728         {
729 0             globus_soap_message_attribute_ns_remove(
730                 message_handle,
731                 nptest_DestroyTopicTestType_qname.Namespace,
732                 &options);
733         }           
734
735     }
736
737  exit:
738 0     if (type_attr)
739     {
740 0         xsd_QName_destroy(type_attr);
741     }
742
743
744 0     if(any_attr_keys)
745     {
746 0         globus_list_free(any_attr_keys);
747     }
748
749 0     GlobusSoapMessageDebugExit();
750 0     return result;
751 }
752
753
754
755 globus_result_t
756 nptest_DestroyTopicTestType_deserialize_contents(
757     const xsd_QName *                   element_qname, /* ignored */
758     nptest_DestroyTopicTestType *                    inst,
759     globus_soap_message_handle_t        message_handle,
760     globus_xsd_element_options_t        options)
761 0 {
762 0     globus_result_t                     result = GLOBUS_SUCCESS;
763 0     GlobusFuncName(nptest_DestroyTopicTestType_deserialize_contents);
764 0     GlobusSoapMessageDebugEnter();
765
766 0     result = nptest_DestroyTopicTestType_deserialize(
767         NULL,
768         inst,
769         message_handle,
770         options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
771 0     if(result != GLOBUS_SUCCESS)
772     {
773 0         result = GlobusSoapMessageErrorDeserializeFailed(
774             result, element_qname);
775         goto exit;
776     }
777
778  exit:
779
780 0     GlobusSoapMessageDebugExit();
781 0     return result;
782 }
783
784
785
786 globus_result_t
787 nptest_DestroyTopicTestType_deserialize(
788     const xsd_QName *                   element_qname,
789     nptest_DestroyTopicTestType *                    instance,
790     globus_soap_message_handle_t        message_handle,
791     globus_xsd_element_options_t        options)
792 1 {
793 1     globus_result_t                     result = GLOBUS_SUCCESS;
794 1     xsd_QName                           subelement;
795 1     GlobusFuncName(nptest_DestroyTopicTestType_deserialize);
796 1     GlobusSoapMessageDebugEnter();
797
798
799 1     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
800     {
801 1         result = globus_soap_message_deserialize_element(
802             message_handle, element_qname);
803 1         if(result != GLOBUS_SUCCESS)
804         {
805 0             result = GlobusSoapMessageErrorDeserializeFailed(
806                 result, element_qname);
807 0             goto exit;
808         }
809
810
811 1         result = globus_soap_message_deserialize_element_begin_close(
812             message_handle);
813 1         if(result != GLOBUS_SUCCESS)
814         {
815 0             result = GlobusSoapMessageErrorDeserializeFailed(
816                 result, element_qname);
817 0             goto fail_deserialize;
818         }
819     }
820
821 1     subelement.local = "DestroyTopic";
822 1     subelement.Namespace = "http://www.globus.org/namespaces/2005/03/NotificationProducerTest";
823
824 1     result = wsnt_TopicExpressionType_deserialize(
825          &subelement,
826          &instance->DestroyTopic,
827          message_handle,
828          0);
829 1     if(result != GLOBUS_SUCCESS)
830     {
831 0         result = GlobusSoapMessageErrorDeserializeFailed(
832             result, 
833             &wsnt_TopicExpressionType_qname);
834 0         goto DestroyTopic_destroy;
835     }
836
837 1     subelement.local = "choice_value";
838 1     subelement.Namespace = NULL;
839
840 1     result = nptest_DestroyTopicTestType_choice_deserialize(
841          &subelement,
842          &instance->choice_value,
843          message_handle,
844          0);
845 1     if(result != GLOBUS_SUCCESS)
846     {
847 0         result = GlobusSoapMessageErrorDeserializeFailed(
848             result, 
849             &nptest_DestroyTopicTestType_choice_qname);
850 0         goto choice_value_destroy;
851     }
852
853 1     if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY))
854     {
855 1         result = globus_soap_message_deserialize_element_end(
856             message_handle,
857             element_qname);
858 1         if(result != GLOBUS_SUCCESS)
859         {
860 0             result = GlobusSoapMessageErrorDeserializeFailed(
861                 result, element_qname);
862             goto fail_deserialize;
863         }
864     }
865
866 0     goto exit;
867
868  fail_deserialize:
869 0         nptest_DestroyTopicTestType_choice_destroy_contents(
870              &instance->choice_value);
871
872  choice_value_destroy:
873 0         wsnt_TopicExpressionType_destroy_contents(
874              &instance->DestroyTopic);
875
876  DestroyTopic_destroy:
877
878
879  exit:
880
881 1     GlobusSoapMessageDebugExit();
882 1     return result;
883 }
884
885
886
887 globus_result_t
888 nptest_DestroyTopicTestType_deserialize_pointer(
889     const xsd_QName *                   element_qname,
890     nptest_DestroyTopicTestType **                   ip,
891     globus_soap_message_handle_t        message_handle,
892     globus_xsd_element_options_t        options)
893 0 {
894 0     nptest_DestroyTopicTestType * instance = NULL;
895 0     globus_result_t                     result = GLOBUS_SUCCESS;
896 0     xsd_QName                           subelement;
897 0     int                                 found_attrs = 0;
898 0     int                                 empty_element = 0;
899 0     GlobusFuncName(nptest_DestroyTopicTestType_deserialize_pointer);
900 0     GlobusSoapMessageDebugEnter();
901
902 0     *ip = NULL;
903
904 0     result = globus_soap_message_deserialize_element(
905         message_handle, element_qname);
906 0     if(result != GLOBUS_SUCCESS &&
907        (GlobusSoapMessageStatusElementNotFoundCheck(result) ||
908         GlobusSoapMessageStatusFailedElementCheck(result) ||
909         GlobusSoapMessageStatusFailedWithTextCheck(result)))
910     {
911 0         result = GLOBUS_SUCCESS;
912 0         goto exit;
913     }
914
915 0     if(result != GLOBUS_SUCCESS)
916     {
917 0         result = GlobusSoapMessageErrorDeserializeFailed(
918             result, element_qname);
919 0         goto exit;
920     }
921
922 0     if(globus_soap_message_deserialize_element_is_empty(
923            message_handle))
924     {
925 0         empty_element = 1;
926     }
927
928 0     result = nptest_DestroyTopicTestType_init(&instance);
929 0     if(result != GLOBUS_SUCCESS)
930     {
931 0         result = GlobusSoapMessageErrorDeserializeFailed(
932             result, element_qname);
933 0         goto exit;
934     }
935
936
937 0     if(found_attrs == 0 && 
938        globus_soap_message_deserialize_element_is_nil(message_handle))
939     {
940 0         nptest_DestroyTopicTestType_destroy(instance);
941         
942 0         result = globus_soap_message_deserialize_element_end(
943                 message_handle,
944                 element_qname);
945 0         if(result != GLOBUS_SUCCESS)
946         {
947 0             result = GlobusSoapMessageErrorDeserializeFailed(
948                 result, element_qname);
949 0             goto exit;
950         }
951
952 0         *ip = NULL;
953 0         globus_object_free(globus_error_get(result));
954 0         result = GLOBUS_SUCCESS;
955 0         goto exit;
956     }
957
958
959 0     if(empty_element)
960     {
961 0         result = globus_soap_message_deserialize_element_end(
962             message_handle,
963             element_qname);
964 0         if(result != GLOBUS_SUCCESS)
965         {
966 0             result = GlobusSoapMessageErrorDeserializeFailed(
967                 result, element_qname);
968 0             goto fail_deserialize;
969         }
970
971 0         *ip = instance;
972 0         goto exit;
973     }
974
975 0     result = globus_soap_message_deserialize_element_begin_close(
976         message_handle);
977 0     if(result != GLOBUS_SUCCESS)
978     {
979 0         result = GlobusSoapMessageErrorDeserializeFailed(
980             result, element_qname);
981 0         goto exit;
982     }
983
984 0     result = nptest_DestroyTopicTestType_deserialize(
985             element_qname,
986             instance,
987             message_handle,
988             options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY);
989
990 0     result = globus_soap_message_deserialize_element_end(
991         message_handle,
992         element_qname);
993 0     if(result != GLOBUS_SUCCESS)
994     {
995 0         result = GlobusSoapMessageErrorDeserializeFailed(
996             result, element_qname);
997 0         goto fail_deserialize;
998     }
999
1000 0     *ip = instance;
1001
1002 0     goto exit;
1003
1004  fail_deserialize:
1005 0         nptest_DestroyTopicTestType_choice_destroy_contents(
1006              &instance->choice_value);
1007
1008  choice_value_destroy:
1009 0         wsnt_TopicExpressionType_destroy_contents(
1010              &instance->DestroyTopic);
1011
1012  DestroyTopic_destroy:
1013
1014  exit:
1015
1016 0     GlobusSoapMessageDebugExit();
1017 0     return result;
1018 }
1019
1020
1021 globus_result_t
1022 nptest_DestroyTopicTestType_array_init_contents(
1023     nptest_DestroyTopicTestType_array * array)
1024 0 {
1025 0     return globus_xsd_generic_array_init_contents(
1026         (globus_xsd_generic_array_t *) array,
1027         &nptest_DestroyTopicTestType_info);
1028 }
1029 /* nptest_DestroyTopicTestType_array_init_contents() */
1030
1031 globus_result_t
1032 nptest_DestroyTopicTestType_array_init(
1033     nptest_DestroyTopicTestType_array ** arr)
1034 0 {
1035 0     return globus_xsd_generic_array_init(
1036         (globus_xsd_generic_array_t **) arr,
1037         &nptest_DestroyTopicTestType_info);
1038 }
1039 /* nptest_DestroyTopicTestType_array_init() */
1040
1041 void
1042 nptest_DestroyTopicTestType_array_destroy_contents(
1043     nptest_DestroyTopicTestType_array * array)
1044 0 {
1045 0     globus_xsd_generic_array_destroy_contents(
1046         (globus_xsd_generic_array_t *) array);
1047 }
1048 /* nptest_DestroyTopicTestType_array_destroy_contents() */
1049
1050 void
1051 nptest_DestroyTopicTestType_array_destroy(
1052     nptest_DestroyTopicTestType_array * array)
1053 0 {
1054 0     globus_xsd_generic_array_destroy(
1055         (globus_xsd_generic_array_t *) array);
1056 }
1057 /* nptest_DestroyTopicTestType_array_destroy() */
1058
1059 globus_result_t
1060 nptest_DestroyTopicTestType_array_copy(
1061     nptest_DestroyTopicTestType_array ** dest_arr,
1062     const nptest_DestroyTopicTestType_array * src_arr)
1063 0 {
1064 0     return globus_xsd_generic_array_copy(
1065         (globus_xsd_generic_array_t **) dest_arr,
1066         (globus_xsd_generic_array_t *) src_arr);
1067 }
1068 /* nptest_DestroyTopicTestType_array_copy() */
1069
1070 globus_result_t
1071 nptest_DestroyTopicTestType_array_copy_contents(
1072     nptest_DestroyTopicTestType_array * dest_arr,
1073     const nptest_DestroyTopicTestType_array * src_arr)
1074 0 {
1075 0     return globus_xsd_generic_array_copy_contents(
1076         (globus_xsd_generic_array_t *) dest_arr,
1077         (globus_xsd_generic_array_t *) src_arr);
1078 }
1079 /* nptest_DestroyTopicTestType_array_copy_contents() */
1080
1081 nptest_DestroyTopicTestType *
1082 nptest_DestroyTopicTestType_array_push(
1083     nptest_DestroyTopicTestType_array * array)
1084 0 {
1085     /* Some contents initializers don't initialize subelments but to set their
1086      * values to be NULL
1087      */
1088 0     if (array->type_info == NULL)
1089     {
1090 0         array->type_info = &nptest_DestroyTopicTestType_info;
1091     }
1092
1093 0     return globus_xsd_generic_array_push(
1094         (globus_xsd_generic_array_t *) array);
1095 }
1096 /* nptest_DestroyTopicTestType_array_push() */
1097
1098 void *
1099 nptest_DestroyTopicTestType_array_push_wrapper(
1100     void * array)
1101 0 {
1102 0     return (void *) nptest_DestroyTopicTestType_array_push((nptest_DestroyTopicTestType_array *) array);
1103 }
1104
1105 globus_result_t
1106 nptest_DestroyTopicTestType_array_serialize(
1107     const xsd_QName *                   element_qname,
1108     const nptest_DestroyTopicTestType_array *        array,
1109     globus_soap_message_handle_t        message,
1110     globus_xsd_element_options_t        options)
1111 0 {
1112 0     return globus_xsd_generic_array_serialize(
1113         element_qname,
1114         (const globus_xsd_generic_array_t *) array,
1115         message,
1116         options);
1117 }
1118 /* nptest_DestroyTopicTestType_array_serialize() */
1119
1120 globus_result_t
1121 nptest_DestroyTopicTestType_array_deserialize(
1122     const xsd_QName *                   element_qname,
1123     nptest_DestroyTopicTestType_array * array,
1124     globus_soap_message_handle_t        message,
1125     globus_xsd_element_options_t        options)
1126 0 {
1127     /* Some initializers set the array's contents to NULL */
1128 0     if (array->type_info == NULL)
1129     {
1130 0         array->type_info = &nptest_DestroyTopicTestType_info;
1131     }
1132 0     return globus_xsd_generic_array_deserialize(
1133         element_qname,
1134         (globus_xsd_generic_array_t *) array,
1135         message,
1136         options);