예제 #1
0
        /// <summary>
        /// Recupera la configuración de un servicio de negocio.
        /// </summary>
        /// <param name="pServiceName">Nombre del servicio.</param>
        /// <returns>configuración del servicio de negocio.</returns>
        /// <date>2008-04-07T00:00:00</date>
        /// <author>moviedo</author>
        public Fwk.Bases.ServiceConfiguration GetServiceConfiguration(String pServiceName)
        {
            InitilaizeBinding();
            GetServiceConfigurationRequest  wcfReq = new GetServiceConfigurationRequest();
            GetServiceConfigurationResponse wcfRes = null;

            wcfReq.providerName = _ServiceMetadataProviderName;
            wcfReq.serviceName  = pServiceName;

            var         channelFactory = new ChannelFactory <IFwkService>(binding, address);
            IFwkService client         = null;

            try
            {
                client = channelFactory.CreateChannel();
                wcfRes = client.GetServiceConfiguration(wcfReq);
                ((ICommunicationObject)client).Close();
            }
            catch (Exception ex)
            {
                if (client != null)
                {
                    ((ICommunicationObject)client).Abort();
                }
                throw ex;
            }

            Fwk.Bases.ServiceConfiguration wServiceConfiguration = (Fwk.Bases.ServiceConfiguration)
                                                                   Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(Fwk.Bases.ServiceConfiguration), wcfRes.GetServiceConfigurationResult);

            return(wServiceConfiguration);
        }
예제 #2
0
        public static GetServiceConfigurationResponse Unmarshall(UnmarshallerContext _ctx)
        {
            GetServiceConfigurationResponse getServiceConfigurationResponse = new GetServiceConfigurationResponse();

            getServiceConfigurationResponse.HttpResponse = _ctx.HttpResponse;
            getServiceConfigurationResponse.Code         = _ctx.StringValue("GetServiceConfiguration.Code");
            getServiceConfigurationResponse.Message      = _ctx.StringValue("GetServiceConfiguration.Message");
            getServiceConfigurationResponse.RequestId    = _ctx.StringValue("GetServiceConfiguration.RequestId");

            GetServiceConfigurationResponse.GetServiceConfiguration_Data data = new GetServiceConfigurationResponse.GetServiceConfiguration_Data();
            data.ClientQueueSize                 = _ctx.IntegerValue("GetServiceConfiguration.Data.ClientQueueSize");
            data.LiveRecordAll                   = _ctx.BooleanValue("GetServiceConfiguration.Data.LiveRecordAll");
            data.LiveRecordEveryOne              = _ctx.BooleanValue("GetServiceConfiguration.Data.LiveRecordEveryOne");
            data.LiveRecordLayout                = _ctx.IntegerValue("GetServiceConfiguration.Data.LiveRecordLayout");
            data.LiveRecordTaskProfile           = _ctx.StringValue("GetServiceConfiguration.Data.LiveRecordTaskProfile");
            data.TaskItemQueueSize               = _ctx.IntegerValue("GetServiceConfiguration.Data.TaskItemQueueSize");
            data.LiveRecordMaxClient             = _ctx.IntegerValue("GetServiceConfiguration.Data.LiveRecordMaxClient");
            data.LiveRecordVideoResolution       = _ctx.IntegerValue("GetServiceConfiguration.Data.LiveRecordVideoResolution");
            getServiceConfigurationResponse.Data = data;

            return(getServiceConfigurationResponse);
        }