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 "globus_soap_message.h"
18 #include "WidgetService.h"
19 #include "WidgetService_skeleton.h"
20 #include "WidgetService_internal_skeleton.h"
21 #include "version.h"
22 #include "globus_soap_message_fault.h"
23 #include "globus_ws_addressing.h"
24 #include "globus_wsrf_resource.h"
25
26 static
27 int
28 WidgetService_module_activate();
29
30 static
31 int
32 WidgetService_module_deactivate();
33
34 globus_module_descriptor_t WidgetService_module =
35 {
36     "WidgetService_module",
37     WidgetService_module_activate,
38     WidgetService_module_deactivate,
39     NULL,
40     NULL,
41     &local_version
42 };
43
44 0 GlobusDebugDefine(WIDGETSERVICE);
45
46 static
47 int
48 WidgetService_module_activate()
49 {
50 3     int rc = 0;
51
52 3     rc = globus_module_activate(GLOBUS_COMMON_MODULE);
53 3     if(rc != GLOBUS_SUCCESS)
54     {
55 0         return rc;
56     }
57
58 3     GlobusDebugInit(WIDGETSERVICE, INFO DEBUG TRACE WARN ERROR);
59
60 3     rc = globus_module_activate(GLOBUS_SOAP_MESSAGE_MODULE);
61 3     if(rc != GLOBUS_SUCCESS)
62     {
63 0         return rc;
64     }
65
66 3     return rc;
67 }
68
69 static
70 int
71 WidgetService_module_deactivate()
72 0 {
73 0     int rc = 0;
74
75 0     rc = globus_module_deactivate(GLOBUS_SOAP_MESSAGE_MODULE);
76 0     if(rc != GLOBUS_SUCCESS)
77     {
78 0         return rc;
79     }
80
81 0     GlobusDebugDestroy(WIDGETSERVICE);
82
83 0     rc = globus_module_deactivate(GLOBUS_COMMON_MODULE);
84 0     if(rc != GLOBUS_SUCCESS)
85     {
86 0         return rc;
87     }
88
89 0     return rc;
90 }
91
92 GlobusExtensionDeclareModule(WidgetService);
93
94 xsd_QName WidgetService_service_qname =
95 {
96     "http://widgets.com/service",
97     "WidgetService"
98 };
99
100 globus_service_descriptor_t             WidgetService_descriptor =
101 {
102     &WidgetService_service_qname,
103     GLOBUS_SERVICE_ENGINE_MODULE_PATH_PREFIX "/" WIDGETSERVICE_BASE_PATH,
104     NULL,
105     NULL,
106     NULL,
107     NULL,
108     globus_resource_id_get_as_string,
109     NULL
110 };
111
112 static
113 int
114 WidgetService_activate();
115
116 static
117 int
118 WidgetService_deactivate();
119
120 GlobusExtensionDefineModule(WidgetService) =
121 {
122     "WidgetService",
123     WidgetService_activate,
124     WidgetService_deactivate,
125     NULL,
126     NULL,
127     &local_version
128 };
129
130
131 xsd_QName WidgetPortType_SetTerminationTime_op_qname = 
132 {
133     "http://widgets.com",
134     "SetTerminationTime"
135 };
136
137 xsd_QName WidgetPortType_SetTerminationTime_input_qname =
138 {
139      "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd",
140      "SetTerminationTime"
141 };
142
143 typedef globus_result_t (* SetTerminationTime_init_func_t) (
144     globus_service_engine_t             engine,
145     globus_soap_message_handle_t        message,
146     wsrl_SetTerminationTimeType * SetTerminationTime);
147
148 typedef globus_result_t (* SetTerminationTime_invoke_func_t) (
149     globus_service_engine_t             engine,
150     globus_soap_message_handle_t        message,
151     globus_service_descriptor_t *       descriptor,
152     wsrl_SetTerminationTimeType * SetTerminationTime,
153     wsrl_SetTerminationTimeResponseType * SetTerminationTimeResponse,
154     const char ** fault_type_name,
155     void ** fault);
156     
157 typedef struct SetTerminationTime_callback_handle_s
158 {
159     globus_service_engine_t                 engine;
160     globus_soap_message_handle_t            message;
161     globus_operation_invoke_callback_func_t callback;
162     void *                                  args;
163 } SetTerminationTime_callback_handle_t;
164
165
166 const char * WidgetPortType_SetTerminationTime_fault_strings[WIDGETPORTTYPE_SETTERMINATIONTIME_RESOURCEUNKNOWNFAULT] =
167 {
168     "Unknown",
169     "TerminationTimeChangeRejectedFault",
170     "UnableToSetTerminationTimeFault",
171     "ResourceUnknownFault"
172  };
173
174 static
175 WidgetPortType_SetTerminationTime_fault_t
176 SetTerminationTime_lookup_fault_type(
177     const char *                        fault_name)
178 0 {
179 0     WidgetPortType_SetTerminationTime_fault_t fault_type;
180 0     GlobusFuncName(SetTerminationTime_lookup_fault_type);
181 0     WidgetServiceDebugEnter();
182
183 0     globus_assert(fault_name);
184
185 0     if(!strcmp(fault_name, "TerminationTimeChangeRejectedFault"))
186     {
187 0         fault_type = WIDGETPORTTYPE_SETTERMINATIONTIME_TERMINATIONTIMECHANGEREJECTEDFAULT;
188     }
189 0     else if(!strcmp(fault_name, "UnableToSetTerminationTimeFault"))
190     {
191 0         fault_type = WIDGETPORTTYPE_SETTERMINATIONTIME_UNABLETOSETTERMINATIONTIMEFAULT;
192     }
193 0     else if(!strcmp(fault_name, "ResourceUnknownFault"))
194     {
195 0         fault_type = WIDGETPORTTYPE_SETTERMINATIONTIME_RESOURCEUNKNOWNFAULT;
196     }
197     else
198     {
199 0         fault_type = WIDGETPORTTYPE_SETTERMINATIONTIME_UNKNOWN_FAULT;
200     }
201
202 0     WidgetServiceDebugExit();
203 0     return fault_type;
204 }
205
206
207     
208 static
209 void
210 SetTerminationTime_deserialize_callback(
211     void *                              handle)
212 15 {
213 15     SetTerminationTime_callback_handle_t * callback_handle;
214 15     globus_result_t                     result = GLOBUS_SUCCESS;
215 15     struct globus_soap_message_fault_s  soap_fault;
216 15     SetTerminationTime_init_func_t    init_function;
217 15     SetTerminationTime_invoke_func_t  invoke_function;
218 15     wsrl_SetTerminationTimeType * SetTerminationTime;
219 15     GlobusFuncName(SetTerminationTime_deserialize_callback);
220 15     WidgetServiceDebugEnter();
221
222 15     callback_handle = (SetTerminationTime_callback_handle_t *) handle;
223
224 15     result = globus_operation_table_get_operation(
225         WidgetService_descriptor.operations,
226         "SetTerminationTime",
227         (void **)&init_function,
228         (void **)&invoke_function);
229 15     if(result != GLOBUS_SUCCESS)
230     {
231 0         goto exit;
232     }
233
234 15     if(WidgetService_descriptor.registry)
235     {
236 15         globus_soap_message_handle_set_registry(
237             callback_handle->message,
238             WidgetService_descriptor.registry);
239     }
240
241 15     result = wsrl_SetTerminationTimeType_init(
242         &SetTerminationTime);
243 15     if(result != GLOBUS_SUCCESS)
244     {
245 0         goto exit;
246     }
247
248 15     if(init_function)
249     {
250         /* do service specific initialization stuff */
251 15         result = init_function(
252             callback_handle->engine,
253             callback_handle->message,
254             SetTerminationTime);
255 15         if(result != GLOBUS_SUCCESS)
256         {
257 0             goto free_exit;
258         }
259     }
260
261 15     result = wsrl_SetTerminationTimeType_deserialize(
262         &WidgetPortType_SetTerminationTime_input_qname,
263         SetTerminationTime,
264         callback_handle->message,
265         0);
266 15     if(result != GLOBUS_SUCCESS)
267     {
268 0         goto free_exit;
269     }
270
271 15     result = globus_soap_message_handle_set_attr(
272         callback_handle->message,
273         "SetTerminationTimeOperationInputParameter",
274         wsrl_SetTerminationTimeType_copy_wrapper,
275         wsrl_SetTerminationTimeType_destroy_wrapper,
276         (void *)SetTerminationTime);
277 15     if(result != GLOBUS_SUCCESS)
278     {
279 15         goto free_exit;
280     }
281
282 free_exit:
283 15     wsrl_SetTerminationTimeType_destroy(SetTerminationTime);
284
285  exit:
286
287 15     callback_handle->callback(
288         result,
289         callback_handle->args);
290 15     free(callback_handle);
291 15     WidgetServiceDebugExit();
292 }
293 /* SetTerminationTime_deserialize_callback() */
294
295 static
296 globus_result_t
297 SetTerminationTime_deserialize(
298     globus_service_engine_t                 engine,
299     globus_soap_message_handle_t            message,
300     globus_operation_invoke_callback_func_t invoke_callback,
301     void *                                  args)
302 15 {
303 15     SetTerminationTime_callback_handle_t * callback_handle;
304 15     globus_result_t                    result = GLOBUS_SUCCESS;
305 15     GlobusFuncName(SetTerminationTime_deserialize);
306 15     WidgetServiceDebugEnter();
307
308 15     callback_handle = malloc(sizeof(SetTerminationTime_callback_handle_t));
309 15     globus_assert_string(callback_handle, 
310                          "Memory allocation failed "
311                          "for SetTerminationTime callback handle");
312 15     memset(callback_handle, 0, sizeof(SetTerminationTime_callback_handle_t));
313
314 15     callback_handle->engine = engine;
315 15     callback_handle->message = message;
316 15     callback_handle->callback = invoke_callback;
317 15     callback_handle->args = args;
318
319 15     result = globus_callback_register_oneshot(
320         NULL,
321         &globus_i_reltime_zero,
322         SetTerminationTime_deserialize_callback,
323         callback_handle);
324
325 15     WidgetServiceDebugExit();
326 15     return result;
327 }
328
329 static
330 void
331 SetTerminationTime_invoke_callback(
332     void *                              handle)
333 15 {
334 15     SetTerminationTime_callback_handle_t * callback_handle;
335 15     globus_result_t                     result = GLOBUS_SUCCESS;
336 15     struct globus_soap_message_fault_s  soap_fault;
337 15     SetTerminationTime_init_func_t    init_function;
338 15     SetTerminationTime_invoke_func_t  invoke_function;
339 15     wsrl_SetTerminationTimeType * SetTerminationTime;
340 15     wsrl_SetTerminationTimeResponseType SetTerminationTimeResponse;
341 15      xsd_QName element_qname;
342 15      const char * fault_type_name = NULL;
343 15      WidgetPortType_SetTerminationTime_fault_t fault_type = WIDGETPORTTYPE_SETTERMINATIONTIME_NOFAULT;
344 15      void *                              fault = NULL;
345     
346 15     GlobusFuncName(SetTerminationTime_invoke_callback);
347 15     WidgetServiceDebugEnter();
348
349 15     callback_handle = (SetTerminationTime_callback_handle_t *) handle;
350
351 15     SetTerminationTime = globus_soap_message_handle_get_attr(
352         callback_handle->message,
353         "SetTerminationTimeOperationInputParameter");
354 15     globus_assert(SetTerminationTime);
355
356 15     result = globus_operation_table_get_operation(
357         WidgetService_descriptor.operations,
358         "SetTerminationTime",
359         (void **)&init_function,
360         (void **)&invoke_function);
361 15     if(result != GLOBUS_SUCCESS)
362     {
363 0         goto fault_exit;
364     }
365
366
367 15     result = wsrl_SetTerminationTimeResponseType_init_contents(
368         &SetTerminationTimeResponse);
369 15     if(result != GLOBUS_SUCCESS)
370     {
371 0         goto fault_exit;
372     }
373
374 15     result = invoke_function(
375         callback_handle->engine,
376         callback_handle->message,
377         &WidgetService_descriptor,
378         SetTerminationTime,
379         &SetTerminationTimeResponse,
380         &fault_type_name,
381         &fault);
382
383 fault_exit:
384
385 15     if(fault && fault_type_name)
386     {
387 0         fault_type = SetTerminationTime_lookup_fault_type(fault_type_name);
388
389 0         result = globus_service_session_begin_response(
390             callback_handle->message);
391 0         if(result != GLOBUS_SUCCESS)
392         {
393 0             goto exit;
394         }
395         
396 0         soap_fault.faultcode = "Server";
397 0         soap_fault.faultstring = 
398         "An error occurred while processing the message";
399 0         soap_fault.faultactor = NULL;
400
401 0         switch(fault_type)
402         {
403         
404         case WIDGETPORTTYPE_SETTERMINATIONTIME_TERMINATIONTIMECHANGEREJECTEDFAULT:
405
406 0             xsd_any_init(&soap_fault.detail);
407 0             soap_fault.detail->any_info = &wsrl_TerminationTimeChangeRejectedFaultType_info;
408 0             xsd_QName_init(&soap_fault.detail->element);
409 0             soap_fault.detail->element->local = "TerminationTimeChangeRejectedFault";
410 0             soap_fault.detail->element->Namespace = 
411                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
412 0             soap_fault.detail->value = fault;
413 0             break;
414
415         case WIDGETPORTTYPE_SETTERMINATIONTIME_UNABLETOSETTERMINATIONTIMEFAULT:
416
417 0             xsd_any_init(&soap_fault.detail);
418 0             soap_fault.detail->any_info = &wsrl_UnableToSetTerminationTimeFaultType_info;
419 0             xsd_QName_init(&soap_fault.detail->element);
420 0             soap_fault.detail->element->local = "UnableToSetTerminationTimeFault";
421 0             soap_fault.detail->element->Namespace = 
422                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
423 0             soap_fault.detail->value = fault;
424 0             break;
425
426         case WIDGETPORTTYPE_SETTERMINATIONTIME_RESOURCEUNKNOWNFAULT:
427
428 0             xsd_any_init(&soap_fault.detail);
429 0             soap_fault.detail->any_info = &wsrl_ResourceUnknownFaultType_info;
430 0             xsd_QName_init(&soap_fault.detail->element);
431 0             soap_fault.detail->element->local = "ResourceUnknownFault";
432 0             soap_fault.detail->element->Namespace = 
433                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
434 0             soap_fault.detail->value = fault;
435 0             break;
436
437         default:
438 0             result = WidgetServiceErrorReturnedUnknownFault("SetTerminationTime");
439 0             goto exit;
440         }         
441
442 0         result = globus_service_session_serialize_fault_response(
443             callback_handle->message, &soap_fault);
444 0         if(result != GLOBUS_SUCCESS)
445         {
446 0             goto exit;
447         }
448
449 0         soap_fault.detail->element->local = NULL;
450 0         soap_fault.detail->element->Namespace = NULL;
451 0 soap_fault.detail->any_info = NULL;
452 0         xsd_any_destroy(soap_fault.detail);
453
454 0         globus_soap_message_handle_set_attr(
455             callback_handle->message, 
456             WSADDR_ACTION_RESPONSE_KEY,
457             globus_soap_message_attr_copy_string,
458             globus_libc_free,
459             WSADDRESSING_FAULT_NS);
460     }
461 15     else if(result != GLOBUS_SUCCESS)
462     {
463 0         globus_result_t                 local_result;
464 0         local_result = globus_service_session_begin_response(
465             callback_handle->message);
466 0         if(local_result != GLOBUS_SUCCESS)
467         {
468 0             result = local_result;
469 0             goto exit;
470         }
471
472 0         soap_fault.faultcode = "Server";
473 0         soap_fault.faultstring = globus_error_print_friendly(
474             globus_error_get(result));
475 0         result = GLOBUS_SUCCESS;
476 0         soap_fault.faultactor = NULL;
477 0         soap_fault.detail = NULL;
478 0         result = globus_service_session_serialize_fault_response(
479             callback_handle->message, &soap_fault);
480 0         if(result != GLOBUS_SUCCESS)
481         {
482 0             goto exit;
483         }
484
485 0         globus_soap_message_handle_set_attr(
486             callback_handle->message, 
487             WSADDR_ACTION_RESPONSE_KEY,
488             globus_soap_message_attr_copy_string,
489             globus_libc_free, 
490             WSADDRESSING_FAULT_NS);
491     }
492     else
493     {
494 15         result = globus_service_session_begin_response(
495             callback_handle->message);
496 15         if(result != GLOBUS_SUCCESS)
497         {
498 0             goto exit;
499         }
500
501 15         element_qname.local = "SetTerminationTimeResponse";
502 15         element_qname.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
503
504 15         result = wsrl_SetTerminationTimeResponseType_serialize(
505             &element_qname,
506             &SetTerminationTimeResponse,
507             callback_handle->message,
508             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
509 15         if(result != GLOBUS_SUCCESS)
510         {
511 0             goto exit;
512         }
513
514 15         result = globus_service_session_end_response(
515             callback_handle->message);
516 15         if(result != GLOBUS_SUCCESS)
517         {
518 0             goto exit;
519         }
520
521 15         wsrl_SetTerminationTimeResponseType_destroy_contents(
522             &SetTerminationTimeResponse);
523
524 15         globus_soap_message_handle_set_attr(
525             callback_handle->message, 
526             WSADDR_ACTION_RESPONSE_KEY,
527             globus_soap_message_attr_copy_string,
528             globus_libc_free, 
529             "http://widgets.com/WidgetPortType/SetTerminationTimeResponse");
530     }
531
532  exit:
533
534 15     callback_handle->callback(
535         result,
536         callback_handle->args);
537
538 15     globus_libc_free(callback_handle);
539
540 15     WidgetServiceDebugExit();
541 }
542
543 static
544 globus_result_t
545 SetTerminationTime_invoke(
546     globus_service_engine_t                 engine,
547     globus_soap_message_handle_t            message,
548     globus_service_response_t *             response,
549     globus_operation_invoke_callback_func_t invoke_callback,
550     void *                                  args)
551 15 {
552 15     SetTerminationTime_callback_handle_t * callback_handle;
553 15     globus_result_t                    result = GLOBUS_SUCCESS;
554 15     GlobusFuncName(WidgetPortType_SetTerminationTime);
555 15     WidgetServiceDebugEnter();
556
557 15     callback_handle = malloc(sizeof(SetTerminationTime_callback_handle_t));
558 15     if(!callback_handle)
559     {
560 0         result = GlobusSoapMessageErrorOutOfMemory;
561 0         goto exit;
562     }
563 15     memset(callback_handle, 0, sizeof(SetTerminationTime_callback_handle_t));
564
565 15     callback_handle->engine = engine;
566 15     callback_handle->message = message;
567 15     callback_handle->callback = invoke_callback;
568 15     callback_handle->args = args;
569
570 15     result = globus_callback_register_oneshot(
571         NULL,
572         &globus_i_reltime_zero,
573         SetTerminationTime_invoke_callback,
574         callback_handle);
575
576  exit:
577 15     WidgetServiceDebugExit();
578 15     return result;
579 }
580
581 static
582 globus_service_operation_descriptor_t 
583 SetTerminationTime_operation_descriptor =
584 {
585     SetTerminationTime_deserialize,
586     SetTerminationTime_invoke
587 };
588
589 static
590 globus_operation_provider_descriptor_t SetTerminationTime_descriptor =
591 {
592     &WidgetPortType_SetTerminationTime_op_qname,
593     "SetTerminationTime",
594     (void *)WidgetPortType_SetTerminationTime_init,
595     (void *)WidgetPortType_SetTerminationTime_impl,
596     NULL
597 };
598
599
600 xsd_QName WidgetPortType_Destroy_op_qname = 
601 {
602     "http://widgets.com",
603     "Destroy"
604 };
605
606 xsd_QName WidgetPortType_Destroy_input_qname =
607 {
608      "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd",
609      "Destroy"
610 };
611
612 typedef globus_result_t (* Destroy_init_func_t) (
613     globus_service_engine_t             engine,
614     globus_soap_message_handle_t        message,
615     wsrl_DestroyType * Destroy);
616
617 typedef globus_result_t (* Destroy_invoke_func_t) (
618     globus_service_engine_t             engine,
619     globus_soap_message_handle_t        message,
620     globus_service_descriptor_t *       descriptor,
621     wsrl_DestroyType * Destroy,
622     wsrl_DestroyResponseType * DestroyResponse,
623     const char ** fault_type_name,
624     void ** fault);
625     
626 typedef struct Destroy_callback_handle_s
627 {
628     globus_service_engine_t                 engine;
629     globus_soap_message_handle_t            message;
630     globus_operation_invoke_callback_func_t callback;
631     void *                                  args;
632 } Destroy_callback_handle_t;
633
634
635 const char * WidgetPortType_Destroy_fault_strings[WIDGETPORTTYPE_DESTROY_RESOURCEUNKNOWNFAULT] =
636 {
637     "Unknown",
638     "ResourceNotDestroyedFault",
639     "ResourceUnknownFault"
640  };
641
642 static
643 WidgetPortType_Destroy_fault_t
644 Destroy_lookup_fault_type(
645     const char *                        fault_name)
646 0 {
647 0     WidgetPortType_Destroy_fault_t fault_type;
648 0     GlobusFuncName(Destroy_lookup_fault_type);
649 0     WidgetServiceDebugEnter();
650
651 0     globus_assert(fault_name);
652
653 0     if(!strcmp(fault_name, "ResourceNotDestroyedFault"))
654     {
655 0         fault_type = WIDGETPORTTYPE_DESTROY_RESOURCENOTDESTROYEDFAULT;
656     }
657 0     else if(!strcmp(fault_name, "ResourceUnknownFault"))
658     {
659 0         fault_type = WIDGETPORTTYPE_DESTROY_RESOURCEUNKNOWNFAULT;
660     }
661     else
662     {
663 0         fault_type = WIDGETPORTTYPE_DESTROY_UNKNOWN_FAULT;
664     }
665
666 0     WidgetServiceDebugExit();
667 0     return fault_type;
668 }
669
670
671     
672 static
673 void
674 Destroy_deserialize_callback(
675     void *                              handle)
676 15 {
677 15     Destroy_callback_handle_t * callback_handle;
678 15     globus_result_t                     result = GLOBUS_SUCCESS;
679 15     struct globus_soap_message_fault_s  soap_fault;
680 15     Destroy_init_func_t    init_function;
681 15     Destroy_invoke_func_t  invoke_function;
682 15     wsrl_DestroyType * Destroy;
683 15     GlobusFuncName(Destroy_deserialize_callback);
684 15     WidgetServiceDebugEnter();
685
686 15     callback_handle = (Destroy_callback_handle_t *) handle;
687
688 15     result = globus_operation_table_get_operation(
689         WidgetService_descriptor.operations,
690         "Destroy",
691         (void **)&init_function,
692         (void **)&invoke_function);
693 15     if(result != GLOBUS_SUCCESS)
694     {
695 0         goto exit;
696     }
697
698 15     if(WidgetService_descriptor.registry)
699     {
700 15         globus_soap_message_handle_set_registry(
701             callback_handle->message,
702             WidgetService_descriptor.registry);
703     }
704
705 15     result = wsrl_DestroyType_init(
706         &Destroy);
707 15     if(result != GLOBUS_SUCCESS)
708     {
709 0         goto exit;
710     }
711
712 15     if(init_function)
713     {
714         /* do service specific initialization stuff */
715 15         result = init_function(
716             callback_handle->engine,
717             callback_handle->message,
718             Destroy);
719 15         if(result != GLOBUS_SUCCESS)
720         {
721 0             goto free_exit;
722         }
723     }
724
725 15     result = wsrl_DestroyType_deserialize(
726         &WidgetPortType_Destroy_input_qname,
727         Destroy,
728         callback_handle->message,
729         0);
730 15     if(result != GLOBUS_SUCCESS)
731     {
732 0         goto free_exit;
733     }
734
735 15     result = globus_soap_message_handle_set_attr(
736         callback_handle->message,
737         "DestroyOperationInputParameter",
738         wsrl_DestroyType_copy_wrapper,
739         wsrl_DestroyType_destroy_wrapper,
740         (void *)Destroy);
741 15     if(result != GLOBUS_SUCCESS)
742     {
743 15         goto free_exit;
744     }
745
746 free_exit:
747 15     wsrl_DestroyType_destroy(Destroy);
748
749  exit:
750
751 15     callback_handle->callback(
752         result,
753         callback_handle->args);
754 15     free(callback_handle);
755 15     WidgetServiceDebugExit();
756 }
757 /* Destroy_deserialize_callback() */
758
759 static
760 globus_result_t
761 Destroy_deserialize(
762     globus_service_engine_t                 engine,
763     globus_soap_message_handle_t            message,
764     globus_operation_invoke_callback_func_t invoke_callback,
765     void *                                  args)
766 15 {
767 15     Destroy_callback_handle_t * callback_handle;
768 15     globus_result_t                    result = GLOBUS_SUCCESS;
769 15     GlobusFuncName(Destroy_deserialize);
770 15     WidgetServiceDebugEnter();
771
772 15     callback_handle = malloc(sizeof(Destroy_callback_handle_t));
773 15     globus_assert_string(callback_handle, 
774                          "Memory allocation failed "
775                          "for Destroy callback handle");
776 15     memset(callback_handle, 0, sizeof(Destroy_callback_handle_t));
777
778 15     callback_handle->engine = engine;
779 15     callback_handle->message = message;
780 15     callback_handle->callback = invoke_callback;
781 15     callback_handle->args = args;
782
783 15     result = globus_callback_register_oneshot(
784         NULL,
785         &globus_i_reltime_zero,
786         Destroy_deserialize_callback,
787         callback_handle);
788
789 15     WidgetServiceDebugExit();
790 15     return result;
791 }
792
793 static
794 void
795 Destroy_invoke_callback(
796     void *                              handle)
797 15 {
798 15     Destroy_callback_handle_t * callback_handle;
799 15     globus_result_t                     result = GLOBUS_SUCCESS;
800 15     struct globus_soap_message_fault_s  soap_fault;
801 15     Destroy_init_func_t    init_function;
802 15     Destroy_invoke_func_t  invoke_function;
803 15     wsrl_DestroyType * Destroy;
804 15     wsrl_DestroyResponseType DestroyResponse;
805 15      xsd_QName element_qname;
806 15      const char * fault_type_name = NULL;
807 15      WidgetPortType_Destroy_fault_t fault_type = WIDGETPORTTYPE_DESTROY_NOFAULT;
808 15      void *                              fault = NULL;
809     
810 15     GlobusFuncName(Destroy_invoke_callback);
811 15     WidgetServiceDebugEnter();
812
813 15     callback_handle = (Destroy_callback_handle_t *) handle;
814
815 15     Destroy = globus_soap_message_handle_get_attr(
816         callback_handle->message,
817         "DestroyOperationInputParameter");
818 15     globus_assert(Destroy);
819
820 15     result = globus_operation_table_get_operation(
821         WidgetService_descriptor.operations,
822         "Destroy",
823         (void **)&init_function,
824         (void **)&invoke_function);
825 15     if(result != GLOBUS_SUCCESS)
826     {
827 0         goto fault_exit;
828     }
829
830
831 15     result = wsrl_DestroyResponseType_init_contents(
832         &DestroyResponse);
833 15     if(result != GLOBUS_SUCCESS)
834     {
835 0         goto fault_exit;
836     }
837
838 15     result = invoke_function(
839         callback_handle->engine,
840         callback_handle->message,
841         &WidgetService_descriptor,
842         Destroy,
843         &DestroyResponse,
844         &fault_type_name,
845         &fault);
846
847 fault_exit:
848
849 15     if(fault && fault_type_name)
850     {
851 0         fault_type = Destroy_lookup_fault_type(fault_type_name);
852
853 0         result = globus_service_session_begin_response(
854             callback_handle->message);
855 0         if(result != GLOBUS_SUCCESS)
856         {
857 0             goto exit;
858         }
859         
860 0         soap_fault.faultcode = "Server";
861 0         soap_fault.faultstring = 
862         "An error occurred while processing the message";
863 0         soap_fault.faultactor = NULL;
864
865 0         switch(fault_type)
866         {
867         
868         case WIDGETPORTTYPE_DESTROY_RESOURCENOTDESTROYEDFAULT:
869
870 0             xsd_any_init(&soap_fault.detail);
871 0             soap_fault.detail->any_info = &wsrl_ResourceNotDestroyedFaultType_info;
872 0             xsd_QName_init(&soap_fault.detail->element);
873 0             soap_fault.detail->element->local = "ResourceNotDestroyedFault";
874 0             soap_fault.detail->element->Namespace = 
875                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
876 0             soap_fault.detail->value = fault;
877 0             break;
878
879         case WIDGETPORTTYPE_DESTROY_RESOURCEUNKNOWNFAULT:
880
881 0             xsd_any_init(&soap_fault.detail);
882 0             soap_fault.detail->any_info = &wsrl_ResourceUnknownFaultType_info;
883 0             xsd_QName_init(&soap_fault.detail->element);
884 0             soap_fault.detail->element->local = "ResourceUnknownFault";
885 0             soap_fault.detail->element->Namespace = 
886                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
887 0             soap_fault.detail->value = fault;
888 0             break;
889
890         default:
891 0             result = WidgetServiceErrorReturnedUnknownFault("Destroy");
892 0             goto exit;
893         }         
894
895 0         result = globus_service_session_serialize_fault_response(
896             callback_handle->message, &soap_fault);
897 0         if(result != GLOBUS_SUCCESS)
898         {
899 0             goto exit;
900         }
901
902 0         soap_fault.detail->element->local = NULL;
903 0         soap_fault.detail->element->Namespace = NULL;
904 0 soap_fault.detail->any_info = NULL;
905 0         xsd_any_destroy(soap_fault.detail);
906
907 0         globus_soap_message_handle_set_attr(
908             callback_handle->message, 
909             WSADDR_ACTION_RESPONSE_KEY,
910             globus_soap_message_attr_copy_string,
911             globus_libc_free,
912             WSADDRESSING_FAULT_NS);
913     }
914 15     else if(result != GLOBUS_SUCCESS)
915     {
916 0         globus_result_t                 local_result;
917 0         local_result = globus_service_session_begin_response(
918             callback_handle->message);
919 0         if(local_result != GLOBUS_SUCCESS)
920         {
921 0             result = local_result;
922 0             goto exit;
923         }
924
925 0         soap_fault.faultcode = "Server";
926 0         soap_fault.faultstring = globus_error_print_friendly(
927             globus_error_get(result));
928 0         result = GLOBUS_SUCCESS;
929 0         soap_fault.faultactor = NULL;
930 0         soap_fault.detail = NULL;
931 0         result = globus_service_session_serialize_fault_response(
932             callback_handle->message, &soap_fault);
933 0         if(result != GLOBUS_SUCCESS)
934         {
935 0             goto exit;
936         }
937
938 0         globus_soap_message_handle_set_attr(
939             callback_handle->message, 
940             WSADDR_ACTION_RESPONSE_KEY,
941             globus_soap_message_attr_copy_string,
942             globus_libc_free, 
943             WSADDRESSING_FAULT_NS);
944     }
945     else
946     {
947 15         result = globus_service_session_begin_response(
948             callback_handle->message);
949 15         if(result != GLOBUS_SUCCESS)
950         {
951 0             goto exit;
952         }
953
954 15         element_qname.local = "DestroyResponse";
955 15         element_qname.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd";
956
957 15         result = wsrl_DestroyResponseType_serialize(
958             &element_qname,
959             &DestroyResponse,
960             callback_handle->message,
961             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
962 15         if(result != GLOBUS_SUCCESS)
963         {
964 0             goto exit;
965         }
966
967 15         result = globus_service_session_end_response(
968             callback_handle->message);
969 15         if(result != GLOBUS_SUCCESS)
970         {
971 0             goto exit;
972         }
973
974 15         wsrl_DestroyResponseType_destroy_contents(
975             &DestroyResponse);
976
977 15         globus_soap_message_handle_set_attr(
978             callback_handle->message, 
979             WSADDR_ACTION_RESPONSE_KEY,
980             globus_soap_message_attr_copy_string,
981             globus_libc_free, 
982             "http://widgets.com/WidgetPortType/DestroyResponse");
983     }
984
985  exit:
986
987 15     callback_handle->callback(
988         result,
989         callback_handle->args);
990
991 15     globus_libc_free(callback_handle);
992
993 15     WidgetServiceDebugExit();
994 }
995
996 static
997 globus_result_t
998 Destroy_invoke(
999     globus_service_engine_t                 engine,
1000     globus_soap_message_handle_t            message,
1001     globus_service_response_t *             response,
1002     globus_operation_invoke_callback_func_t invoke_callback,
1003     void *                                  args)
1004 15 {
1005 15     Destroy_callback_handle_t * callback_handle;
1006 15     globus_result_t                    result = GLOBUS_SUCCESS;
1007 15     GlobusFuncName(WidgetPortType_Destroy);
1008 15     WidgetServiceDebugEnter();
1009
1010 15     callback_handle = malloc(sizeof(Destroy_callback_handle_t));
1011 15     if(!callback_handle)
1012     {
1013 0         result = GlobusSoapMessageErrorOutOfMemory;
1014 0         goto exit;
1015     }
1016 15     memset(callback_handle, 0, sizeof(Destroy_callback_handle_t));
1017
1018 15     callback_handle->engine = engine;
1019 15     callback_handle->message = message;
1020 15     callback_handle->callback = invoke_callback;
1021 15     callback_handle->args = args;
1022
1023 15     result = globus_callback_register_oneshot(
1024         NULL,
1025         &globus_i_reltime_zero,
1026         Destroy_invoke_callback,
1027         callback_handle);
1028
1029  exit:
1030 15     WidgetServiceDebugExit();
1031 15     return result;
1032 }
1033
1034 static
1035 globus_service_operation_descriptor_t 
1036 Destroy_operation_descriptor =
1037 {
1038     Destroy_deserialize,
1039     Destroy_invoke
1040 };
1041
1042 static
1043 globus_operation_provider_descriptor_t Destroy_descriptor =
1044 {
1045     &WidgetPortType_Destroy_op_qname,
1046     "Destroy",
1047     (void *)WidgetPortType_Destroy_init,
1048     (void *)WidgetPortType_Destroy_impl,
1049     NULL
1050 };
1051
1052
1053 xsd_QName WidgetPortType_QueryResourceProperties_op_qname = 
1054 {
1055     "http://widgets.com",
1056     "QueryResourceProperties"
1057 };
1058
1059 xsd_QName WidgetPortType_QueryResourceProperties_input_qname =
1060 {
1061      "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd",
1062      "QueryResourceProperties"
1063 };
1064
1065 typedef globus_result_t (* QueryResourceProperties_init_func_t) (
1066     globus_service_engine_t             engine,
1067     globus_soap_message_handle_t        message,
1068     wsrp_QueryResourcePropertiesType * QueryResourceProperties);
1069
1070 typedef globus_result_t (* QueryResourceProperties_invoke_func_t) (
1071     globus_service_engine_t             engine,
1072     globus_soap_message_handle_t        message,
1073     globus_service_descriptor_t *       descriptor,
1074     wsrp_QueryResourcePropertiesType * QueryResourceProperties,
1075     wsrp_QueryResourcePropertiesResponseType * QueryResourcePropertiesResponse,
1076     const char ** fault_type_name,
1077     void ** fault);
1078     
1079 typedef struct QueryResourceProperties_callback_handle_s
1080 {
1081     globus_service_engine_t                 engine;
1082     globus_soap_message_handle_t            message;
1083     globus_operation_invoke_callback_func_t callback;
1084     void *                                  args;
1085 } QueryResourceProperties_callback_handle_t;
1086
1087
1088 const char * WidgetPortType_QueryResourceProperties_fault_strings[WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT] =
1089 {
1090     "Unknown",
1091     "QueryEvaluationErrorFault",
1092     "InvalidQueryExpressionFault",
1093     "UnknownQueryExpressionDialectFault",
1094     "InvalidResourcePropertyQNameFault",
1095     "ResourceUnknownFault"
1096  };
1097
1098 static
1099 WidgetPortType_QueryResourceProperties_fault_t
1100 QueryResourceProperties_lookup_fault_type(
1101     const char *                        fault_name)
1102 1 {
1103 1     WidgetPortType_QueryResourceProperties_fault_t fault_type;
1104 1     GlobusFuncName(QueryResourceProperties_lookup_fault_type);
1105 1     WidgetServiceDebugEnter();
1106
1107 1     globus_assert(fault_name);
1108
1109 1     if(!strcmp(fault_name, "QueryEvaluationErrorFault"))
1110     {
1111 0         fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_QUERYEVALUATIONERRORFAULT;
1112     }
1113 1     else if(!strcmp(fault_name, "InvalidQueryExpressionFault"))
1114     {
1115 0         fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_INVALIDQUERYEXPRESSIONFAULT;
1116     }
1117 1     else if(!strcmp(fault_name, "UnknownQueryExpressionDialectFault"))
1118     {
1119 1         fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_UNKNOWNQUERYEXPRESSIONDIALECTFAULT;
1120     }
1121 0     else if(!strcmp(fault_name, "InvalidResourcePropertyQNameFault"))
1122     {
1123 0         fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_INVALIDRESOURCEPROPERTYQNAMEFAULT;
1124     }
1125 0     else if(!strcmp(fault_name, "ResourceUnknownFault"))
1126     {
1127 0         fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT;
1128     }
1129     else
1130     {
1131 0         fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_UNKNOWN_FAULT;
1132     }
1133
1134 1     WidgetServiceDebugExit();
1135 1     return fault_type;
1136 }
1137
1138
1139     
1140 static
1141 void
1142 QueryResourceProperties_deserialize_callback(
1143     void *                              handle)
1144 1 {
1145 1     QueryResourceProperties_callback_handle_t * callback_handle;
1146 1     globus_result_t                     result = GLOBUS_SUCCESS;
1147 1     struct globus_soap_message_fault_s  soap_fault;
1148 1     QueryResourceProperties_init_func_t    init_function;
1149 1     QueryResourceProperties_invoke_func_t  invoke_function;
1150 1     wsrp_QueryResourcePropertiesType * QueryResourceProperties;
1151 1     GlobusFuncName(QueryResourceProperties_deserialize_callback);
1152 1     WidgetServiceDebugEnter();
1153
1154 1     callback_handle = (QueryResourceProperties_callback_handle_t *) handle;
1155
1156 1     result = globus_operation_table_get_operation(
1157         WidgetService_descriptor.operations,
1158         "QueryResourceProperties",
1159         (void **)&init_function,
1160         (void **)&invoke_function);
1161 1     if(result != GLOBUS_SUCCESS)
1162     {
1163 0         goto exit;
1164     }
1165
1166 1     if(WidgetService_descriptor.registry)
1167     {
1168 1         globus_soap_message_handle_set_registry(
1169             callback_handle->message,
1170             WidgetService_descriptor.registry);
1171     }
1172
1173 1     result = wsrp_QueryResourcePropertiesType_init(
1174         &QueryResourceProperties);
1175 1     if(result != GLOBUS_SUCCESS)
1176     {
1177 0         goto exit;
1178     }
1179
1180 1     if(init_function)
1181     {
1182         /* do service specific initialization stuff */
1183 1         result = init_function(
1184             callback_handle->engine,
1185             callback_handle->message,
1186             QueryResourceProperties);
1187 1         if(result != GLOBUS_SUCCESS)
1188         {
1189 0             goto free_exit;
1190         }
1191     }
1192
1193 1     result = wsrp_QueryResourcePropertiesType_deserialize(
1194         &WidgetPortType_QueryResourceProperties_input_qname,
1195         QueryResourceProperties,
1196         callback_handle->message,
1197         0);
1198 1     if(result != GLOBUS_SUCCESS)
1199     {
1200 0         goto free_exit;
1201     }
1202
1203 1     result = globus_soap_message_handle_set_attr(
1204         callback_handle->message,
1205         "QueryResourcePropertiesOperationInputParameter",
1206         wsrp_QueryResourcePropertiesType_copy_wrapper,
1207         wsrp_QueryResourcePropertiesType_destroy_wrapper,
1208         (void *)QueryResourceProperties);
1209 1     if(result != GLOBUS_SUCCESS)
1210     {
1211 1         goto free_exit;
1212     }
1213
1214 free_exit:
1215 1     wsrp_QueryResourcePropertiesType_destroy(QueryResourceProperties);
1216
1217  exit:
1218
1219 1     callback_handle->callback(
1220         result,
1221         callback_handle->args);
1222 1     free(callback_handle);
1223 1     WidgetServiceDebugExit();
1224 }
1225 /* QueryResourceProperties_deserialize_callback() */
1226
1227 static
1228 globus_result_t
1229 QueryResourceProperties_deserialize(
1230     globus_service_engine_t                 engine,
1231     globus_soap_message_handle_t            message,
1232     globus_operation_invoke_callback_func_t invoke_callback,
1233     void *                                  args)
1234 1 {
1235 1     QueryResourceProperties_callback_handle_t * callback_handle;
1236 1     globus_result_t                    result = GLOBUS_SUCCESS;
1237 1     GlobusFuncName(QueryResourceProperties_deserialize);
1238 1     WidgetServiceDebugEnter();
1239
1240 1     callback_handle = malloc(sizeof(QueryResourceProperties_callback_handle_t));
1241 1     globus_assert_string(callback_handle, 
1242                          "Memory allocation failed "
1243                          "for QueryResourceProperties callback handle");
1244 1     memset(callback_handle, 0, sizeof(QueryResourceProperties_callback_handle_t));
1245
1246 1     callback_handle->engine = engine;
1247 1     callback_handle->message = message;
1248 1     callback_handle->callback = invoke_callback;
1249 1     callback_handle->args = args;
1250
1251 1     result = globus_callback_register_oneshot(
1252         NULL,
1253         &globus_i_reltime_zero,
1254         QueryResourceProperties_deserialize_callback,
1255         callback_handle);
1256
1257 1     WidgetServiceDebugExit();
1258 1     return result;
1259 }
1260
1261 static
1262 void
1263 QueryResourceProperties_invoke_callback(
1264     void *                              handle)
1265 1 {
1266 1     QueryResourceProperties_callback_handle_t * callback_handle;
1267 1     globus_result_t                     result = GLOBUS_SUCCESS;
1268 1     struct globus_soap_message_fault_s  soap_fault;
1269 1     QueryResourceProperties_init_func_t    init_function;
1270 1     QueryResourceProperties_invoke_func_t  invoke_function;
1271 1     wsrp_QueryResourcePropertiesType * QueryResourceProperties;
1272 1     wsrp_QueryResourcePropertiesResponseType QueryResourcePropertiesResponse;
1273 1      xsd_QName element_qname;
1274 1      const char * fault_type_name = NULL;
1275 1      WidgetPortType_QueryResourceProperties_fault_t fault_type = WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_NOFAULT;
1276 1      void *                              fault = NULL;
1277     
1278 1     GlobusFuncName(QueryResourceProperties_invoke_callback);
1279 1     WidgetServiceDebugEnter();
1280
1281 1     callback_handle = (QueryResourceProperties_callback_handle_t *) handle;
1282
1283 1     QueryResourceProperties = globus_soap_message_handle_get_attr(
1284         callback_handle->message,
1285         "QueryResourcePropertiesOperationInputParameter");
1286 1     globus_assert(QueryResourceProperties);
1287
1288 1     result = globus_operation_table_get_operation(
1289         WidgetService_descriptor.operations,
1290         "QueryResourceProperties",
1291         (void **)&init_function,
1292         (void **)&invoke_function);
1293 1     if(result != GLOBUS_SUCCESS)
1294     {
1295 0         goto fault_exit;
1296     }
1297
1298
1299 1     result = wsrp_QueryResourcePropertiesResponseType_init_contents(
1300         &QueryResourcePropertiesResponse);
1301 1     if(result != GLOBUS_SUCCESS)
1302     {
1303 0         goto fault_exit;
1304     }
1305
1306 1     result = invoke_function(
1307         callback_handle->engine,
1308         callback_handle->message,
1309         &WidgetService_descriptor,
1310         QueryResourceProperties,
1311         &QueryResourcePropertiesResponse,
1312         &fault_type_name,
1313         &fault);
1314
1315 fault_exit:
1316
1317 1     if(fault && fault_type_name)
1318     {
1319 1         fault_type = QueryResourceProperties_lookup_fault_type(fault_type_name);
1320
1321 1         result = globus_service_session_begin_response(
1322             callback_handle->message);
1323 1         if(result != GLOBUS_SUCCESS)
1324         {
1325 0             goto exit;
1326         }
1327         
1328 1         soap_fault.faultcode = "Server";
1329 1         soap_fault.faultstring = 
1330         "An error occurred while processing the message";
1331 1         soap_fault.faultactor = NULL;
1332
1333 1         switch(fault_type)
1334         {
1335         
1336         case WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_QUERYEVALUATIONERRORFAULT:
1337
1338 0             xsd_any_init(&soap_fault.detail);
1339 0             soap_fault.detail->any_info = &wsrp_QueryEvaluationErrorFaultType_info;
1340 0             xsd_QName_init(&soap_fault.detail->element);
1341 0             soap_fault.detail->element->local = "QueryEvaluationErrorFault";
1342 0             soap_fault.detail->element->Namespace = 
1343                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1344 0             soap_fault.detail->value = fault;
1345 0             break;
1346
1347         case WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_INVALIDQUERYEXPRESSIONFAULT:
1348
1349 0             xsd_any_init(&soap_fault.detail);
1350 0             soap_fault.detail->any_info = &wsrp_InvalidQueryExpressionFaultType_info;
1351 0             xsd_QName_init(&soap_fault.detail->element);
1352 0             soap_fault.detail->element->local = "InvalidQueryExpressionFault";
1353 0             soap_fault.detail->element->Namespace = 
1354                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1355 0             soap_fault.detail->value = fault;
1356 0             break;
1357
1358         case WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_UNKNOWNQUERYEXPRESSIONDIALECTFAULT:
1359
1360 1             xsd_any_init(&soap_fault.detail);
1361 1             soap_fault.detail->any_info = &wsrp_UnknownQueryExpressionDialectFaultType_info;
1362 1             xsd_QName_init(&soap_fault.detail->element);
1363 1             soap_fault.detail->element->local = "UnknownQueryExpressionDialectFault";
1364 1             soap_fault.detail->element->Namespace = 
1365                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1366 1             soap_fault.detail->value = fault;
1367 1             break;
1368
1369         case WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_INVALIDRESOURCEPROPERTYQNAMEFAULT:
1370
1371 0             xsd_any_init(&soap_fault.detail);
1372 0             soap_fault.detail->any_info = &wsrp_InvalidResourcePropertyQNameFaultType_info;
1373 0             xsd_QName_init(&soap_fault.detail->element);
1374 0             soap_fault.detail->element->local = "InvalidResourcePropertyQNameFault";
1375 0             soap_fault.detail->element->Namespace = 
1376                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1377 0             soap_fault.detail->value = fault;
1378 0             break;
1379
1380         case WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT:
1381
1382 0             xsd_any_init(&soap_fault.detail);
1383 0             soap_fault.detail->any_info = &wsrp_ResourceUnknownFaultType_info;
1384 0             xsd_QName_init(&soap_fault.detail->element);
1385 0             soap_fault.detail->element->local = "ResourceUnknownFault";
1386 0             soap_fault.detail->element->Namespace = 
1387                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1388 0             soap_fault.detail->value = fault;
1389 0             break;
1390
1391         default:
1392 0             result = WidgetServiceErrorReturnedUnknownFault("QueryResourceProperties");
1393 0             goto exit;
1394         }         
1395
1396 1         result = globus_service_session_serialize_fault_response(
1397             callback_handle->message, &soap_fault);
1398 1         if(result != GLOBUS_SUCCESS)
1399         {
1400 0             goto exit;
1401         }
1402
1403 1         soap_fault.detail->element->local = NULL;
1404 1         soap_fault.detail->element->Namespace = NULL;
1405 1 soap_fault.detail->any_info = NULL;
1406 1         xsd_any_destroy(soap_fault.detail);
1407
1408 1         globus_soap_message_handle_set_attr(
1409             callback_handle->message, 
1410             WSADDR_ACTION_RESPONSE_KEY,
1411             globus_soap_message_attr_copy_string,
1412             globus_libc_free,
1413             WSADDRESSING_FAULT_NS);
1414     }
1415 0     else if(result != GLOBUS_SUCCESS)
1416     {
1417 0         globus_result_t                 local_result;
1418 0         local_result = globus_service_session_begin_response(
1419             callback_handle->message);
1420 0         if(local_result != GLOBUS_SUCCESS)
1421         {
1422 0             result = local_result;
1423 0             goto exit;
1424         }
1425
1426 0         soap_fault.faultcode = "Server";
1427 0         soap_fault.faultstring = globus_error_print_friendly(
1428             globus_error_get(result));
1429 0         result = GLOBUS_SUCCESS;
1430 0         soap_fault.faultactor = NULL;
1431 0         soap_fault.detail = NULL;
1432 0         result = globus_service_session_serialize_fault_response(
1433             callback_handle->message, &soap_fault);
1434 0         if(result != GLOBUS_SUCCESS)
1435         {
1436 0             goto exit;
1437         }
1438
1439 0         globus_soap_message_handle_set_attr(
1440             callback_handle->message, 
1441             WSADDR_ACTION_RESPONSE_KEY,
1442             globus_soap_message_attr_copy_string,
1443             globus_libc_free, 
1444             WSADDRESSING_FAULT_NS);
1445     }
1446     else
1447     {
1448 0         result = globus_service_session_begin_response(
1449             callback_handle->message);
1450 0         if(result != GLOBUS_SUCCESS)
1451         {
1452 0             goto exit;
1453         }
1454
1455 0         element_qname.local = "QueryResourcePropertiesResponse";
1456 0         element_qname.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1457
1458 0         result = wsrp_QueryResourcePropertiesResponseType_serialize(
1459             &element_qname,
1460             &QueryResourcePropertiesResponse,
1461             callback_handle->message,
1462             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
1463 0         if(result != GLOBUS_SUCCESS)
1464         {
1465 0             goto exit;
1466         }
1467
1468 0         result = globus_service_session_end_response(
1469             callback_handle->message);
1470 0         if(result != GLOBUS_SUCCESS)
1471         {
1472 0             goto exit;
1473         }
1474
1475 0         wsrp_QueryResourcePropertiesResponseType_destroy_contents(
1476             &QueryResourcePropertiesResponse);
1477
1478 0         globus_soap_message_handle_set_attr(
1479             callback_handle->message, 
1480             WSADDR_ACTION_RESPONSE_KEY,
1481             globus_soap_message_attr_copy_string,
1482             globus_libc_free, 
1483             "http://widgets.com/WidgetPortType/QueryResourcePropertiesResponse");
1484     }
1485
1486  exit:
1487
1488 1     callback_handle->callback(
1489         result,
1490         callback_handle->args);
1491
1492 1     globus_libc_free(callback_handle);
1493
1494 1     WidgetServiceDebugExit();
1495 }
1496
1497 static
1498 globus_result_t
1499 QueryResourceProperties_invoke(
1500     globus_service_engine_t                 engine,
1501     globus_soap_message_handle_t            message,
1502     globus_service_response_t *             response,
1503     globus_operation_invoke_callback_func_t invoke_callback,
1504     void *                                  args)
1505 1 {
1506 1     QueryResourceProperties_callback_handle_t * callback_handle;
1507 1     globus_result_t                    result = GLOBUS_SUCCESS;
1508 1     GlobusFuncName(WidgetPortType_QueryResourceProperties);
1509 1     WidgetServiceDebugEnter();
1510
1511 1     callback_handle = malloc(sizeof(QueryResourceProperties_callback_handle_t));
1512 1     if(!callback_handle)
1513     {
1514 0         result = GlobusSoapMessageErrorOutOfMemory;
1515 0         goto exit;
1516     }
1517 1     memset(callback_handle, 0, sizeof(QueryResourceProperties_callback_handle_t));
1518
1519 1     callback_handle->engine = engine;
1520 1     callback_handle->message = message;
1521 1     callback_handle->callback = invoke_callback;
1522 1     callback_handle->args = args;
1523
1524 1     result = globus_callback_register_oneshot(
1525         NULL,
1526         &globus_i_reltime_zero,
1527         QueryResourceProperties_invoke_callback,
1528         callback_handle);
1529
1530  exit:
1531 1     WidgetServiceDebugExit();
1532 1     return result;
1533 }
1534
1535 static
1536 globus_service_operation_descriptor_t 
1537 QueryResourceProperties_operation_descriptor =
1538 {
1539     QueryResourceProperties_deserialize,
1540     QueryResourceProperties_invoke
1541 };
1542
1543 static
1544 globus_operation_provider_descriptor_t QueryResourceProperties_descriptor =
1545 {
1546     &WidgetPortType_QueryResourceProperties_op_qname,
1547     "QueryResourceProperties",
1548     (void *)WidgetPortType_QueryResourceProperties_init,
1549     (void *)WidgetPortType_QueryResourceProperties_impl,
1550     NULL
1551 };
1552
1553
1554 xsd_QName WidgetPortType_SetResourceProperties_op_qname = 
1555 {
1556     "http://widgets.com",
1557     "SetResourceProperties"
1558 };
1559
1560 xsd_QName WidgetPortType_SetResourceProperties_input_qname =
1561 {
1562      "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd",
1563      "SetResourceProperties"
1564 };
1565
1566 typedef globus_result_t (* SetResourceProperties_init_func_t) (
1567     globus_service_engine_t             engine,
1568     globus_soap_message_handle_t        message,
1569     wsrp_SetResourcePropertiesType * SetResourceProperties);
1570
1571 typedef globus_result_t (* SetResourceProperties_invoke_func_t) (
1572     globus_service_engine_t             engine,
1573     globus_soap_message_handle_t        message,
1574     globus_service_descriptor_t *       descriptor,
1575     wsrp_SetResourcePropertiesType * SetResourceProperties,
1576     wsrp_SetResourcePropertiesResponseType * SetResourcePropertiesResponse,
1577     const char ** fault_type_name,
1578     void ** fault);
1579     
1580 typedef struct SetResourceProperties_callback_handle_s
1581 {
1582     globus_service_engine_t                 engine;
1583     globus_soap_message_handle_t            message;
1584     globus_operation_invoke_callback_func_t callback;
1585     void *                                  args;
1586 } SetResourceProperties_callback_handle_t;
1587
1588
1589 const char * WidgetPortType_SetResourceProperties_fault_strings[WIDGETPORTTYPE_SETRESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT] =
1590 {
1591     "Unknown",
1592     "SetResourcePropertyRequestFailedFault",
1593     "InvalidResourcePropertyQNameFault",
1594     "UnableToModifyResourcePropertyFault",
1595     "InvalidSetResourcePropertiesRequestContentFault",
1596     "ResourceUnknownFault"
1597  };
1598
1599 static
1600 WidgetPortType_SetResourceProperties_fault_t
1601 SetResourceProperties_lookup_fault_type(
1602     const char *                        fault_name)
1603 0 {
1604 0     WidgetPortType_SetResourceProperties_fault_t fault_type;
1605 0     GlobusFuncName(SetResourceProperties_lookup_fault_type);
1606 0     WidgetServiceDebugEnter();
1607
1608 0     globus_assert(fault_name);
1609
1610 0     if(!strcmp(fault_name, "SetResourcePropertyRequestFailedFault"))
1611     {
1612 0         fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_SETRESOURCEPROPERTYREQUESTFAILEDFAULT;
1613     }
1614 0     else if(!strcmp(fault_name, "InvalidResourcePropertyQNameFault"))
1615     {
1616 0         fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_INVALIDRESOURCEPROPERTYQNAMEFAULT;
1617     }
1618 0     else if(!strcmp(fault_name, "UnableToModifyResourcePropertyFault"))
1619     {
1620 0         fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_UNABLETOMODIFYRESOURCEPROPERTYFAULT;
1621     }
1622 0     else if(!strcmp(fault_name, "InvalidSetResourcePropertiesRequestContentFault"))
1623     {
1624 0         fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_INVALIDSETRESOURCEPROPERTIESREQUESTCONTENTFAULT;
1625     }
1626 0     else if(!strcmp(fault_name, "ResourceUnknownFault"))
1627     {
1628 0         fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT;
1629     }
1630     else
1631     {
1632 0         fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_UNKNOWN_FAULT;
1633     }
1634
1635 0     WidgetServiceDebugExit();
1636 0     return fault_type;
1637 }
1638
1639
1640     
1641 static
1642 void
1643 SetResourceProperties_deserialize_callback(
1644     void *                              handle)
1645 3 {
1646 3     SetResourceProperties_callback_handle_t * callback_handle;
1647 3     globus_result_t                     result = GLOBUS_SUCCESS;
1648 3     struct globus_soap_message_fault_s  soap_fault;
1649 3     SetResourceProperties_init_func_t    init_function;
1650 3     SetResourceProperties_invoke_func_t  invoke_function;
1651 3     wsrp_SetResourcePropertiesType * SetResourceProperties;
1652 3     GlobusFuncName(SetResourceProperties_deserialize_callback);
1653 3     WidgetServiceDebugEnter();
1654
1655 3     callback_handle = (SetResourceProperties_callback_handle_t *) handle;
1656
1657 3     result = globus_operation_table_get_operation(
1658         WidgetService_descriptor.operations,
1659         "SetResourceProperties",
1660         (void **)&init_function,
1661         (void **)&invoke_function);
1662 3     if(result != GLOBUS_SUCCESS)
1663     {
1664 0         goto exit;
1665     }
1666
1667 3     if(WidgetService_descriptor.registry)
1668     {
1669 3         globus_soap_message_handle_set_registry(
1670             callback_handle->message,
1671             WidgetService_descriptor.registry);
1672     }
1673
1674 3     result = wsrp_SetResourcePropertiesType_init(
1675         &SetResourceProperties);
1676 3     if(result != GLOBUS_SUCCESS)
1677     {
1678 0         goto exit;
1679     }
1680
1681 3     if(init_function)
1682     {
1683         /* do service specific initialization stuff */
1684 3         result = init_function(
1685             callback_handle->engine,
1686             callback_handle->message,
1687             SetResourceProperties);
1688 3         if(result != GLOBUS_SUCCESS)
1689         {
1690 0             goto free_exit;
1691         }
1692     }
1693
1694 3     result = wsrp_SetResourcePropertiesType_deserialize(
1695         &WidgetPortType_SetResourceProperties_input_qname,
1696         SetResourceProperties,
1697         callback_handle->message,
1698         0);
1699 3     if(result != GLOBUS_SUCCESS)
1700     {
1701 0         goto free_exit;
1702     }
1703
1704 3     result = globus_soap_message_handle_set_attr(
1705         callback_handle->message,
1706         "SetResourcePropertiesOperationInputParameter",
1707         wsrp_SetResourcePropertiesType_copy_wrapper,
1708         wsrp_SetResourcePropertiesType_destroy_wrapper,
1709         (void *)SetResourceProperties);
1710 3     if(result != GLOBUS_SUCCESS)
1711     {
1712 3         goto free_exit;
1713     }
1714
1715 free_exit:
1716 3     wsrp_SetResourcePropertiesType_destroy(SetResourceProperties);
1717
1718  exit:
1719
1720 3     callback_handle->callback(
1721         result,
1722         callback_handle->args);
1723 3     free(callback_handle);
1724 3     WidgetServiceDebugExit();
1725 }
1726 /* SetResourceProperties_deserialize_callback() */
1727
1728 static
1729 globus_result_t
1730 SetResourceProperties_deserialize(
1731     globus_service_engine_t                 engine,
1732     globus_soap_message_handle_t            message,
1733     globus_operation_invoke_callback_func_t invoke_callback,
1734     void *                                  args)
1735 3 {
1736 3     SetResourceProperties_callback_handle_t * callback_handle;
1737 3     globus_result_t                    result = GLOBUS_SUCCESS;
1738 3     GlobusFuncName(SetResourceProperties_deserialize);
1739 3     WidgetServiceDebugEnter();
1740
1741 3     callback_handle = malloc(sizeof(SetResourceProperties_callback_handle_t));
1742 3     globus_assert_string(callback_handle, 
1743                          "Memory allocation failed "
1744                          "for SetResourceProperties callback handle");
1745 3     memset(callback_handle, 0, sizeof(SetResourceProperties_callback_handle_t));
1746
1747 3     callback_handle->engine = engine;
1748 3     callback_handle->message = message;
1749 3     callback_handle->callback = invoke_callback;
1750 3     callback_handle->args = args;
1751
1752 3     result = globus_callback_register_oneshot(
1753         NULL,
1754         &globus_i_reltime_zero,
1755         SetResourceProperties_deserialize_callback,
1756         callback_handle);
1757
1758 3     WidgetServiceDebugExit();
1759 3     return result;
1760 }
1761
1762 static
1763 void
1764 SetResourceProperties_invoke_callback(
1765     void *                              handle)
1766 3 {
1767 3     SetResourceProperties_callback_handle_t * callback_handle;
1768 3     globus_result_t                     result = GLOBUS_SUCCESS;
1769 3     struct globus_soap_message_fault_s  soap_fault;
1770 3     SetResourceProperties_init_func_t    init_function;
1771 3     SetResourceProperties_invoke_func_t  invoke_function;
1772 3     wsrp_SetResourcePropertiesType * SetResourceProperties;
1773 3     wsrp_SetResourcePropertiesResponseType SetResourcePropertiesResponse;
1774 3      xsd_QName element_qname;
1775 3      const char * fault_type_name = NULL;
1776 3      WidgetPortType_SetResourceProperties_fault_t fault_type = WIDGETPORTTYPE_SETRESOURCEPROPERTIES_NOFAULT;
1777 3      void *                              fault = NULL;
1778     
1779 3     GlobusFuncName(SetResourceProperties_invoke_callback);
1780 3     WidgetServiceDebugEnter();
1781
1782 3     callback_handle = (SetResourceProperties_callback_handle_t *) handle;
1783
1784 3     SetResourceProperties = globus_soap_message_handle_get_attr(
1785         callback_handle->message,
1786         "SetResourcePropertiesOperationInputParameter");
1787 3     globus_assert(SetResourceProperties);
1788
1789 3     result = globus_operation_table_get_operation(
1790         WidgetService_descriptor.operations,
1791         "SetResourceProperties",
1792         (void **)&init_function,
1793         (void **)&invoke_function);
1794 3     if(result != GLOBUS_SUCCESS)
1795     {
1796 0         goto fault_exit;
1797     }
1798
1799
1800 3     result = wsrp_SetResourcePropertiesResponseType_init_contents(
1801         &SetResourcePropertiesResponse);
1802 3     if(result != GLOBUS_SUCCESS)
1803     {
1804 0         goto fault_exit;
1805     }
1806
1807 3     result = invoke_function(
1808         callback_handle->engine,
1809         callback_handle->message,
1810         &WidgetService_descriptor,
1811         SetResourceProperties,
1812         &SetResourcePropertiesResponse,
1813         &fault_type_name,
1814         &fault);
1815
1816 fault_exit:
1817
1818 3     if(fault && fault_type_name)
1819     {
1820 0         fault_type = SetResourceProperties_lookup_fault_type(fault_type_name);
1821
1822 0         result = globus_service_session_begin_response(
1823             callback_handle->message);
1824 0         if(result != GLOBUS_SUCCESS)
1825         {
1826 0             goto exit;
1827         }
1828         
1829 0         soap_fault.faultcode = "Server";
1830 0         soap_fault.faultstring = 
1831         "An error occurred while processing the message";
1832 0         soap_fault.faultactor = NULL;
1833
1834 0         switch(fault_type)
1835         {
1836         
1837         case WIDGETPORTTYPE_SETRESOURCEPROPERTIES_SETRESOURCEPROPERTYREQUESTFAILEDFAULT:
1838
1839 0             xsd_any_init(&soap_fault.detail);
1840 0             soap_fault.detail->any_info = &wsrp_SetResourcePropertyRequestFailedFaultType_info;
1841 0             xsd_QName_init(&soap_fault.detail->element);
1842 0             soap_fault.detail->element->local = "SetResourcePropertyRequestFailedFault";
1843 0             soap_fault.detail->element->Namespace = 
1844                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1845 0             soap_fault.detail->value = fault;
1846 0             break;
1847
1848         case WIDGETPORTTYPE_SETRESOURCEPROPERTIES_INVALIDRESOURCEPROPERTYQNAMEFAULT:
1849
1850 0             xsd_any_init(&soap_fault.detail);
1851 0             soap_fault.detail->any_info = &wsrp_InvalidResourcePropertyQNameFaultType_info;
1852 0             xsd_QName_init(&soap_fault.detail->element);
1853 0             soap_fault.detail->element->local = "InvalidResourcePropertyQNameFault";
1854 0             soap_fault.detail->element->Namespace = 
1855                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1856 0             soap_fault.detail->value = fault;
1857 0             break;
1858
1859         case WIDGETPORTTYPE_SETRESOURCEPROPERTIES_UNABLETOMODIFYRESOURCEPROPERTYFAULT:
1860
1861 0             xsd_any_init(&soap_fault.detail);
1862 0             soap_fault.detail->any_info = &wsrp_UnableToModifyResourcePropertyFaultType_info;
1863 0             xsd_QName_init(&soap_fault.detail->element);
1864 0             soap_fault.detail->element->local = "UnableToModifyResourcePropertyFault";
1865 0             soap_fault.detail->element->Namespace = 
1866                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1867 0             soap_fault.detail->value = fault;
1868 0             break;
1869
1870         case WIDGETPORTTYPE_SETRESOURCEPROPERTIES_INVALIDSETRESOURCEPROPERTIESREQUESTCONTENTFAULT:
1871
1872 0             xsd_any_init(&soap_fault.detail);
1873 0             soap_fault.detail->any_info = &wsrp_InvalidSetResourcePropertiesRequestContentFaultType_info;
1874 0             xsd_QName_init(&soap_fault.detail->element);
1875 0             soap_fault.detail->element->local = "InvalidSetResourcePropertiesRequestContentFault";
1876 0             soap_fault.detail->element->Namespace = 
1877                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1878 0             soap_fault.detail->value = fault;
1879 0             break;
1880
1881         case WIDGETPORTTYPE_SETRESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT:
1882
1883 0             xsd_any_init(&soap_fault.detail);
1884 0             soap_fault.detail->any_info = &wsrp_ResourceUnknownFaultType_info;
1885 0             xsd_QName_init(&soap_fault.detail->element);
1886 0             soap_fault.detail->element->local = "ResourceUnknownFault";
1887 0             soap_fault.detail->element->Namespace = 
1888                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1889 0             soap_fault.detail->value = fault;
1890 0             break;
1891
1892         default:
1893 0             result = WidgetServiceErrorReturnedUnknownFault("SetResourceProperties");
1894 0             goto exit;
1895         }         
1896
1897 0         result = globus_service_session_serialize_fault_response(
1898             callback_handle->message, &soap_fault);
1899 0         if(result != GLOBUS_SUCCESS)
1900         {
1901 0             goto exit;
1902         }
1903
1904 0         soap_fault.detail->element->local = NULL;
1905 0         soap_fault.detail->element->Namespace = NULL;
1906 0 soap_fault.detail->any_info = NULL;
1907 0         xsd_any_destroy(soap_fault.detail);
1908
1909 0         globus_soap_message_handle_set_attr(
1910             callback_handle->message, 
1911             WSADDR_ACTION_RESPONSE_KEY,
1912             globus_soap_message_attr_copy_string,
1913             globus_libc_free,
1914             WSADDRESSING_FAULT_NS);
1915     }
1916 3     else if(result != GLOBUS_SUCCESS)
1917     {
1918 0         globus_result_t                 local_result;
1919 0         local_result = globus_service_session_begin_response(
1920             callback_handle->message);
1921 0         if(local_result != GLOBUS_SUCCESS)
1922         {
1923 0             result = local_result;
1924 0             goto exit;
1925         }
1926
1927 0         soap_fault.faultcode = "Server";
1928 0         soap_fault.faultstring = globus_error_print_friendly(
1929             globus_error_get(result));
1930 0         result = GLOBUS_SUCCESS;
1931 0         soap_fault.faultactor = NULL;
1932 0         soap_fault.detail = NULL;
1933 0         result = globus_service_session_serialize_fault_response(
1934             callback_handle->message, &soap_fault);
1935 0         if(result != GLOBUS_SUCCESS)
1936         {
1937 0             goto exit;
1938         }
1939
1940 0         globus_soap_message_handle_set_attr(
1941             callback_handle->message, 
1942             WSADDR_ACTION_RESPONSE_KEY,
1943             globus_soap_message_attr_copy_string,
1944             globus_libc_free, 
1945             WSADDRESSING_FAULT_NS);
1946     }
1947     else
1948     {
1949 3         result = globus_service_session_begin_response(
1950             callback_handle->message);
1951 3         if(result != GLOBUS_SUCCESS)
1952         {
1953 0             goto exit;
1954         }
1955
1956 3         element_qname.local = "SetResourcePropertiesResponse";
1957 3         element_qname.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
1958
1959 3         result = wsrp_SetResourcePropertiesResponseType_serialize(
1960             &element_qname,
1961             &SetResourcePropertiesResponse,
1962             callback_handle->message,
1963             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
1964 3         if(result != GLOBUS_SUCCESS)
1965         {
1966 0             goto exit;
1967         }
1968
1969 3         result = globus_service_session_end_response(
1970             callback_handle->message);
1971 3         if(result != GLOBUS_SUCCESS)
1972         {
1973 0             goto exit;
1974         }
1975
1976 3         wsrp_SetResourcePropertiesResponseType_destroy_contents(
1977             &SetResourcePropertiesResponse);
1978
1979 3         globus_soap_message_handle_set_attr(
1980             callback_handle->message, 
1981             WSADDR_ACTION_RESPONSE_KEY,
1982             globus_soap_message_attr_copy_string,
1983             globus_libc_free, 
1984             "http://widgets.com/WidgetPortType/SetResourcePropertiesResponse");
1985     }
1986
1987  exit:
1988
1989 3     callback_handle->callback(
1990         result,
1991         callback_handle->args);
1992
1993 3     globus_libc_free(callback_handle);
1994
1995 3     WidgetServiceDebugExit();
1996 }
1997
1998 static
1999 globus_result_t
2000 SetResourceProperties_invoke(
2001     globus_service_engine_t                 engine,
2002     globus_soap_message_handle_t            message,
2003     globus_service_response_t *             response,
2004     globus_operation_invoke_callback_func_t invoke_callback,
2005     void *                                  args)
2006 3 {
2007 3     SetResourceProperties_callback_handle_t * callback_handle;
2008 3     globus_result_t                    result = GLOBUS_SUCCESS;
2009 3     GlobusFuncName(WidgetPortType_SetResourceProperties);
2010 3     WidgetServiceDebugEnter();
2011
2012 3     callback_handle = malloc(sizeof(SetResourceProperties_callback_handle_t));
2013 3     if(!callback_handle)
2014     {
2015 0         result = GlobusSoapMessageErrorOutOfMemory;
2016 0         goto exit;
2017     }
2018 3     memset(callback_handle, 0, sizeof(SetResourceProperties_callback_handle_t));
2019
2020 3     callback_handle->engine = engine;
2021 3     callback_handle->message = message;
2022 3     callback_handle->callback = invoke_callback;
2023 3     callback_handle->args = args;
2024
2025 3     result = globus_callback_register_oneshot(
2026         NULL,
2027         &globus_i_reltime_zero,
2028         SetResourceProperties_invoke_callback,
2029         callback_handle);
2030
2031  exit:
2032 3     WidgetServiceDebugExit();
2033 3     return result;
2034 }
2035
2036 static
2037 globus_service_operation_descriptor_t 
2038 SetResourceProperties_operation_descriptor =
2039 {
2040     SetResourceProperties_deserialize,
2041     SetResourceProperties_invoke
2042 };
2043
2044 static
2045 globus_operation_provider_descriptor_t SetResourceProperties_descriptor =
2046 {
2047     &WidgetPortType_SetResourceProperties_op_qname,
2048     "SetResourceProperties",
2049     (void *)WidgetPortType_SetResourceProperties_init,
2050     (void *)WidgetPortType_SetResourceProperties_impl,
2051     NULL
2052 };
2053
2054
2055 xsd_QName WidgetPortType_GetMultipleResourceProperties_op_qname = 
2056 {
2057     "http://widgets.com",
2058     "GetMultipleResourceProperties"
2059 };
2060
2061 xsd_QName WidgetPortType_GetMultipleResourceProperties_input_qname =
2062 {
2063      "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd",
2064      "GetMultipleResourceProperties"
2065 };
2066
2067 typedef globus_result_t (* GetMultipleResourceProperties_init_func_t) (
2068     globus_service_engine_t             engine,
2069     globus_soap_message_handle_t        message,
2070     wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties);
2071
2072 typedef globus_result_t (* GetMultipleResourceProperties_invoke_func_t) (
2073     globus_service_engine_t             engine,
2074     globus_soap_message_handle_t        message,
2075     globus_service_descriptor_t *       descriptor,
2076     wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties,
2077     wsrp_GetMultipleResourcePropertiesResponseType * GetMultipleResourcePropertiesResponse,
2078     const char ** fault_type_name,
2079     void ** fault);
2080     
2081 typedef struct GetMultipleResourceProperties_callback_handle_s
2082 {
2083     globus_service_engine_t                 engine;
2084     globus_soap_message_handle_t            message;
2085     globus_operation_invoke_callback_func_t callback;
2086     void *                                  args;
2087 } GetMultipleResourceProperties_callback_handle_t;
2088
2089
2090 const char * WidgetPortType_GetMultipleResourceProperties_fault_strings[WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT] =
2091 {
2092     "Unknown",
2093     "InvalidResourcePropertyQNameFault",
2094     "ResourceUnknownFault"
2095  };
2096
2097 static
2098 WidgetPortType_GetMultipleResourceProperties_fault_t
2099 GetMultipleResourceProperties_lookup_fault_type(
2100     const char *                        fault_name)
2101 0 {
2102 0     WidgetPortType_GetMultipleResourceProperties_fault_t fault_type;
2103 0     GlobusFuncName(GetMultipleResourceProperties_lookup_fault_type);
2104 0     WidgetServiceDebugEnter();
2105
2106 0     globus_assert(fault_name);
2107
2108 0     if(!strcmp(fault_name, "InvalidResourcePropertyQNameFault"))
2109     {
2110 0         fault_type = WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_INVALIDRESOURCEPROPERTYQNAMEFAULT;
2111     }
2112 0     else if(!strcmp(fault_name, "ResourceUnknownFault"))
2113     {
2114 0         fault_type = WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT;
2115     }
2116     else
2117     {
2118 0         fault_type = WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_UNKNOWN_FAULT;
2119     }
2120
2121 0     WidgetServiceDebugExit();
2122 0     return fault_type;
2123 }
2124
2125
2126     
2127 static
2128 void
2129 GetMultipleResourceProperties_deserialize_callback(
2130     void *                              handle)
2131 1777 {
2132 1777     GetMultipleResourceProperties_callback_handle_t * callback_handle;
2133 1777     globus_result_t                     result = GLOBUS_SUCCESS;
2134 1777     struct globus_soap_message_fault_s  soap_fault;
2135 1777     GetMultipleResourceProperties_init_func_t    init_function;
2136 1777     GetMultipleResourceProperties_invoke_func_t  invoke_function;
2137 1777     wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties;
2138 1777     GlobusFuncName(GetMultipleResourceProperties_deserialize_callback);
2139 1777     WidgetServiceDebugEnter();
2140
2141 1777     callback_handle = (GetMultipleResourceProperties_callback_handle_t *) handle;
2142
2143 1777     result = globus_operation_table_get_operation(
2144         WidgetService_descriptor.operations,
2145         "GetMultipleResourceProperties",
2146         (void **)&init_function,
2147         (void **)&invoke_function);
2148 1777     if(result != GLOBUS_SUCCESS)
2149     {
2150 0         goto exit;
2151     }
2152
2153 1777     if(WidgetService_descriptor.registry)
2154     {
2155 1777         globus_soap_message_handle_set_registry(
2156             callback_handle->message,
2157             WidgetService_descriptor.registry);
2158     }
2159
2160 1777     result = wsrp_GetMultipleResourcePropertiesType_init(
2161         &GetMultipleResourceProperties);
2162 1777     if(result != GLOBUS_SUCCESS)
2163     {
2164 0         goto exit;
2165     }
2166
2167 1777     if(init_function)
2168     {
2169         /* do service specific initialization stuff */
2170 1777         result = init_function(
2171             callback_handle->engine,
2172             callback_handle->message,
2173             GetMultipleResourceProperties);
2174 1777         if(result != GLOBUS_SUCCESS)
2175         {
2176 0             goto free_exit;
2177         }
2178     }
2179
2180 1777     result = wsrp_GetMultipleResourcePropertiesType_deserialize(
2181         &WidgetPortType_GetMultipleResourceProperties_input_qname,
2182         GetMultipleResourceProperties,
2183         callback_handle->message,
2184         0);
2185 1777     if(result != GLOBUS_SUCCESS)
2186     {
2187 0         goto free_exit;
2188     }
2189
2190 1777     result = globus_soap_message_handle_set_attr(
2191         callback_handle->message,
2192         "GetMultipleResourcePropertiesOperationInputParameter",
2193         wsrp_GetMultipleResourcePropertiesType_copy_wrapper,
2194         wsrp_GetMultipleResourcePropertiesType_destroy_wrapper,
2195         (void *)GetMultipleResourceProperties);
2196 1777     if(result != GLOBUS_SUCCESS)
2197     {
2198 1777         goto free_exit;
2199     }
2200
2201 free_exit:
2202 1777     wsrp_GetMultipleResourcePropertiesType_destroy(GetMultipleResourceProperties);
2203
2204  exit:
2205
2206 1777     callback_handle->callback(
2207         result,
2208         callback_handle->args);
2209 1777     free(callback_handle);
2210 1777     WidgetServiceDebugExit();
2211 }
2212 /* GetMultipleResourceProperties_deserialize_callback() */
2213
2214 static
2215 globus_result_t
2216 GetMultipleResourceProperties_deserialize(
2217     globus_service_engine_t                 engine,
2218     globus_soap_message_handle_t            message,
2219     globus_operation_invoke_callback_func_t invoke_callback,
2220     void *                                  args)
2221 1777 {
2222 1777     GetMultipleResourceProperties_callback_handle_t * callback_handle;
2223 1777     globus_result_t                    result = GLOBUS_SUCCESS;
2224 1777     GlobusFuncName(GetMultipleResourceProperties_deserialize);
2225 1777     WidgetServiceDebugEnter();
2226
2227 1777     callback_handle = malloc(sizeof(GetMultipleResourceProperties_callback_handle_t));
2228 1777     globus_assert_string(callback_handle, 
2229                          "Memory allocation failed "
2230                          "for GetMultipleResourceProperties callback handle");
2231 1777     memset(callback_handle, 0, sizeof(GetMultipleResourceProperties_callback_handle_t));
2232
2233 1777     callback_handle->engine = engine;
2234 1777     callback_handle->message = message;
2235 1777     callback_handle->callback = invoke_callback;
2236 1777     callback_handle->args = args;
2237
2238 1777     result = globus_callback_register_oneshot(
2239         NULL,
2240         &globus_i_reltime_zero,
2241         GetMultipleResourceProperties_deserialize_callback,
2242         callback_handle);
2243
2244 1777     WidgetServiceDebugExit();
2245 1777     return result;
2246 }
2247
2248 static
2249 void
2250 GetMultipleResourceProperties_invoke_callback(
2251     void *                              handle)
2252 1777 {
2253 1777     GetMultipleResourceProperties_callback_handle_t * callback_handle;
2254 1777     globus_result_t                     result = GLOBUS_SUCCESS;
2255 1777     struct globus_soap_message_fault_s  soap_fault;
2256 1777     GetMultipleResourceProperties_init_func_t    init_function;
2257 1777     GetMultipleResourceProperties_invoke_func_t  invoke_function;
2258 1777     wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties;
2259 1777     wsrp_GetMultipleResourcePropertiesResponseType GetMultipleResourcePropertiesResponse;
2260 1777      xsd_QName element_qname;
2261 1777      const char * fault_type_name = NULL;
2262 1777      WidgetPortType_GetMultipleResourceProperties_fault_t fault_type = WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_NOFAULT;
2263 1777      void *                              fault = NULL;
2264     
2265 1777     GlobusFuncName(GetMultipleResourceProperties_invoke_callback);
2266 1777     WidgetServiceDebugEnter();
2267
2268 1777     callback_handle = (GetMultipleResourceProperties_callback_handle_t *) handle;
2269
2270 1777     GetMultipleResourceProperties = globus_soap_message_handle_get_attr(
2271         callback_handle->message,
2272         "GetMultipleResourcePropertiesOperationInputParameter");
2273 1777     globus_assert(GetMultipleResourceProperties);
2274
2275 1777     result = globus_operation_table_get_operation(
2276         WidgetService_descriptor.operations,
2277         "GetMultipleResourceProperties",
2278         (void **)&init_function,
2279         (void **)&invoke_function);
2280 1777     if(result != GLOBUS_SUCCESS)
2281     {
2282 0         goto fault_exit;
2283     }
2284
2285
2286 1777     result = wsrp_GetMultipleResourcePropertiesResponseType_init_contents(
2287         &GetMultipleResourcePropertiesResponse);
2288 1777     if(result != GLOBUS_SUCCESS)
2289     {
2290 0         goto fault_exit;
2291     }
2292
2293 1777     result = invoke_function(
2294         callback_handle->engine,
2295         callback_handle->message,
2296         &WidgetService_descriptor,
2297         GetMultipleResourceProperties,
2298         &GetMultipleResourcePropertiesResponse,
2299         &fault_type_name,
2300         &fault);
2301
2302 fault_exit:
2303
2304 1777     if(fault && fault_type_name)
2305     {
2306 0         fault_type = GetMultipleResourceProperties_lookup_fault_type(fault_type_name);
2307
2308 0         result = globus_service_session_begin_response(
2309             callback_handle->message);
2310 0         if(result != GLOBUS_SUCCESS)
2311         {
2312 0             goto exit;
2313         }
2314         
2315 0         soap_fault.faultcode = "Server";
2316 0         soap_fault.faultstring = 
2317         "An error occurred while processing the message";
2318 0         soap_fault.faultactor = NULL;
2319
2320 0         switch(fault_type)
2321         {
2322         
2323         case WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_INVALIDRESOURCEPROPERTYQNAMEFAULT:
2324
2325 0             xsd_any_init(&soap_fault.detail);
2326 0             soap_fault.detail->any_info = &wsrp_InvalidResourcePropertyQNameFaultType_info;
2327 0             xsd_QName_init(&soap_fault.detail->element);
2328 0             soap_fault.detail->element->local = "InvalidResourcePropertyQNameFault";
2329 0             soap_fault.detail->element->Namespace = 
2330                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
2331 0             soap_fault.detail->value = fault;
2332 0             break;
2333
2334         case WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_RESOURCEUNKNOWNFAULT:
2335
2336 0             xsd_any_init(&soap_fault.detail);
2337 0             soap_fault.detail->any_info = &wsrp_ResourceUnknownFaultType_info;
2338 0             xsd_QName_init(&soap_fault.detail->element);
2339 0             soap_fault.detail->element->local = "ResourceUnknownFault";
2340 0             soap_fault.detail->element->Namespace = 
2341                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
2342 0             soap_fault.detail->value = fault;
2343 0             break;
2344
2345         default:
2346 0             result = WidgetServiceErrorReturnedUnknownFault("GetMultipleResourceProperties");
2347 0             goto exit;
2348         }         
2349
2350 0         result = globus_service_session_serialize_fault_response(
2351             callback_handle->message, &soap_fault);
2352 0         if(result != GLOBUS_SUCCESS)
2353         {
2354 0             goto exit;
2355         }
2356
2357 0         soap_fault.detail->element->local = NULL;
2358 0         soap_fault.detail->element->Namespace = NULL;
2359 0 soap_fault.detail->any_info = NULL;
2360 0         xsd_any_destroy(soap_fault.detail);
2361
2362 0         globus_soap_message_handle_set_attr(
2363             callback_handle->message, 
2364             WSADDR_ACTION_RESPONSE_KEY,
2365             globus_soap_message_attr_copy_string,
2366             globus_libc_free,
2367             WSADDRESSING_FAULT_NS);
2368     }
2369 1777     else if(result != GLOBUS_SUCCESS)
2370     {
2371 0         globus_result_t                 local_result;
2372 0         local_result = globus_service_session_begin_response(
2373             callback_handle->message);
2374 0         if(local_result != GLOBUS_SUCCESS)
2375         {
2376 0             result = local_result;
2377 0             goto exit;
2378         }
2379
2380 0         soap_fault.faultcode = "Server";
2381 0         soap_fault.faultstring = globus_error_print_friendly(
2382             globus_error_get(result));
2383 0         result = GLOBUS_SUCCESS;
2384 0         soap_fault.faultactor = NULL;
2385 0         soap_fault.detail = NULL;
2386 0         result = globus_service_session_serialize_fault_response(
2387             callback_handle->message, &soap_fault);
2388 0         if(result != GLOBUS_SUCCESS)
2389         {
2390 0             goto exit;
2391         }
2392
2393 0         globus_soap_message_handle_set_attr(
2394             callback_handle->message, 
2395             WSADDR_ACTION_RESPONSE_KEY,
2396             globus_soap_message_attr_copy_string,
2397             globus_libc_free, 
2398             WSADDRESSING_FAULT_NS);
2399     }
2400     else
2401     {
2402 1777         result = globus_service_session_begin_response(
2403             callback_handle->message);
2404 1777         if(result != GLOBUS_SUCCESS)
2405         {
2406 0             goto exit;
2407         }
2408
2409 1777         element_qname.local = "GetMultipleResourcePropertiesResponse";
2410 1777         element_qname.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
2411
2412 1777         result = wsrp_GetMultipleResourcePropertiesResponseType_serialize(
2413             &element_qname,
2414             &GetMultipleResourcePropertiesResponse,
2415             callback_handle->message,
2416             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
2417 1777         if(result != GLOBUS_SUCCESS)
2418         {
2419 0             goto exit;
2420         }
2421
2422 1777         result = globus_service_session_end_response(
2423             callback_handle->message);
2424 1777         if(result != GLOBUS_SUCCESS)
2425         {
2426 0             goto exit;
2427         }
2428
2429 1777         wsrp_GetMultipleResourcePropertiesResponseType_destroy_contents(
2430             &GetMultipleResourcePropertiesResponse);
2431
2432 1777         globus_soap_message_handle_set_attr(
2433             callback_handle->message, 
2434             WSADDR_ACTION_RESPONSE_KEY,
2435             globus_soap_message_attr_copy_string,
2436             globus_libc_free, 
2437             "http://widgets.com/WidgetPortType/GetMultipleResourcePropertiesResponse");
2438     }
2439
2440  exit:
2441
2442 1777     callback_handle->callback(
2443         result,
2444         callback_handle->args);
2445
2446 1777     globus_libc_free(callback_handle);
2447
2448 1777     WidgetServiceDebugExit();
2449 }
2450
2451 static
2452 globus_result_t
2453 GetMultipleResourceProperties_invoke(
2454     globus_service_engine_t                 engine,
2455     globus_soap_message_handle_t            message,
2456     globus_service_response_t *             response,
2457     globus_operation_invoke_callback_func_t invoke_callback,
2458     void *                                  args)
2459 1777 {
2460 1777     GetMultipleResourceProperties_callback_handle_t * callback_handle;
2461 1777     globus_result_t                    result = GLOBUS_SUCCESS;
2462 1777     GlobusFuncName(WidgetPortType_GetMultipleResourceProperties);
2463 1777     WidgetServiceDebugEnter();
2464
2465 1777     callback_handle = malloc(sizeof(GetMultipleResourceProperties_callback_handle_t));
2466 1777     if(!callback_handle)
2467     {
2468 0         result = GlobusSoapMessageErrorOutOfMemory;
2469 0         goto exit;
2470     }
2471 1777     memset(callback_handle, 0, sizeof(GetMultipleResourceProperties_callback_handle_t));
2472
2473 1777     callback_handle->engine = engine;
2474 1777     callback_handle->message = message;
2475 1777     callback_handle->callback = invoke_callback;
2476 1777     callback_handle->args = args;
2477
2478 1777     result = globus_callback_register_oneshot(
2479         NULL,
2480         &globus_i_reltime_zero,
2481         GetMultipleResourceProperties_invoke_callback,
2482         callback_handle);
2483
2484  exit:
2485 1777     WidgetServiceDebugExit();
2486 1777     return result;
2487 }
2488
2489 static
2490 globus_service_operation_descriptor_t 
2491 GetMultipleResourceProperties_operation_descriptor =
2492 {
2493     GetMultipleResourceProperties_deserialize,
2494     GetMultipleResourceProperties_invoke
2495 };
2496
2497 static
2498 globus_operation_provider_descriptor_t GetMultipleResourceProperties_descriptor =
2499 {
2500     &WidgetPortType_GetMultipleResourceProperties_op_qname,
2501     "GetMultipleResourceProperties",
2502     (void *)WidgetPortType_GetMultipleResourceProperties_init,
2503     (void *)WidgetPortType_GetMultipleResourceProperties_impl,
2504     NULL
2505 };
2506
2507
2508 xsd_QName WidgetPortType_GetResourceProperty_op_qname = 
2509 {
2510     "http://widgets.com",
2511     "GetResourceProperty"
2512 };
2513
2514 xsd_QName WidgetPortType_GetResourceProperty_input_qname =
2515 {
2516      "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd",
2517      "GetResourceProperty"
2518 };
2519
2520 typedef globus_result_t (* GetResourceProperty_init_func_t) (
2521     globus_service_engine_t             engine,
2522     globus_soap_message_handle_t        message,
2523     xsd_QName * GetResourceProperty);
2524
2525 typedef globus_result_t (* GetResourceProperty_invoke_func_t) (
2526     globus_service_engine_t             engine,
2527     globus_soap_message_handle_t        message,
2528     globus_service_descriptor_t *       descriptor,
2529     xsd_QName * GetResourceProperty,
2530     wsrp_GetResourcePropertyResponseType * GetResourcePropertyResponse,
2531     const char ** fault_type_name,
2532     void ** fault);
2533     
2534 typedef struct GetResourceProperty_callback_handle_s
2535 {
2536     globus_service_engine_t                 engine;
2537     globus_soap_message_handle_t            message;
2538     globus_operation_invoke_callback_func_t callback;
2539     void *                                  args;
2540 } GetResourceProperty_callback_handle_t;
2541
2542
2543 const char * WidgetPortType_GetResourceProperty_fault_strings[WIDGETPORTTYPE_GETRESOURCEPROPERTY_RESOURCEUNKNOWNFAULT] =
2544 {
2545     "Unknown",
2546     "InvalidResourcePropertyQNameFault",
2547     "ResourceUnknownFault"
2548  };
2549
2550 static
2551 WidgetPortType_GetResourceProperty_fault_t
2552 GetResourceProperty_lookup_fault_type(
2553     const char *                        fault_name)
2554 0 {
2555 0     WidgetPortType_GetResourceProperty_fault_t fault_type;
2556 0     GlobusFuncName(GetResourceProperty_lookup_fault_type);
2557 0     WidgetServiceDebugEnter();
2558
2559 0     globus_assert(fault_name);
2560
2561 0     if(!strcmp(fault_name, "InvalidResourcePropertyQNameFault"))
2562     {
2563 0         fault_type = WIDGETPORTTYPE_GETRESOURCEPROPERTY_INVALIDRESOURCEPROPERTYQNAMEFAULT;
2564     }
2565 0     else if(!strcmp(fault_name, "ResourceUnknownFault"))
2566     {
2567 0         fault_type = WIDGETPORTTYPE_GETRESOURCEPROPERTY_RESOURCEUNKNOWNFAULT;
2568     }
2569     else
2570     {
2571 0         fault_type = WIDGETPORTTYPE_GETRESOURCEPROPERTY_UNKNOWN_FAULT;
2572     }
2573
2574 0     WidgetServiceDebugExit();
2575 0     return fault_type;
2576 }
2577
2578
2579     
2580 static
2581 void
2582 GetResourceProperty_deserialize_callback(
2583     void *                              handle)
2584 5 {
2585 5     GetResourceProperty_callback_handle_t * callback_handle;
2586 5     globus_result_t                     result = GLOBUS_SUCCESS;
2587 5     struct globus_soap_message_fault_s  soap_fault;
2588 5     GetResourceProperty_init_func_t    init_function;
2589 5     GetResourceProperty_invoke_func_t  invoke_function;
2590 5     xsd_QName * GetResourceProperty;
2591 5     GlobusFuncName(GetResourceProperty_deserialize_callback);
2592 5     WidgetServiceDebugEnter();
2593
2594 5     callback_handle = (GetResourceProperty_callback_handle_t *) handle;
2595
2596 5     result = globus_operation_table_get_operation(
2597         WidgetService_descriptor.operations,
2598         "GetResourceProperty",
2599         (void **)&init_function,
2600         (void **)&invoke_function);
2601 5     if(result != GLOBUS_SUCCESS)
2602     {
2603 0         goto exit;
2604     }
2605
2606 5     if(WidgetService_descriptor.registry)
2607     {
2608 5         globus_soap_message_handle_set_registry(
2609             callback_handle->message,
2610             WidgetService_descriptor.registry);
2611     }
2612
2613 5     result = xsd_QName_init(
2614         &GetResourceProperty);
2615 5     if(result != GLOBUS_SUCCESS)
2616     {
2617 0         goto exit;
2618     }
2619
2620 5     if(init_function)
2621     {
2622         /* do service specific initialization stuff */
2623 5         result = init_function(
2624             callback_handle->engine,
2625             callback_handle->message,
2626             GetResourceProperty);
2627 5         if(result != GLOBUS_SUCCESS)
2628         {
2629 0             goto free_exit;
2630         }
2631     }
2632
2633 5     result = xsd_QName_deserialize(
2634         &WidgetPortType_GetResourceProperty_input_qname,
2635         GetResourceProperty,
2636         callback_handle->message,
2637         0);
2638 5     if(result != GLOBUS_SUCCESS)
2639     {
2640 0         goto free_exit;
2641     }
2642
2643 5     result = globus_soap_message_handle_set_attr(
2644         callback_handle->message,
2645         "GetResourcePropertyOperationInputParameter",
2646         xsd_QName_copy_wrapper,
2647         xsd_QName_destroy_wrapper,
2648         (void *)GetResourceProperty);
2649 5     if(result != GLOBUS_SUCCESS)
2650     {
2651 5         goto free_exit;
2652     }
2653
2654 free_exit:
2655 5     xsd_QName_destroy(GetResourceProperty);
2656
2657  exit:
2658
2659 5     callback_handle->callback(
2660         result,
2661         callback_handle->args);
2662 5     free(callback_handle);
2663 5     WidgetServiceDebugExit();
2664 }
2665 /* GetResourceProperty_deserialize_callback() */
2666
2667 static
2668 globus_result_t
2669 GetResourceProperty_deserialize(
2670     globus_service_engine_t                 engine,
2671     globus_soap_message_handle_t            message,
2672     globus_operation_invoke_callback_func_t invoke_callback,
2673     void *                                  args)
2674 5 {
2675 5     GetResourceProperty_callback_handle_t * callback_handle;
2676 5     globus_result_t                    result = GLOBUS_SUCCESS;
2677 5     GlobusFuncName(GetResourceProperty_deserialize);
2678 5     WidgetServiceDebugEnter();
2679
2680 5     callback_handle = malloc(sizeof(GetResourceProperty_callback_handle_t));
2681 5     globus_assert_string(callback_handle, 
2682                          "Memory allocation failed "
2683                          "for GetResourceProperty callback handle");
2684 5     memset(callback_handle, 0, sizeof(GetResourceProperty_callback_handle_t));
2685
2686 5     callback_handle->engine = engine;
2687 5     callback_handle->message = message;
2688 5     callback_handle->callback = invoke_callback;
2689 5     callback_handle->args = args;
2690
2691 5     result = globus_callback_register_oneshot(
2692         NULL,
2693         &globus_i_reltime_zero,
2694         GetResourceProperty_deserialize_callback,
2695         callback_handle);
2696
2697 5     WidgetServiceDebugExit();
2698 5     return result;
2699 }
2700
2701 static
2702 void
2703 GetResourceProperty_invoke_callback(
2704     void *                              handle)
2705 5 {
2706 5     GetResourceProperty_callback_handle_t * callback_handle;
2707 5     globus_result_t                     result = GLOBUS_SUCCESS;
2708 5     struct globus_soap_message_fault_s  soap_fault;
2709 5     GetResourceProperty_init_func_t    init_function;
2710 5     GetResourceProperty_invoke_func_t  invoke_function;
2711 5     xsd_QName * GetResourceProperty;
2712 5     wsrp_GetResourcePropertyResponseType GetResourcePropertyResponse;
2713 5      xsd_QName element_qname;
2714 5      const char * fault_type_name = NULL;
2715 5      WidgetPortType_GetResourceProperty_fault_t fault_type = WIDGETPORTTYPE_GETRESOURCEPROPERTY_NOFAULT;
2716 5      void *                              fault = NULL;
2717     
2718 5     GlobusFuncName(GetResourceProperty_invoke_callback);
2719 5     WidgetServiceDebugEnter();
2720
2721 5     callback_handle = (GetResourceProperty_callback_handle_t *) handle;
2722
2723 5     GetResourceProperty = globus_soap_message_handle_get_attr(
2724         callback_handle->message,
2725         "GetResourcePropertyOperationInputParameter");
2726 5     globus_assert(GetResourceProperty);
2727
2728 5     result = globus_operation_table_get_operation(
2729         WidgetService_descriptor.operations,
2730         "GetResourceProperty",
2731         (void **)&init_function,
2732         (void **)&invoke_function);
2733 5     if(result != GLOBUS_SUCCESS)
2734     {
2735 0         goto fault_exit;
2736     }
2737
2738
2739 5     result = wsrp_GetResourcePropertyResponseType_init_contents(
2740         &GetResourcePropertyResponse);
2741 5     if(result != GLOBUS_SUCCESS)
2742     {
2743 0         goto fault_exit;
2744     }
2745
2746 5     result = invoke_function(
2747         callback_handle->engine,
2748         callback_handle->message,
2749         &WidgetService_descriptor,
2750         GetResourceProperty,
2751         &GetResourcePropertyResponse,
2752         &fault_type_name,
2753         &fault);
2754
2755 fault_exit:
2756
2757 5     if(fault && fault_type_name)
2758     {
2759 0         fault_type = GetResourceProperty_lookup_fault_type(fault_type_name);
2760
2761 0         result = globus_service_session_begin_response(
2762             callback_handle->message);
2763 0         if(result != GLOBUS_SUCCESS)
2764         {
2765 0             goto exit;
2766         }
2767         
2768 0         soap_fault.faultcode = "Server";
2769 0         soap_fault.faultstring = 
2770         "An error occurred while processing the message";
2771 0         soap_fault.faultactor = NULL;
2772
2773 0         switch(fault_type)
2774         {
2775         
2776         case WIDGETPORTTYPE_GETRESOURCEPROPERTY_INVALIDRESOURCEPROPERTYQNAMEFAULT:
2777
2778 0             xsd_any_init(&soap_fault.detail);
2779 0             soap_fault.detail->any_info = &wsrp_InvalidResourcePropertyQNameFaultType_info;
2780 0             xsd_QName_init(&soap_fault.detail->element);
2781 0             soap_fault.detail->element->local = "InvalidResourcePropertyQNameFault";
2782 0             soap_fault.detail->element->Namespace = 
2783                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
2784 0             soap_fault.detail->value = fault;
2785 0             break;
2786
2787         case WIDGETPORTTYPE_GETRESOURCEPROPERTY_RESOURCEUNKNOWNFAULT:
2788
2789 0             xsd_any_init(&soap_fault.detail);
2790 0             soap_fault.detail->any_info = &wsrp_ResourceUnknownFaultType_info;
2791 0             xsd_QName_init(&soap_fault.detail->element);
2792 0             soap_fault.detail->element->local = "ResourceUnknownFault";
2793 0             soap_fault.detail->element->Namespace = 
2794                 "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
2795 0             soap_fault.detail->value = fault;
2796 0             break;
2797
2798         default:
2799 0             result = WidgetServiceErrorReturnedUnknownFault("GetResourceProperty");
2800 0             goto exit;
2801         }         
2802
2803 0         result = globus_service_session_serialize_fault_response(
2804             callback_handle->message, &soap_fault);
2805 0         if(result != GLOBUS_SUCCESS)
2806         {
2807 0             goto exit;
2808         }
2809
2810 0         soap_fault.detail->element->local = NULL;
2811 0         soap_fault.detail->element->Namespace = NULL;
2812 0 soap_fault.detail->any_info = NULL;
2813 0         xsd_any_destroy(soap_fault.detail);
2814
2815 0         globus_soap_message_handle_set_attr(
2816             callback_handle->message, 
2817             WSADDR_ACTION_RESPONSE_KEY,
2818             globus_soap_message_attr_copy_string,
2819             globus_libc_free,
2820             WSADDRESSING_FAULT_NS);
2821     }
2822 5     else if(result != GLOBUS_SUCCESS)
2823     {
2824 0         globus_result_t                 local_result;
2825 0         local_result = globus_service_session_begin_response(
2826             callback_handle->message);
2827 0         if(local_result != GLOBUS_SUCCESS)
2828         {
2829 0             result = local_result;
2830 0             goto exit;
2831         }
2832
2833 0         soap_fault.faultcode = "Server";
2834 0         soap_fault.faultstring = globus_error_print_friendly(
2835             globus_error_get(result));
2836 0         result = GLOBUS_SUCCESS;
2837 0         soap_fault.faultactor = NULL;
2838 0         soap_fault.detail = NULL;
2839 0         result = globus_service_session_serialize_fault_response(
2840             callback_handle->message, &soap_fault);
2841 0         if(result != GLOBUS_SUCCESS)
2842         {
2843 0             goto exit;
2844         }
2845
2846 0         globus_soap_message_handle_set_attr(
2847             callback_handle->message, 
2848             WSADDR_ACTION_RESPONSE_KEY,
2849             globus_soap_message_attr_copy_string,
2850             globus_libc_free, 
2851             WSADDRESSING_FAULT_NS);
2852     }
2853     else
2854     {
2855 5         result = globus_service_session_begin_response(
2856             callback_handle->message);
2857 5         if(result != GLOBUS_SUCCESS)
2858         {
2859 0             goto exit;
2860         }
2861
2862 5         element_qname.local = "GetResourcePropertyResponse";
2863 5         element_qname.Namespace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
2864
2865 5         result = wsrp_GetResourcePropertyResponseType_serialize(
2866             &element_qname,
2867             &GetResourcePropertyResponse,
2868             callback_handle->message,
2869             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
2870 5         if(result != GLOBUS_SUCCESS)
2871         {
2872 0             goto exit;
2873         }
2874
2875 5         result = globus_service_session_end_response(
2876             callback_handle->message);
2877 5         if(result != GLOBUS_SUCCESS)
2878         {
2879 0             goto exit;
2880         }
2881
2882 5         wsrp_GetResourcePropertyResponseType_destroy_contents(
2883             &GetResourcePropertyResponse);
2884
2885 5         globus_soap_message_handle_set_attr(
2886             callback_handle->message, 
2887             WSADDR_ACTION_RESPONSE_KEY,
2888             globus_soap_message_attr_copy_string,
2889             globus_libc_free, 
2890             "http://widgets.com/WidgetPortType/GetResourcePropertyResponse");
2891     }
2892
2893  exit:
2894
2895 5     callback_handle->callback(
2896         result,
2897         callback_handle->args);
2898
2899 5     globus_libc_free(callback_handle);
2900
2901 5     WidgetServiceDebugExit();
2902 }
2903
2904 static
2905 globus_result_t
2906 GetResourceProperty_invoke(
2907     globus_service_engine_t                 engine,
2908     globus_soap_message_handle_t            message,
2909     globus_service_response_t *             response,
2910     globus_operation_invoke_callback_func_t invoke_callback,
2911     void *                                  args)
2912 5 {
2913 5     GetResourceProperty_callback_handle_t * callback_handle;
2914 5     globus_result_t                    result = GLOBUS_SUCCESS;
2915 5     GlobusFuncName(WidgetPortType_GetResourceProperty);
2916 5     WidgetServiceDebugEnter();
2917
2918 5     callback_handle = malloc(sizeof(GetResourceProperty_callback_handle_t));
2919 5     if(!callback_handle)
2920     {
2921 0         result = GlobusSoapMessageErrorOutOfMemory;
2922 0         goto exit;
2923     }
2924 5     memset(callback_handle, 0, sizeof(GetResourceProperty_callback_handle_t));
2925
2926 5     callback_handle->engine = engine;
2927 5     callback_handle->message = message;
2928 5     callback_handle->callback = invoke_callback;
2929 5     callback_handle->args = args;
2930
2931 5     result = globus_callback_register_oneshot(
2932         NULL,
2933         &globus_i_reltime_zero,
2934         GetResourceProperty_invoke_callback,
2935         callback_handle);
2936
2937  exit:
2938 5     WidgetServiceDebugExit();
2939 5     return result;
2940 }
2941
2942 static
2943 globus_service_operation_descriptor_t 
2944 GetResourceProperty_operation_descriptor =
2945 {
2946     GetResourceProperty_deserialize,
2947     GetResourceProperty_invoke
2948 };
2949
2950 static
2951 globus_operation_provider_descriptor_t GetResourceProperty_descriptor =
2952 {
2953     &WidgetPortType_GetResourceProperty_op_qname,
2954     "GetResourceProperty",
2955     (void *)WidgetPortType_GetResourceProperty_init,
2956     (void *)WidgetPortType_GetResourceProperty_impl,
2957     NULL
2958 };
2959
2960
2961 xsd_QName WidgetPortType_createWidget_op_qname = 
2962 {
2963     "http://widgets.com",
2964     "createWidget"
2965 };
2966
2967 xsd_QName WidgetPortType_createWidget_input_qname =
2968 {
2969      "http://widgets.com",
2970      "createWidget"
2971 };
2972
2973 typedef globus_result_t (* createWidget_init_func_t) (
2974     globus_service_engine_t             engine,
2975     globus_soap_message_handle_t        message,
2976     createWidgetType * createWidget);
2977
2978 typedef globus_result_t (* createWidget_invoke_func_t) (
2979     globus_service_engine_t             engine,
2980     globus_soap_message_handle_t        message,
2981     globus_service_descriptor_t *       descriptor,
2982     createWidgetType * createWidget,
2983     createWidgetResponseType * createWidgetResponse,
2984     const char ** fault_type_name,
2985     void ** fault);
2986     
2987 typedef struct createWidget_callback_handle_s
2988 {
2989     globus_service_engine_t                 engine;
2990     globus_soap_message_handle_t            message;
2991     globus_operation_invoke_callback_func_t callback;
2992     void *                                  args;
2993 } createWidget_callback_handle_t;
2994
2995             
2996 const char * WidgetPortType_createWidget_fault_strings[WIDGETPORTTYPE_CREATEWIDGET_UNKNOWN_FAULT] =
2997 {
2998     "Unknown"
2999
3000  };
3001
3002 static
3003 WidgetPortType_createWidget_fault_t
3004 createWidget_lookup_fault_type(
3005     const char *                        fault_name)
3006 0 {
3007 0     WidgetPortType_createWidget_fault_t fault_type;
3008 0     GlobusFuncName(createWidget_lookup_fault_type);
3009 0     WidgetServiceDebugEnter();
3010
3011 0     globus_assert(fault_name);
3012
3013    
3014     {
3015 0         fault_type = WIDGETPORTTYPE_CREATEWIDGET_UNKNOWN_FAULT;
3016     }
3017
3018 0     WidgetServiceDebugExit();
3019 0     return fault_type;
3020 }
3021
3022
3023     
3024 static
3025 void
3026 createWidget_deserialize_callback(
3027     void *                              handle)
3028 21 {
3029 21     createWidget_callback_handle_t * callback_handle;
3030 21     globus_result_t                     result = GLOBUS_SUCCESS;
3031 21     struct globus_soap_message_fault_s  soap_fault;
3032 21     createWidget_init_func_t    init_function;
3033 21     createWidget_invoke_func_t  invoke_function;
3034 21     createWidgetType * createWidget;
3035 21     GlobusFuncName(createWidget_deserialize_callback);
3036 21     WidgetServiceDebugEnter();
3037
3038 21     callback_handle = (createWidget_callback_handle_t *) handle;
3039
3040 21     result = globus_operation_table_get_operation(
3041         WidgetService_descriptor.operations,
3042         "createWidget",
3043         (void **)&init_function,
3044         (void **)&invoke_function);
3045 21     if(result != GLOBUS_SUCCESS)
3046     {
3047 0         goto exit;
3048     }
3049
3050 21     if(WidgetService_descriptor.registry)
3051     {
3052 21         globus_soap_message_handle_set_registry(
3053             callback_handle->message,
3054             WidgetService_descriptor.registry);
3055     }
3056
3057 21     result = createWidgetType_init(
3058         &createWidget);
3059 21     if(result != GLOBUS_SUCCESS)
3060     {
3061 0         goto exit;
3062     }
3063
3064 21     if(init_function)
3065     {
3066         /* do service specific initialization stuff */
3067 21         result = init_function(
3068             callback_handle->engine,
3069             callback_handle->message,
3070             createWidget);
3071 21         if(result != GLOBUS_SUCCESS)
3072         {
3073 0             goto free_exit;
3074         }
3075     }
3076
3077 21     result = createWidgetType_deserialize(
3078         &WidgetPortType_createWidget_input_qname,
3079         createWidget,
3080         callback_handle->message,
3081         0);
3082 21     if(result != GLOBUS_SUCCESS)
3083     {
3084 0         goto free_exit;
3085     }
3086
3087 21     result = globus_soap_message_handle_set_attr(
3088         callback_handle->message,
3089         "createWidgetOperationInputParameter",
3090         createWidgetType_copy_wrapper,
3091         createWidgetType_destroy_wrapper,
3092         (void *)createWidget);
3093 21     if(result != GLOBUS_SUCCESS)
3094     {
3095 21         goto free_exit;
3096     }
3097
3098 free_exit:
3099 21     createWidgetType_destroy(createWidget);
3100
3101  exit:
3102
3103 21     callback_handle->callback(
3104         result,
3105         callback_handle->args);
3106 21     free(callback_handle);
3107 21     WidgetServiceDebugExit();
3108 }
3109 /* createWidget_deserialize_callback() */
3110
3111 static
3112 globus_result_t
3113 createWidget_deserialize(
3114     globus_service_engine_t                 engine,
3115     globus_soap_message_handle_t            message,
3116     globus_operation_invoke_callback_func_t invoke_callback,
3117     void *                                  args)
3118 21 {
3119 21     createWidget_callback_handle_t * callback_handle;
3120 21     globus_result_t                    result = GLOBUS_SUCCESS;
3121 21     GlobusFuncName(createWidget_deserialize);
3122 21     WidgetServiceDebugEnter();
3123
3124 21     callback_handle = malloc(sizeof(createWidget_callback_handle_t));
3125 21     globus_assert_string(callback_handle, 
3126                          "Memory allocation failed "
3127                          "for createWidget callback handle");
3128 21     memset(callback_handle, 0, sizeof(createWidget_callback_handle_t));
3129
3130 21     callback_handle->engine = engine;
3131 21     callback_handle->message = message;
3132 21     callback_handle->callback = invoke_callback;
3133 21     callback_handle->args = args;
3134
3135 21     result = globus_callback_register_oneshot(
3136         NULL,
3137         &globus_i_reltime_zero,
3138         createWidget_deserialize_callback,
3139         callback_handle);
3140
3141 21     WidgetServiceDebugExit();
3142 21     return result;
3143 }
3144
3145 static
3146 void
3147 createWidget_invoke_callback(
3148     void *                              handle)
3149 21 {
3150 21     createWidget_callback_handle_t * callback_handle;
3151 21     globus_result_t                     result = GLOBUS_SUCCESS;
3152 21     struct globus_soap_message_fault_s  soap_fault;
3153 21     createWidget_init_func_t    init_function;
3154 21     createWidget_invoke_func_t  invoke_function;
3155 21     createWidgetType * createWidget;
3156 21     createWidgetResponseType createWidgetResponse;
3157 21      xsd_QName element_qname;
3158 21      const char * fault_type_name = NULL;
3159 21      WidgetPortType_createWidget_fault_t fault_type = WIDGETPORTTYPE_CREATEWIDGET_NOFAULT;
3160 21      void *                              fault = NULL;
3161     
3162 21     GlobusFuncName(createWidget_invoke_callback);
3163 21     WidgetServiceDebugEnter();
3164
3165 21     callback_handle = (createWidget_callback_handle_t *) handle;
3166
3167 21     createWidget = globus_soap_message_handle_get_attr(
3168         callback_handle->message,
3169         "createWidgetOperationInputParameter");
3170 21     globus_assert(createWidget);
3171
3172 21     result = globus_operation_table_get_operation(
3173         WidgetService_descriptor.operations,
3174         "createWidget",
3175         (void **)&init_function,
3176         (void **)&invoke_function);
3177 21     if(result != GLOBUS_SUCCESS)
3178     {
3179 0         goto fault_exit;
3180     }
3181
3182
3183 21     result = createWidgetResponseType_init_contents(
3184         &createWidgetResponse);
3185 21     if(result != GLOBUS_SUCCESS)
3186     {
3187 0         goto fault_exit;
3188     }
3189
3190 21     result = invoke_function(
3191         callback_handle->engine,
3192         callback_handle->message,
3193         &WidgetService_descriptor,
3194         createWidget,
3195         &createWidgetResponse,
3196         &fault_type_name,
3197         &fault);
3198
3199 fault_exit:
3200
3201 21     if(fault && fault_type_name)
3202     {
3203 0         fault_type = createWidget_lookup_fault_type(fault_type_name);
3204
3205 0         result = globus_service_session_begin_response(
3206             callback_handle->message);
3207 0         if(result != GLOBUS_SUCCESS)
3208         {
3209 0             goto exit;
3210         }
3211         
3212 0         soap_fault.faultcode = "Server";
3213 0         soap_fault.faultstring = 
3214         "An error occurred while processing the message";
3215 0         soap_fault.faultactor = NULL;
3216
3217 0         switch(fault_type)
3218         {
3219         
3220         default:
3221 0             result = WidgetServiceErrorReturnedUnknownFault("createWidget");
3222 0             goto exit;
3223         }         
3224
3225 21         result = globus_service_session_serialize_fault_response(
3226             callback_handle->message, &soap_fault);
3227 21         if(result != GLOBUS_SUCCESS)
3228         {
3229 21             goto exit;
3230         }
3231
3232 21         soap_fault.detail->element->local = NULL;
3233 21         soap_fault.detail->element->Namespace = NULL;
3234 21 soap_fault.detail->any_info = NULL;
3235 21         xsd_any_destroy(soap_fault.detail);
3236
3237 21         globus_soap_message_handle_set_attr(
3238             callback_handle->message, 
3239             WSADDR_ACTION_RESPONSE_KEY,
3240             globus_soap_message_attr_copy_string,
3241             globus_libc_free,
3242             WSADDRESSING_FAULT_NS);
3243     }
3244 21     else if(result != GLOBUS_SUCCESS)
3245     {
3246 0         globus_result_t                 local_result;
3247 0         local_result = globus_service_session_begin_response(
3248             callback_handle->message);
3249 0         if(local_result != GLOBUS_SUCCESS)
3250         {
3251 0             result = local_result;
3252 0             goto exit;
3253         }
3254
3255 0         soap_fault.faultcode = "Server";
3256 0         soap_fault.faultstring = globus_error_print_friendly(
3257             globus_error_get(result));
3258 0         result = GLOBUS_SUCCESS;
3259 0         soap_fault.faultactor = NULL;
3260 0         soap_fault.detail = NULL;
3261 0         result = globus_service_session_serialize_fault_response(
3262             callback_handle->message, &soap_fault);
3263 0         if(result != GLOBUS_SUCCESS)
3264         {
3265 0             goto exit;
3266         }
3267
3268 0         globus_soap_message_handle_set_attr(
3269             callback_handle->message, 
3270             WSADDR_ACTION_RESPONSE_KEY,
3271             globus_soap_message_attr_copy_string,
3272             globus_libc_free, 
3273             WSADDRESSING_FAULT_NS);
3274     }
3275     else
3276     {
3277 21         result = globus_service_session_begin_response(
3278             callback_handle->message);
3279 21         if(result != GLOBUS_SUCCESS)
3280         {
3281 0             goto exit;
3282         }
3283
3284 21         element_qname.local = "createWidgetResponse";
3285 21         element_qname.Namespace = "http://widgets.com";
3286
3287 21         result = createWidgetResponseType_serialize(
3288             &element_qname,
3289             &createWidgetResponse,
3290             callback_handle->message,
3291             GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS);
3292 21         if(result != GLOBUS_SUCCESS)
3293         {
3294 0             goto exit;
3295         }
3296
3297 21         result = globus_service_session_end_response(
3298             callback_handle->message);
3299 21         if(result != GLOBUS_SUCCESS)
3300         {
3301 0             goto exit;
3302         }
3303
3304 21         createWidgetResponseType_destroy_contents(
3305             &createWidgetResponse);
3306
3307 21         globus_soap_message_handle_set_attr(
3308             callback_handle->message, 
3309             WSADDR_ACTION_RESPONSE_KEY,
3310             globus_soap_message_attr_copy_string,
3311             globus_libc_free, 
3312             "http://widgets.com/WidgetPortType/createWidgetResponse");
3313     }
3314
3315  exit:
3316
3317 21     callback_handle->callback(
3318         result,
3319         callback_handle->args);
3320
3321 21     globus_libc_free(callback_handle);
3322
3323 21     WidgetServiceDebugExit();
3324 }
3325
3326 static
3327 globus_result_t
3328 createWidget_invoke(
3329     globus_service_engine_t                 engine,
3330     globus_soap_message_handle_t            message,
3331     globus_service_response_t *             response,
3332     globus_operation_invoke_callback_func_t invoke_callback,
3333     void *                                  args)
3334 21 {
3335 21     createWidget_callback_handle_t * callback_handle;
3336 21     globus_result_t                    result = GLOBUS_SUCCESS;
3337 21     GlobusFuncName(WidgetPortType_createWidget);
3338 21     WidgetServiceDebugEnter();
3339
3340 21     callback_handle = malloc(sizeof(createWidget_callback_handle_t));
3341 21     if(!callback_handle)
3342     {
3343 0         result = GlobusSoapMessageErrorOutOfMemory;
3344 0         goto exit;
3345     }
3346 21     memset(callback_handle, 0, sizeof(createWidget_callback_handle_t));
3347
3348 21     callback_handle->engine = engine;
3349 21     callback_handle->message = message;
3350 21     callback_handle->callback = invoke_callback;
3351 21     callback_handle->args = args;
3352
3353 21     result = globus_callback_register_oneshot(
3354         NULL,
3355         &globus_i_reltime_zero,
3356         createWidget_invoke_callback,
3357         callback_handle);
3358
3359  exit:
3360 21     WidgetServiceDebugExit();
3361 21     return result;
3362 }
3363
3364 static
3365 globus_service_operation_descriptor_t 
3366 createWidget_operation_descriptor =
3367 {
3368     createWidget_deserialize,
3369     createWidget_invoke
3370 };
3371
3372 static
3373 globus_operation_provider_descriptor_t createWidget_descriptor =
3374 {
3375     &WidgetPortType_createWidget_op_qname,
3376     "createWidget",
3377     (void *)WidgetPortType_createWidget_init,
3378     (void *)WidgetPortType_createWidget_impl,
3379     NULL
3380 };
3381
3382
3383
3384 static xsd_QName wsrp_GetResourceProperty_qname;
3385 static xsd_QName wsrp_GetMultipleResourceProperties_qname;
3386 static xsd_QName wsrp_SetResourceProperties_qname;
3387 static xsd_QName wsrp_QueryResourceProperties_qname;
3388 static xsd_QName wsrl_Destroy_qname;
3389 static xsd_QName wsrl_SetTerminationTime_qname;
3390
3391 static
3392 int
3393 WidgetService_activate()
3394 3 {
3395 3     globus_result_t                     result = GLOBUS_SUCCESS;
3396 3     int                                 rc = 0;
3397 3     GlobusFuncName(WidgetService_activate);
3398
3399 3     rc = globus_module_activate(WIDGETSERVICE_MODULE);
3400 3     if(rc != GLOBUS_SUCCESS)
3401     {
3402 0         return rc;
3403     }
3404
3405 3     WidgetServiceDebugEnter();
3406
3407 3     result = globus_module_activate(GLOBUS_WSRF_RESOURCE_MODULE);
3408 3     if (result != GLOBUS_SUCCESS)
3409     {
3410 0         rc = (int) result;
3411 0         goto exit;
3412     }
3413
3414 3     rc = globus_extension_activate(
3415         "globus_wsrp_GetResourceProperty_provider");
3416 3     if(rc != GLOBUS_SUCCESS)
3417     {
3418 0         goto deactivate_resource_out;
3419     }
3420
3421 3     rc = globus_extension_activate(
3422             "globus_wsrp_GetMultipleResourceProperties_provider");
3423 3     if (rc != GLOBUS_SUCCESS)
3424     {
3425 0         goto deactivate_getrp;
3426     }
3427
3428 3     rc = globus_extension_activate(
3429             "globus_wsrp_SetResourceProperties_provider");
3430 3     if (rc != GLOBUS_SUCCESS)
3431     {
3432 0         goto deactivate_getmrp;
3433     }
3434
3435 3     rc = globus_extension_activate(
3436             "globus_wsrp_QueryResourceProperties_provider");
3437 3     if (rc != GLOBUS_SUCCESS)
3438     {
3439 0         goto deactivate_setrp;
3440     }
3441
3442 3     rc = globus_extension_activate(
3443             "globus_wsrl_ImmediateResourceTermination_provider");
3444 3     if (rc != GLOBUS_SUCCESS)
3445     {
3446 0         goto deactivate_queryrp;
3447     }
3448
3449 3     rc = globus_extension_activate(
3450             "globus_wsrl_ScheduledResourceTermination_provider");
3451 3     if (rc != GLOBUS_SUCCESS)
3452     {
3453 0         goto deactivate_irt;
3454     }
3455
3456 3     if(GLOBUS_GLOBAL_TYPE_REGISTRY != NULL)
3457     {
3458 3         result = WidgetService_registry_add_types(
3459             GLOBUS_GLOBAL_TYPE_REGISTRY);
3460 3         if(result != GLOBUS_SUCCESS)
3461         {
3462 0             rc = (int) result;
3463 0             goto deactivate_srt;
3464         }
3465     }
3466
3467 3     rc = globus_hashtable_init(
3468         &WidgetService_descriptor.op_mapper, 
3469         10, 
3470         xsd_QName_hash, 
3471         xsd_QName_keyeq);
3472 3     if(rc != GLOBUS_SUCCESS)
3473     {
3474 0         goto clear_global_registry;
3475     }
3476
3477 3     result = globus_xsd_type_registry_init(
3478         &WidgetService_descriptor.registry);
3479 3     if(result != GLOBUS_SUCCESS)
3480     {
3481 0         rc = (int) result;
3482 0         goto destroy_op_mapper;
3483     }
3484
3485 3     result = WidgetService_registry_add_types(
3486         WidgetService_descriptor.registry);
3487 3     if(result != GLOBUS_SUCCESS)
3488     {
3489 0         rc = (int) result;
3490 0         goto destroy_service_registry;
3491     }
3492
3493 3     globus_mutex_init(&WidgetService_descriptor.mutex, NULL);
3494
3495 3     rc = globus_hashtable_insert(
3496         &WidgetService_descriptor.op_mapper,
3497         (void *)&WidgetPortType_SetTerminationTime_input_qname,
3498         (void *)&SetTerminationTime_operation_descriptor);
3499 3     if(rc != GLOBUS_SUCCESS)
3500     {
3501 0         goto remove_SetTerminationTime_op;
3502     }
3503
3504 3     rc = globus_hashtable_insert(
3505         &WidgetService_descriptor.op_mapper,
3506         (void *)&WidgetPortType_Destroy_input_qname,
3507         (void *)&Destroy_operation_descriptor);
3508 3     if(rc != GLOBUS_SUCCESS)
3509     {
3510 0         goto remove_Destroy_op;
3511     }
3512
3513 3     rc = globus_hashtable_insert(
3514         &WidgetService_descriptor.op_mapper,
3515         (void *)&WidgetPortType_QueryResourceProperties_input_qname,
3516         (void *)&QueryResourceProperties_operation_descriptor);
3517 3     if(rc != GLOBUS_SUCCESS)
3518     {
3519 0         goto remove_QueryResourceProperties_op;
3520     }
3521
3522 3     rc = globus_hashtable_insert(
3523         &WidgetService_descriptor.op_mapper,
3524         (void *)&WidgetPortType_SetResourceProperties_input_qname,
3525         (void *)&SetResourceProperties_operation_descriptor);
3526 3     if(rc != GLOBUS_SUCCESS)
3527     {
3528 0         goto remove_SetResourceProperties_op;
3529     }
3530
3531 3     rc = globus_hashtable_insert(
3532         &WidgetService_descriptor.op_mapper,
3533         (void *)&WidgetPortType_GetMultipleResourceProperties_input_qname,
3534         (void *)&GetMultipleResourceProperties_operation_descriptor);
3535 3     if(rc != GLOBUS_SUCCESS)
3536     {
3537 0         goto remove_GetMultipleResourceProperties_op;
3538     }
3539
3540 3     rc = globus_hashtable_insert(
3541         &WidgetService_descriptor.op_mapper,
3542         (void *)&WidgetPortType_GetResourceProperty_input_qname,
3543         (void *)&GetResourceProperty_operation_descriptor);
3544 3     if(rc != GLOBUS_SUCCESS)
3545     {
3546 0         goto remove_GetResourceProperty_op;
3547     }
3548
3549 3     rc = globus_hashtable_insert(
3550         &WidgetService_descriptor.op_mapper,
3551         (void *)&WidgetPortType_createWidget_input_qname,
3552         (void *)&createWidget_operation_descriptor);
3553 3     if(rc != GLOBUS_SUCCESS)
3554     {
3555 0         goto remove_createWidget_op;
3556     }
3557
3558
3559 3     result = globus_operation_table_init(
3560         &WidgetService_descriptor.operations,
3561         WidgetService_service_qname.Namespace);
3562 3     if(result != GLOBUS_SUCCESS)
3563     {
3564 0         rc = (int) result;
3565 0         goto remove_all_ops;
3566     }
3567
3568
3569 3     result = globus_extension_registry_add(
3570         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3571         (void *)&WidgetPortType_SetTerminationTime_op_qname,
3572         GlobusExtensionMyModule(WidgetService),
3573         (void *)&SetTerminationTime_descriptor);
3574 3     if(result != GLOBUS_SUCCESS)
3575     {
3576 0         rc = (int) result;
3577 0         goto remove_SetTerminationTime_op_provider;
3578     }
3579
3580 3     result = globus_operation_table_add_default_provider(
3581         WidgetService_descriptor.operations,
3582         &WidgetPortType_SetTerminationTime_op_qname,
3583         &SetTerminationTime_descriptor);
3584 3     if(result != GLOBUS_SUCCESS)
3585     {
3586 0         rc = (int) result;
3587 0         goto remove_SetTerminationTime_op_provider;
3588     }
3589
3590 3     result = globus_extension_registry_add(
3591         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3592         (void *)&WidgetPortType_Destroy_op_qname,
3593         GlobusExtensionMyModule(WidgetService),
3594         (void *)&Destroy_descriptor);
3595 3     if(result != GLOBUS_SUCCESS)
3596     {
3597 0         rc = (int) result;
3598 0         goto remove_Destroy_op_provider;
3599     }
3600
3601 3     result = globus_operation_table_add_default_provider(
3602         WidgetService_descriptor.operations,
3603         &WidgetPortType_Destroy_op_qname,
3604         &Destroy_descriptor);
3605 3     if(result != GLOBUS_SUCCESS)
3606     {
3607 0         rc = (int) result;
3608 0         goto remove_Destroy_op_provider;
3609     }
3610
3611 3     result = globus_extension_registry_add(
3612         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3613         (void *)&WidgetPortType_QueryResourceProperties_op_qname,
3614         GlobusExtensionMyModule(WidgetService),
3615         (void *)&QueryResourceProperties_descriptor);
3616 3     if(result != GLOBUS_SUCCESS)
3617     {
3618 0         rc = (int) result;
3619 0         goto remove_QueryResourceProperties_op_provider;
3620     }
3621
3622 3     result = globus_operation_table_add_default_provider(
3623         WidgetService_descriptor.operations,
3624         &WidgetPortType_QueryResourceProperties_op_qname,
3625         &QueryResourceProperties_descriptor);
3626 3     if(result != GLOBUS_SUCCESS)
3627     {
3628 0         rc = (int) result;
3629 0         goto remove_QueryResourceProperties_op_provider;
3630     }
3631
3632 3     result = globus_extension_registry_add(
3633         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3634         (void *)&WidgetPortType_SetResourceProperties_op_qname,
3635         GlobusExtensionMyModule(WidgetService),
3636         (void *)&SetResourceProperties_descriptor);
3637 3     if(result != GLOBUS_SUCCESS)
3638     {
3639 0         rc = (int) result;
3640 0         goto remove_SetResourceProperties_op_provider;
3641     }
3642
3643 3     result = globus_operation_table_add_default_provider(
3644         WidgetService_descriptor.operations,
3645         &WidgetPortType_SetResourceProperties_op_qname,
3646         &SetResourceProperties_descriptor);
3647 3     if(result != GLOBUS_SUCCESS)
3648     {
3649 0         rc = (int) result;
3650 0         goto remove_SetResourceProperties_op_provider;
3651     }
3652
3653 3     result = globus_extension_registry_add(
3654         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3655         (void *)&WidgetPortType_GetMultipleResourceProperties_op_qname,
3656         GlobusExtensionMyModule(WidgetService),
3657         (void *)&GetMultipleResourceProperties_descriptor);
3658 3     if(result != GLOBUS_SUCCESS)
3659     {
3660 0         rc = (int) result;
3661 0         goto remove_GetMultipleResourceProperties_op_provider;
3662     }
3663
3664 3     result = globus_operation_table_add_default_provider(
3665         WidgetService_descriptor.operations,
3666         &WidgetPortType_GetMultipleResourceProperties_op_qname,
3667         &GetMultipleResourceProperties_descriptor);
3668 3     if(result != GLOBUS_SUCCESS)
3669     {
3670 0         rc = (int) result;
3671 0         goto remove_GetMultipleResourceProperties_op_provider;
3672     }
3673
3674 3     result = globus_extension_registry_add(
3675         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3676         (void *)&WidgetPortType_GetResourceProperty_op_qname,
3677         GlobusExtensionMyModule(WidgetService),
3678         (void *)&GetResourceProperty_descriptor);
3679 3     if(result != GLOBUS_SUCCESS)
3680     {
3681 0         rc = (int) result;
3682 0         goto remove_GetResourceProperty_op_provider;
3683     }
3684
3685 3     result = globus_operation_table_add_default_provider(
3686         WidgetService_descriptor.operations,
3687         &WidgetPortType_GetResourceProperty_op_qname,
3688         &GetResourceProperty_descriptor);
3689 3     if(result != GLOBUS_SUCCESS)
3690     {
3691 0         rc = (int) result;
3692 0         goto remove_GetResourceProperty_op_provider;
3693     }
3694
3695 3     result = globus_extension_registry_add(
3696         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3697         (void *)&WidgetPortType_createWidget_op_qname,
3698         GlobusExtensionMyModule(WidgetService),
3699         (void *)&createWidget_descriptor);
3700 3     if(result != GLOBUS_SUCCESS)
3701     {
3702 0         rc = (int) result;
3703 0         goto remove_createWidget_op_provider;
3704     }
3705
3706 3     result = globus_operation_table_add_default_provider(
3707         WidgetService_descriptor.operations,
3708         &WidgetPortType_createWidget_op_qname,
3709         &createWidget_descriptor);
3710 3     if(result != GLOBUS_SUCCESS)
3711     {
3712 0         rc = (int) result;
3713 0         goto remove_createWidget_op_provider;
3714     }
3715
3716 3     result = globus_operation_table_add_provider(
3717         WidgetService_descriptor.operations,
3718         &wsrp_GetResourceProperty_qname);
3719 3     if (result != GLOBUS_SUCCESS)
3720     {
3721 0         rc = (int) result;
3722 0         goto remove_op_providers;
3723     }
3724
3725 3     result = globus_operation_table_add_provider(
3726         WidgetService_descriptor.operations,
3727         &wsrp_GetMultipleResourceProperties_qname);
3728 3     if (result != GLOBUS_SUCCESS)
3729     {
3730 0         rc = (int) result;
3731
3732 0         goto remove_op_providers;
3733     }
3734
3735 3     result = globus_operation_table_add_provider(
3736         WidgetService_descriptor.operations,
3737         &wsrp_SetResourceProperties_qname);
3738 3     if (result != GLOBUS_SUCCESS)
3739     {
3740 0         rc = (int) result;
3741
3742 0         goto remove_op_providers;
3743     }
3744
3745 3     result = globus_operation_table_add_provider(
3746         WidgetService_descriptor.operations,
3747         &wsrp_QueryResourceProperties_qname);
3748 3     if (result != GLOBUS_SUCCESS)
3749     {
3750 0         rc = (int) result;
3751
3752 0         goto remove_op_providers;
3753     }
3754
3755 3     result = globus_operation_table_add_provider(
3756         WidgetService_descriptor.operations,
3757         &wsrl_Destroy_qname);
3758 3     if (result != GLOBUS_SUCCESS)
3759     {
3760 0         rc = (int) result;
3761
3762 0         goto remove_op_providers;
3763     }
3764
3765 3     result = globus_operation_table_add_provider(
3766         WidgetService_descriptor.operations,
3767         &wsrl_SetTerminationTime_qname);
3768 3     if (result != GLOBUS_SUCCESS)
3769     {
3770 0         rc = (int) result;
3771
3772 0         goto remove_op_providers;
3773     }
3774
3775 3     rc = globus_extension_registry_add(
3776         GLOBUS_SERVICE_REGISTRY,
3777         (void *)WidgetService_descriptor.path,
3778         GlobusExtensionMyModule(WidgetService),
3779         &WidgetService_descriptor);
3780 3     if(rc != GLOBUS_SUCCESS)
3781     {
3782 0         goto remove_op_providers;
3783     }
3784
3785 3     result = WidgetService_init(&WidgetService_descriptor);
3786 3     if(result != GLOBUS_SUCCESS)
3787     {
3788 0         rc = (int) result;
3789         goto service_extension_remove;
3790     }
3791
3792 0     goto exit;
3793
3794 service_extension_remove:
3795 0     globus_extension_registry_remove(
3796         GLOBUS_SERVICE_REGISTRY,
3797         (void *)WidgetService_descriptor.path);
3798 remove_op_providers:
3799
3800 0     globus_extension_registry_remove(
3801         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3802         (void *)&WidgetPortType_SetTerminationTime_op_qname);
3803 remove_SetTerminationTime_op_provider:
3804
3805 0     globus_extension_registry_remove(
3806         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3807         (void *)&WidgetPortType_Destroy_op_qname);
3808 remove_Destroy_op_provider:
3809
3810 0     globus_extension_registry_remove(
3811         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3812         (void *)&WidgetPortType_QueryResourceProperties_op_qname);
3813 remove_QueryResourceProperties_op_provider:
3814
3815 0     globus_extension_registry_remove(
3816         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3817         (void *)&WidgetPortType_SetResourceProperties_op_qname);
3818 remove_SetResourceProperties_op_provider:
3819
3820 0     globus_extension_registry_remove(
3821         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3822         (void *)&WidgetPortType_GetMultipleResourceProperties_op_qname);
3823 remove_GetMultipleResourceProperties_op_provider:
3824
3825 0     globus_extension_registry_remove(
3826         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3827         (void *)&WidgetPortType_GetResourceProperty_op_qname);
3828 remove_GetResourceProperty_op_provider:
3829
3830 0     globus_extension_registry_remove(
3831         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3832         (void *)&WidgetPortType_createWidget_op_qname);
3833 remove_createWidget_op_provider:
3834
3835 destroy_op_table:
3836 0     globus_operation_table_destroy(WidgetService_descriptor.operations);
3837 remove_all_ops:
3838
3839 0     globus_hashtable_remove(
3840         &WidgetService_descriptor.op_mapper,
3841         (void *)&WidgetPortType_SetTerminationTime_input_qname);
3842 remove_SetTerminationTime_op:
3843
3844 0     globus_hashtable_remove(
3845         &WidgetService_descriptor.op_mapper,
3846         (void *)&WidgetPortType_Destroy_input_qname);
3847 remove_Destroy_op:
3848
3849 0     globus_hashtable_remove(
3850         &WidgetService_descriptor.op_mapper,
3851         (void *)&WidgetPortType_QueryResourceProperties_input_qname);
3852 remove_QueryResourceProperties_op:
3853
3854 0     globus_hashtable_remove(
3855         &WidgetService_descriptor.op_mapper,
3856         (void *)&WidgetPortType_SetResourceProperties_input_qname);
3857 remove_SetResourceProperties_op:
3858
3859 0     globus_hashtable_remove(
3860         &WidgetService_descriptor.op_mapper,
3861         (void *)&WidgetPortType_GetMultipleResourceProperties_input_qname);
3862 remove_GetMultipleResourceProperties_op:
3863
3864 0     globus_hashtable_remove(
3865         &WidgetService_descriptor.op_mapper,
3866         (void *)&WidgetPortType_GetResourceProperty_input_qname);
3867 remove_GetResourceProperty_op:
3868
3869 0     globus_hashtable_remove(
3870         &WidgetService_descriptor.op_mapper,
3871         (void *)&WidgetPortType_createWidget_input_qname);
3872 remove_createWidget_op:
3873
3874 destroy_mutex:
3875 0     globus_mutex_destroy(&WidgetService_descriptor.mutex);
3876 clear_service_registry:
3877 0     WidgetService_registry_remove_types(
3878         WidgetService_descriptor.registry);
3879 destroy_service_registry:
3880 0     globus_xsd_type_registry_destroy(WidgetService_descriptor.registry);
3881 destroy_op_mapper:
3882 0     globus_hashtable_destroy(&WidgetService_descriptor.op_mapper);
3883 clear_global_registry:
3884 0     if(GLOBUS_GLOBAL_TYPE_REGISTRY != NULL)
3885     {
3886 0         WidgetService_registry_remove_types(
3887             GLOBUS_GLOBAL_TYPE_REGISTRY);
3888     }
3889 deactivate_srt:
3890 0     globus_extension_deactivate(
3891             "globus_wsrl_ScheduledResourceTermination_provider");
3892 deactivate_irt:
3893 0     globus_extension_deactivate(
3894             "globus_wsrl_ImmediateResourceTermination_provider");
3895 deactivate_queryrp:
3896 0     globus_extension_deactivate(
3897             "globus_wsrl_QueryResourceProperties_provider");
3898 deactivate_setrp:
3899 0     globus_extension_deactivate("globus_wsrp_SetResourceProperties_provider");
3900 deactivate_getmrp:
3901 0     globus_extension_deactivate("globus_wsrp_GetMultipleResourceProperties_provider");
3902 deactivate_getrp:
3903 0     globus_extension_deactivate("globus_wsrp_GetResourceProperty_provider");
3904 deactivate_resource_out:
3905 0     globus_module_deactivate(GLOBUS_WSRF_RESOURCE_MODULE);
3906
3907  exit:
3908 3     WidgetServiceDebugExit();
3909 3     return rc;
3910 }
3911
3912 static
3913 int
3914 WidgetService_deactivate()
3915 0 {
3916 0     globus_result_t                     result = GLOBUS_SUCCESS;
3917 0     int                                 rc = 0;
3918
3919 0     result = WidgetService_finalize(&WidgetService_descriptor);
3920 0     if(result != GLOBUS_SUCCESS)
3921     {
3922 0         return GLOBUS_FAILURE;
3923     }
3924
3925 0     globus_extension_registry_remove(
3926         GLOBUS_SERVICE_REGISTRY,
3927         (void *)WidgetService_descriptor.path);
3928
3929 0     globus_extension_registry_remove(
3930         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3931         (void *)&WidgetPortType_SetTerminationTime_op_qname);
3932
3933 0     globus_extension_registry_remove(
3934         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3935         (void *)&WidgetPortType_Destroy_op_qname);
3936
3937 0     globus_extension_registry_remove(
3938         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3939         (void *)&WidgetPortType_QueryResourceProperties_op_qname);
3940
3941 0     globus_extension_registry_remove(
3942         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3943         (void *)&WidgetPortType_SetResourceProperties_op_qname);
3944
3945 0     globus_extension_registry_remove(
3946         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3947         (void *)&WidgetPortType_GetMultipleResourceProperties_op_qname);
3948
3949 0     globus_extension_registry_remove(
3950         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3951         (void *)&WidgetPortType_GetResourceProperty_op_qname);
3952
3953 0     globus_extension_registry_remove(
3954         GLOBUS_OPERATION_PROVIDER_REGISTRY,
3955         (void *)&WidgetPortType_createWidget_op_qname);
3956
3957 0     globus_operation_table_destroy(WidgetService_descriptor.operations);
3958
3959
3960 0     globus_hashtable_remove(
3961         &WidgetService_descriptor.op_mapper,
3962         (void *)&WidgetPortType_SetTerminationTime_input_qname);
3963
3964 0     globus_hashtable_remove(
3965         &WidgetService_descriptor.op_mapper,
3966         (void *)&WidgetPortType_Destroy_input_qname);
3967
3968 0     globus_hashtable_remove(
3969         &WidgetService_descriptor.op_mapper,
3970         (void *)&WidgetPortType_QueryResourceProperties_input_qname);
3971
3972 0     globus_hashtable_remove(
3973         &WidgetService_descriptor.op_mapper,
3974         (void *)&WidgetPortType_SetResourceProperties_input_qname);
3975
3976 0     globus_hashtable_remove(
3977         &WidgetService_descriptor.op_mapper,
3978         (void *)&WidgetPortType_GetMultipleResourceProperties_input_qname);
3979
3980 0     globus_hashtable_remove(
3981         &WidgetService_descriptor.op_mapper,
3982         (void *)&WidgetPortType_GetResourceProperty_input_qname);
3983
3984 0     globus_hashtable_remove(
3985         &WidgetService_descriptor.op_mapper,
3986         (void *)&WidgetPortType_createWidget_input_qname);
3987
3988
3989 0     globus_mutex_destroy(&WidgetService_descriptor.mutex);
3990
3991 0     WidgetService_registry_remove_types(
3992         WidgetService_descriptor.registry);
3993
3994 0     globus_xsd_type_registry_destroy(WidgetService_descriptor.registry);
3995
3996 0     globus_hashtable_destroy(&WidgetService_descriptor.op_mapper);
3997
3998 0     if(GLOBUS_GLOBAL_TYPE_REGISTRY != NULL)
3999     {
4000 0         WidgetService_registry_remove_types(
4001             GLOBUS_GLOBAL_TYPE_REGISTRY);
4002     }
4003
4004 0     globus_extension_deactivate(
4005             "globus_wsrl_ScheduledResourceTermination_provider");
4006 0     globus_extension_deactivate(
4007             "globus_wsrl_ImmediateResourceTermination_provider");
4008 0     globus_extension_deactivate(
4009             "globus_wsrl_QueryResourceProperties_provider");
4010 0     globus_extension_deactivate("globus_wsrp_SetResourceProperties_provider");
4011 0     globus_extension_deactivate(
4012         "globus_wsrp_GetMultipleResourceProperties_provider");
4013 0     globus_extension_deactivate("globus_wsrp_GetResourceProperty_provider");
4014 0     globus_module_deactivate(GLOBUS_WSRF_RESOURCE_MODULE);
4015
4016 0     rc = globus_module_deactivate(WIDGETSERVICE_MODULE);
4017 0     if(rc != GLOBUS_SUCCESS)
4018     {
4019 0         return rc;
4020     }
4021
4022 0     return rc;
4023 }
4024
4025 #define WSRP_NS "http://www.globus.org/docs.oasis-open.org" \
4026                 "/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
4027
4028 static xsd_QName wsrp_GetResourceProperty_qname =
4029 {
4030     WSRP_NS,
4031     "GetResourceProperty"
4032 };
4033
4034 static xsd_QName wsrp_GetMultipleResourceProperties_qname =
4035 {
4036     WSRP_NS,
4037     "GetMultipleResourceProperties"
4038 };
4039
4040 static xsd_QName wsrp_SetResourceProperties_qname =
4041 {
4042     WSRP_NS,
4043     "SetResourceProperties"
4044 };
4045
4046 static xsd_QName wsrp_QueryResourceProperties_qname =
4047 {
4048     WSRP_NS,
4049     "QueryResourceProperties"
4050 };
4051
4052 static xsd_QName wsrl_Destroy_qname =
4053 {
4054     "http://www.globus.org/docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl",
4055     "Destroy"
4056 };
4057
4058 static xsd_QName wsrl_SetTerminationTime_qname =
4059 {
4060     "http://www.globus.org/docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl",
4061     "SetTerminationTime"