/*
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */


#ifndef _WIDGETSERVICE_SKELETON_H_
#define _WIDGETSERVICE_SKELETON_H_

#include "globus_common.h"

EXTERN_C_BEGIN

#include "globus_service_registry.h"
#include "globus_soap_message.h"
#include "globus_operation_provider.h"
#include "WidgetService.h"

extern xsd_QName WidgetService_service_qname;

globus_result_t
WidgetService_init(
    globus_service_descriptor_t *       service_desc);

globus_result_t
WidgetService_finalize(
    globus_service_descriptor_t *       service_desc);

extern globus_service_descriptor_t      WidgetService_descriptor;

/**
 * globus_result_t WidgetServiceResourceInit(const char * resource_id);
 */
#define WidgetServiceInitResource(RESOURCE_ID)        \
    globus_operation_table_init_resource(       \
        WidgetService_descriptor.operations,          \
        RESOURCE_ID)
        
/* Error Types for WidgetService */
enum
{

    WIDGETPORTTYPE_SETTERMINATIONTIME_ERROR_TYPE,
    WIDGETPORTTYPE_DESTROY_ERROR_TYPE,
    WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_ERROR_TYPE,
    WIDGETPORTTYPE_SETRESOURCEPROPERTIES_ERROR_TYPE,
    WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_ERROR_TYPE,
    WIDGETPORTTYPE_GETRESOURCEPROPERTY_ERROR_TYPE,
    WIDGETPORTTYPE_CREATEWIDGET_ERROR_TYPE
};


extern xsd_QName WidgetPortType_SetTerminationTime_op_qname;
extern xsd_QName WidgetPortType_SetTerminationTime_input_qname;

#define WidgetPortType_SetTerminationTime_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_SETTERMINATIONTIME_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "SetTerminationTime Error: %s", message))

#define WidgetPortType_SetTerminationTime_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_SETTERMINATIONTIME_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "SetTerminationTime Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_SetTerminationTime_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    wsrl_SetTerminationTimeType * SetTerminationTime);

globus_result_t
WidgetPortType_SetTerminationTime_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    wsrl_SetTerminationTimeType * SetTerminationTime,
    wsrl_SetTerminationTimeResponseType * SetTerminationTimeResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_SetTerminationTime_fault_strings[];

#define WidgetPortType_SetTerminationTimeFaultString(FAULT_TYPE) \
    WidgetPortType_SetTerminationTime_fault_strings[FAULT_TYPE - 1]


extern xsd_QName WidgetPortType_Destroy_op_qname;
extern xsd_QName WidgetPortType_Destroy_input_qname;

#define WidgetPortType_Destroy_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_DESTROY_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "Destroy Error: %s", message))

#define WidgetPortType_Destroy_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_DESTROY_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "Destroy Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_Destroy_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    wsrl_DestroyType * Destroy);

globus_result_t
WidgetPortType_Destroy_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    wsrl_DestroyType * Destroy,
    wsrl_DestroyResponseType * DestroyResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_Destroy_fault_strings[];

#define WidgetPortType_DestroyFaultString(FAULT_TYPE) \
    WidgetPortType_Destroy_fault_strings[FAULT_TYPE - 1]


extern xsd_QName WidgetPortType_QueryResourceProperties_op_qname;
extern xsd_QName WidgetPortType_QueryResourceProperties_input_qname;

#define WidgetPortType_QueryResourceProperties_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "QueryResourceProperties Error: %s", message))

#define WidgetPortType_QueryResourceProperties_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_QUERYRESOURCEPROPERTIES_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "QueryResourceProperties Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_QueryResourceProperties_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    wsrp_QueryResourcePropertiesType * QueryResourceProperties);

globus_result_t
WidgetPortType_QueryResourceProperties_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    wsrp_QueryResourcePropertiesType * QueryResourceProperties,
    wsrp_QueryResourcePropertiesResponseType * QueryResourcePropertiesResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_QueryResourceProperties_fault_strings[];

#define WidgetPortType_QueryResourcePropertiesFaultString(FAULT_TYPE) \
    WidgetPortType_QueryResourceProperties_fault_strings[FAULT_TYPE - 1]


extern xsd_QName WidgetPortType_SetResourceProperties_op_qname;
extern xsd_QName WidgetPortType_SetResourceProperties_input_qname;

#define WidgetPortType_SetResourceProperties_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_SETRESOURCEPROPERTIES_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "SetResourceProperties Error: %s", message))

#define WidgetPortType_SetResourceProperties_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_SETRESOURCEPROPERTIES_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "SetResourceProperties Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_SetResourceProperties_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    wsrp_SetResourcePropertiesType * SetResourceProperties);

globus_result_t
WidgetPortType_SetResourceProperties_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    wsrp_SetResourcePropertiesType * SetResourceProperties,
    wsrp_SetResourcePropertiesResponseType * SetResourcePropertiesResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_SetResourceProperties_fault_strings[];

#define WidgetPortType_SetResourcePropertiesFaultString(FAULT_TYPE) \
    WidgetPortType_SetResourceProperties_fault_strings[FAULT_TYPE - 1]


extern xsd_QName WidgetPortType_GetMultipleResourceProperties_op_qname;
extern xsd_QName WidgetPortType_GetMultipleResourceProperties_input_qname;

#define WidgetPortType_GetMultipleResourceProperties_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "GetMultipleResourceProperties Error: %s", message))

#define WidgetPortType_GetMultipleResourceProperties_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_GETMULTIPLERESOURCEPROPERTIES_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "GetMultipleResourceProperties Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_GetMultipleResourceProperties_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties);

globus_result_t
WidgetPortType_GetMultipleResourceProperties_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties,
    wsrp_GetMultipleResourcePropertiesResponseType * GetMultipleResourcePropertiesResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_GetMultipleResourceProperties_fault_strings[];

#define WidgetPortType_GetMultipleResourcePropertiesFaultString(FAULT_TYPE) \
    WidgetPortType_GetMultipleResourceProperties_fault_strings[FAULT_TYPE - 1]


extern xsd_QName WidgetPortType_GetResourceProperty_op_qname;
extern xsd_QName WidgetPortType_GetResourceProperty_input_qname;

#define WidgetPortType_GetResourceProperty_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_GETRESOURCEPROPERTY_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "GetResourceProperty Error: %s", message))

#define WidgetPortType_GetResourceProperty_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_GETRESOURCEPROPERTY_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "GetResourceProperty Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_GetResourceProperty_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    xsd_QName * GetResourceProperty);

globus_result_t
WidgetPortType_GetResourceProperty_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    xsd_QName * GetResourceProperty,
    wsrp_GetResourcePropertyResponseType * GetResourcePropertyResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_GetResourceProperty_fault_strings[];

#define WidgetPortType_GetResourcePropertyFaultString(FAULT_TYPE) \
    WidgetPortType_GetResourceProperty_fault_strings[FAULT_TYPE - 1]


extern xsd_QName WidgetPortType_createWidget_op_qname;
extern xsd_QName WidgetPortType_createWidget_input_qname;

#define WidgetPortType_createWidget_error(message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            NULL, \
            WIDGETPORTTYPE_CREATEWIDGET_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "createWidget Error: %s", message))

#define WidgetPortType_createWidget_chain_error(result, message) \
    globus_error_put( \
        globus_error_construct_error( \
            &WidgetService_module, \
            result ? globus_error_get(result) : NULL, \
            WIDGETPORTTYPE_CREATEWIDGET_ERROR_TYPE, \
            __FILE__, \
            _globus_func_name, \
            __LINE__, \
            "createWidget Error: %s", \
            (message ? message : "Nonterminal Error")))
                    
/* these functions are the service implementation and
 * must be implemented by the service implementer
 */

globus_result_t
WidgetPortType_createWidget_init(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    createWidgetType * createWidget);

globus_result_t
WidgetPortType_createWidget_impl(
    globus_service_engine_t             engine,
    globus_soap_message_handle_t        message,
    globus_service_descriptor_t *       descriptor,
    createWidgetType * createWidget,
    createWidgetResponseType * createWidgetResponse,
    const char **                       fault_name,
    void ** fault);


extern const char * WidgetPortType_createWidget_fault_strings[];

#define WidgetPortType_createWidgetFaultString(FAULT_TYPE) \
    WidgetPortType_createWidget_fault_strings[FAULT_TYPE - 1]


EXTERN_C_END

#endif
