예제 #1
0
        private string GetChemStructure(LiteEntity le)
        {
            using (new WaitCursor())
            {
                var securityProtocol = ServicePointManager.SecurityProtocol;
                ServicePointManager.SecurityProtocol = securityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

                ChebiWebServiceService    ws = new ChebiWebServiceService();
                getCompleteEntityResponse results;

                ws.Url       = UserOptions.ChEBIWebServiceUri;
                ws.UserAgent = "Chem4Word";

                getCompleteEntity gce = new getCompleteEntity();
                gce.chebiId = le.chebiId;

                results = ws.getCompleteEntity(gce);

                _allResults = results.@return;

                var chemStructure = _allResults?.ChemicalStructures?[0]?.structure;

                ServicePointManager.SecurityProtocol = securityProtocol;
                return(chemStructure);
            }
        }
예제 #2
0
        private string GetChemStructure(LiteEntity le)
        {
            using (new WaitCursor())
            {
                ChebiWebServiceService    ws = new ChebiWebServiceService();
                getCompleteEntityResponse results;

                ws.Url       = UserOptions.ChEBIWebServiceUri;
                ws.UserAgent = "Chem4Word";

                getCompleteEntity gce = new getCompleteEntity();
                gce.chebiId = le.chebiId;

                results = ws.getCompleteEntity(gce);

                _allResults = results.@return;

                var chemStructure = _allResults?.ChemicalStructures?[0]?.structure;
                return(chemStructure);
            }
        }