private bool GetVehicleTypes(string url, string username, string password, ref StringBuilder result) { result.AppendLine("Calling GetVehicleTypes for url :" + url + "IStaticData"); var staticService = new StaticDataservice { Url = url + "IStaticData" }; try { var company = staticService.GetProviders(username, password); int c = 0; foreach (var providerItem in company) { c += staticService.GetVehicleTypes(username, password, providerItem.ProviderNum).Count(); } result.AppendLine("Call sucessfull, found " + c + " vehicle types"); return(c > 0); } catch (Exception ex) { result.AppendLine("Error calling get vehcile types : " + ex.Message); result.AppendLine("Error details : " + ex.StackTrace); } return(false); }
private static void CallGetVehicleTypes(string baseUrl) { Console.WriteLine("Calling CallGetVehicleTypes web service " + baseUrl); var staticService = new StaticDataservice { Url = baseUrl + "IStaticData" }; try { var company = staticService.GetProviders("taxi", "test"); foreach (var co in company) { var vehicles = staticService.GetVehicleTypes("taxi", "test", Convert.ToInt32(co.ProviderNum)); foreach (var v in vehicles) { Console.WriteLine(v.Name); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } }