Esempio n. 1
0
        public XElement SendQueryWS(QueryWSSiesa query)
        {
            try
            {
                DataSet data = new DataSet();
                string  xml  = "<Consulta>";
                xml += $"<NombreConexion>{query.ConectionName}</NombreConexion>";
                xml += $"<IdCia>{query.Cia}</IdCia>";
                xml += $"<IdProveedor>{query.Provider}</IdProveedor>";
                xml += $"<IdConsulta>{query.NameQuery}</IdConsulta>";
                xml += $"<Usuario>{query.User}</Usuario>";
                xml += $"<Clave>{query.Pass}</Clave>";
                xml += "<Parametros>";
                for (int i = 0; i < query.Filters.Count; i++)
                {
                    string[] filters = query.Filters[i].Split(":");
                    xml += $"<{filters[0]}>{filters[1]}</{filters[0]}>";
                }
                xml += "</Parametros>";
                xml += "</Consulta>";

                wsSIESA.WSUNOEESoap ws = new wsSIESA.WSUNOEESoapClient(wsSIESA.WSUNOEESoapClient.EndpointConfiguration.WSUNOEESoap);
                var result             = ws.EjecutarConsultaXMLAsync(xml).Result;
                return(result.Nodes[1]);
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }
Esempio n. 2
0
        public string SendInformationWS(string xml, string cia)
        {
            try
            {
                string xmlSend;
                wsSIESA.WSUNOEESoap ws = new wsSIESA.WSUNOEESoapClient(wsSIESA.WSUNOEESoapClient.EndpointConfiguration.WSUNOEESoap);

                wsSIESA.ImportarXMLRequest request = new wsSIESA.ImportarXMLRequest();


                xmlSend  = "<Importar>";
                xmlSend += "<NombreConexion>UnoEE</NombreConexion>";
                xmlSend += $"<IdCia>{cia}</IdCia>";
                xmlSend += "<Usuario>easy.sales</Usuario>";
                xmlSend += "<Clave>34s12020</Clave>";
                xmlSend += "<Datos>";
                xmlSend += xml;
                xmlSend += "</Datos>";
                xmlSend += "</Importar>";

                request.printTipoError = 0;
                request.pvstrDatos     = xmlSend;


                var result = ws.ImportarXMLAsync(request).Result;

                if (result.printTipoError == 0)
                {
                    return("Importacion Exitosa");
                }
                else
                {
                    return(result.ImportarXMLResult.Nodes[1].ToString());
                }
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }