public void LinkDeviceToUser(string userId, string deviceId) { try { if (userId == null || userId.Length == 0 || deviceId.Length == 0) { throw new WebFaultException <string>("LinkDeviceToUser missing parameter.", HttpStatusCode.BadRequest); } DeviceDAO.AddDeviceOwner(int.Parse(deviceId), userId); } catch (WebFaultException) { throw; } catch (Exception ex) { throw new WebFaultException <string>(ex.Message, HttpStatusCode.InternalServerError); } }