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