public authToken get_authToken([System.Xml.Serialization.XmlElementAttribute("get_authToken", Namespace = "urn:uddi-org:api_v3")] get_authToken get_authToken1)
        {
            object[] results = this.Invoke("get_authToken", new object[] {
                get_authToken1
            });

            return((authToken)(results[0]));
        }
 /// <remarks/>
 public void get_authTokenAsync(get_authToken get_authToken1, object userState)
 {
     if ((this.get_authTokenOperationCompleted == null))
     {
         this.get_authTokenOperationCompleted = new System.Threading.SendOrPostCallback(this.Onget_authTokenOperationCompleted);
     }
     this.InvokeAsync("get_authToken", new object[] {
         get_authToken1
     }, this.get_authTokenOperationCompleted, userState);
 }
        private void addEstacion_Click(object sender, EventArgs e)
        {
            String nom = nombre.Text.ToString();

            String conexion       = juddip.Text.ToString();
            String puertoEstacion = this.puerto.Text.ToString();
            string hostname       = Dns.GetHostName();
            String ip             = this.ip.Text.ToString();

            urlEstacion = "http://localhost:" + puertoEstacion + "/EstacionMaster/services/Estacion?wsdl";
            if (nom != "" && conexion != "" && puertoEstacion != "" && ip != "")
            {
                Boolean errorVar = false;
                ip += ":" + puertoEstacion;
                try {
                    //String conexionURL = "http://" + conexion + "/EstacionMaster/services/Estacion?wsdl";
                    JUDDISecurity.UDDISecurityService securityService = new JUDDISecurity.UDDISecurityService();
                    securityService.Url = "http://" + conexion + "/juddiv3/services/security";
                    JUDDISecurity.get_authToken token = new JUDDISecurity.get_authToken();
                    token.cred   = "root";
                    token.userID = "root";

                    JUDDIPublish.UDDIPublicationService publishService = new JUDDIPublish.UDDIPublicationService();
                    publishService.Url = "http://" + conexion + "/juddiv3/services/publish";
                    JUDDIPublish.businessEntity estacion  = new JUDDIPublish.businessEntity();
                    JUDDIPublish.save_business  save_buss = new JUDDIPublish.save_business();

                    //Descripcion de la estacion. Guardamos el nombre de la estacion y su ip
                    estacion.name           = new JUDDIPublish.name[] { new JUDDIPublish.name() };
                    estacion.name[0].Value  = nom;
                    estacion.description    = new JUDDIPublish.description[2];
                    estacion.description[0] = new JUDDIPublish.description();
                    estacion.description[1] = new JUDDIPublish.description();
                    //Ip y puerto
                    estacion.description[0].Value = ip;


                    JUDDIPublish.businessEntity[] businessEntities = new JUDDIPublish.businessEntity[1];
                    businessEntities[0] = estacion;

                    save_buss.businessEntity = businessEntities;
                    string auth_token = securityService.get_authToken(token).authInfo;
                    save_buss.authInfo = auth_token;
                    publishService.save_business(save_buss);
                    error("Estacion loggeada correctamente!");
                }
                catch (Exception exc)
                {
                    error("Registro JUDDI no existe o se encuentra inhabilitado!");
                }
            }
        }
 /// <remarks/>
 public void get_authTokenAsync(get_authToken get_authToken1)
 {
     this.get_authTokenAsync(get_authToken1, null);
 }
Exemple #5
0
        private void cargarEstaciones()
        {
            try
            {
                conexion = conex.Text.ToString();
                JUDDISecurity.UDDISecurityService securityService = new JUDDISecurity.UDDISecurityService();
                securityService.Url = "http://" + conexion + "/juddiv3/services/security";
                JUDDISecurity.get_authToken token = new JUDDISecurity.get_authToken();
                token.cred   = "root";
                token.userID = "root";


                JUDDInquiry.UDDIInquiryService inquiryService = new JUDDInquiry.UDDIInquiryService();
                inquiryService.Timeout = 2000;
                inquiryService.Url     = "http://" + conexion + "/juddiv3/services/inquiry";
                JUDDInquiry.find_business bussines = new JUDDInquiry.find_business();
                bussines.findQualifiers = new string[] { "approximateMatch" };
                bussines.name           = new JUDDInquiry.name[] { new JUDDInquiry.name() };
                bussines.name[0].Value  = "estacion%";
                JUDDInquiry.businessList estacionesBuss = new JUDDInquiry.businessList();

                JUDDIPublish.UDDIPublicationService publishService = new JUDDIPublish.UDDIPublicationService();
                publishService.Url = "http://" + conexion + "/juddiv3/services/publish";
                int numEstaciones = 0;

                estacionesBuss = inquiryService.find_business(bussines);
                numEstaciones  = estacionesBuss.businessInfos.Length;
                if (numEstaciones == 0)
                {
                    error("No se han encontrado estaciones!");
                }
                string auth_token = securityService.get_authToken(token).authInfo;
                for (int i = 0; i < numEstaciones; ++i)
                {
                    JUDDInquiry.businessInfo info = estacionesBuss.businessInfos[i];
                    String estacionNombre         = info.name[0].Value.ToString();
                    String estacionIP             = info.description[0].Value.ToString();
                    if (!ips.ContainsKey(estacionIP))
                    {
                        try
                        {
                            String            urlEstacion   = "http://" + estacionIP + "/EstacionMaster/services/Estacion?wsdl";
                            Estacion.Estacion estacionNueva = new Estacion.Estacion();
                            estacionNueva.Url = urlEstacion;
                            estacionNueva.getHumedad();
                            String estacionText = estacionNombre + "=>" + estacionIP;
                            stationList.Items.Add(estacionText);
                            stations.Items.Add(estacionText);
                            ips[estacionIP]          = estacionNombre;
                            estaciones[estacionText] = estacionNueva;
                        }
                        catch (Exception exc)
                        {
                            try
                            {
                                JUDDIPublish.delete_business delete_bussines = new JUDDIPublish.delete_business();
                                String[] keys = new string[1];
                                keys[0] = info.businessKey;
                                delete_bussines.businessKey = keys;
                                delete_bussines.authInfo    = auth_token;
                                publishService.delete_business(delete_bussines);
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                error("Servidor JUDDI no existe o se encuentra inhabilitado");
            }
        }