locked
"Microsoft.Health.HealthServiceStatusCode.AccessDenied" problem while trying to put data (add data/ upload data) to HealthVault platrorm RRS feed

  • Question

  • Hi

    I am trying to integrate my desktop application with HealthVault platform. I have successfully connected with the platform.

    I have checked the SODA App rules like BloodPressure, Weight & height measurement and Blood glucose etc. in the Application Configuration Center. But when I try to add some height or weight measurements data. It throws the following error.

    "Microsoft.Health.HealthServiceStatusCode.AccessDenied"

    with the following details 

       at Microsoft.Health.EasyWebRequest.WaitForCompletion() in e:\src\hsmain\private\prod\src\sdk\core\EasyWebRequest.cs:line 750
       at Microsoft.Health.EasyWebRequest.Fetch(Uri url) in e:\src\hsmain\private\prod\src\sdk\core\EasyWebRequest.cs:line 204
       at Microsoft.Health.EasyWebRequest.Fetch(Uri url, IEasyWebResponseHandler customHandler) in e:\src\hsmain\private\prod\src\sdk\core\EasyWebRequest.cs:line 245
       at Microsoft.Health.HealthServiceRequest.ExecuteInternal() in e:\src\hsmain\private\prod\src\sdk\core\HealthServiceRequest.cs:line 140
       at Microsoft.Health.Web.OfflineWebApplicationConnection.ExecuteRequestWithRetry(HealthServiceRequest request) in e:\src\hsmain\private\prod\src\sdk\core\OfflineWebApplicationConnection.cs:line 424
       at Microsoft.Health.HealthServiceRequest.Execute() in e:\src\hsmain\private\prod\src\sdk\core\HealthServiceRequest.cs:line 125
       at Microsoft.Health.HealthRecordAccessor.NewItems(IList`1 items) in e:\src\hsmain\private\prod\src\sdk\core\HealthRecordAccessor.cs:line 640
       at Microsoft.Health.HealthRecordAccessor.NewItem(HealthRecordItem item) in e:\src\hsmain\private\prod\src\sdk\core\HealthRecordAccessor.cs:line 577
       at TestHealthVaultClientApp.HVClient.SetHVRecords(HealthRecordItem pHealthRecordItem, PersonInfo pPersonInfo) in E:\Test Projects\HealthVault\TestHealthVaultClientApp\TestHealthVaultClientApp\HVClient.cs:line 133
       at TestHealthVaultClientApp.Window1.AddHVRecord_Click(Object sender, RoutedEventArgs e) in E:\Test Projects\HealthVault\TestHealthVaultClientApp\TestHealthVaultClientApp\Window1.xaml.cs:line 59
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at TestHealthVaultClientApp.App.Main() in E:\Test Projects\HealthVault\TestHealthVaultClientApp\TestHealthVaultClientApp\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    My sample code
    ============================

     

     

     

    void SetHVRecords(HealthRecordItem pHealthRecordItem, PersonInfo pPersonInfo)

    {

    HealthClientAuthorizedConnection connection =

    _clientApp.CreateAuthorizedConnection(pPersonInfo.PersonId);

    HealthRecordAccessor accessor = new HealthRecordAccessor(connection, pPersonInfo.PersonId);

    accessor.NewItem(pHealthRecordItem);

    }

    Waiting for your kind response...


    Kind Regards

    Microsoft.Health.ItemTypes.Height ht = new Height();

    ht.When = new HealthServiceDateTime();

    ht.Value = new Length( double.Parse(tbValue.Text));

    SetHVRecords(ht, prsnInfo);

    public

    Monday, April 12, 2010 1:25 PM

Answers

  • Hi,

    During accessor creation can you please use the RecordId instead of PersonId ?

    Thank you,


    Anish Ravindran

    • Proposed as answer by Anish Ravindran Monday, April 12, 2010 3:58 PM
    • Edited by Anish Ravindran Monday, April 12, 2010 4:05 PM offline
    • Marked as answer by ORB_F3 Tuesday, April 13, 2010 6:50 AM
    Monday, April 12, 2010 3:41 PM
  • You can find the RecordId from pPersonInfo.SelectedRecord.id

    Thank you,


    Anish Ravindran
    • Marked as answer by ORB_F3 Tuesday, April 13, 2010 6:49 AM
    Monday, April 12, 2010 4:13 PM

All replies

  • Hi,

    During accessor creation can you please use the RecordId instead of PersonId ?

    Thank you,


    Anish Ravindran

    • Proposed as answer by Anish Ravindran Monday, April 12, 2010 3:58 PM
    • Edited by Anish Ravindran Monday, April 12, 2010 4:05 PM offline
    • Marked as answer by ORB_F3 Tuesday, April 13, 2010 6:50 AM
    Monday, April 12, 2010 3:41 PM
  • You can find the RecordId from pPersonInfo.SelectedRecord.id

    Thank you,


    Anish Ravindran
    • Marked as answer by ORB_F3 Tuesday, April 13, 2010 6:49 AM
    Monday, April 12, 2010 4:13 PM