public WordResp WordLookup(WordReq req) { var translator = new TranslatorService.LanguageServiceClient(); string txt = translator.Translate("C1E6D88CE2967328BBA9BC6C932B9D177247CAE5", req.Word, "en", "pt", null, null); if (!string.IsNullOrEmpty(txt)) { var dictionary = new DictService.DictServiceSoapClient("DictServiceSoap"); var definition = dictionary.Define(txt); if (definition != null && definition.Definitions.Count() > 0) { return new WordResp() { Exists = true, Description = definition.Definitions[0].WordDefinition }; } } return new WordResp() { Exists = false }; }
static void GetDefinitionOfProfessor() { var client = new DictService.DictServiceSoapClient("DictServiceSoap"); DictService.WordDefinition def = client.Define("professor"); Console.WriteLine((def.Definitions.Count() > 0) ? def.Definitions[0].WordDefinition : "not found"); }