Exemple #1
0
        private void btnGetAllServices_Click(object sender, EventArgs e)
        {
            try
            {
                ServiceConfigurationCollection res = selectedWrapper.GetAllServices();

                if (rndJSON.Checked)
                {
                    txtResult.Text = Fwk.HelperFunctions.SerializationFunctions.SerializeObjectToJson <ServiceConfigurationCollection>(res);
                }
                else
                {
                    txtResult.Text = res.GetXml();
                }
            }
            catch (Exception ex)
            {
                txtResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
            }
        }
Exemple #2
0
        private void btn_GetAllServicesCustomBinding_Click(object sender, EventArgs e)
        {
            //      try
            //    {
            //        DispatcherClientChecker.ServiceReference1.FwkServiceClient proxy = new ServiceReference1.FwkServiceClient();
            //        proxy.Open();
            //        var  res = proxy.GetServicesList("health",true);
            //        txtResult.Text = res;
            //    }
            //      catch (Exception ex)
            //      {
            //          txtResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
            //      }

            //return;
            try
            {
                WCFWrapper_WsHttpBinding wrap = new WCFWrapper_WsHttpBinding();

                wrap.SourceInfo = "http://moviedo-001-site2.itempurl.com/service.svc";

                // wrap.SourceInfo = " https://ws2008:443/health/service.svc";
                //wrap.SourceInfo = "http://localhost:8732/health/Service.svc";

                ServiceConfigurationCollection res = wrap.GetAllServices();

                if (rndJSON.Checked)
                {
                    txtResult.Text = Fwk.HelperFunctions.SerializationFunctions.SerializeObjectToJson <ServiceConfigurationCollection>(res);
                }
                else
                {
                    txtResult.Text = res.GetXml();
                }
            }
            catch (Exception ex)
            {
                txtResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
            }
        }
Exemple #3
0
        /// <summary>
        /// lista los servicios configurados
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="pViewXML">Permite ver como xml todos los servicios y sus datos.
        /// Si se espesifuca false solo se vera una simple lista</param>
        /// <returns></returns>
        public static String GetServicesList(String providerName, Boolean pViewXML)
        {
            ServiceConfigurationCollection wServiceConfigurationCollection = FacadeHelper.GetAllServices(providerName);

            if (wServiceConfigurationCollection != null)
            {
                if (pViewXML)
                {
                    return(wServiceConfigurationCollection.GetXml());
                }
                else
                {
                    StringBuilder strList = new StringBuilder();
                    foreach (ServiceConfiguration serviceConfiguration in wServiceConfigurationCollection)
                    {
                        strList.AppendLine(serviceConfiguration.Name);
                    }
                    return(strList.ToString());
                }
            }
            return(string.Empty);
        }