public GeoCoordinate GetLatestGeoCoordinateByDevice(string userName, string password, Device device) { GeoCoordinate geoCoor = null; try { ZiZhuJYLocationService.LocationServiceClient client = new LocationServiceClient(); client.ClientCredentials.UserName.UserName = userName; client.ClientCredentials.UserName.Password = password; geoCoor = client.GetLatestGeoCoordinateByDevice(device); client.Close(); } catch (Exception ex) { throw new FaultException(ex.GetDebugString()); } return(geoCoor); }