public static int GetIdByNameWebServiceMethod(string name) { using (FixedAssetsWebService.SubgroupServiceClient Client = new FixedAssetsWebService.SubgroupServiceClient()) { Client.Open(); Subgroup subgroup = Client.GetSubgroupByName(name); if (subgroup != null) { return subgroup.id; } else { return 0; } } }