locked
Exception trying to run console app RRS feed

  • Question

  • I put together a console app that follows exactly along EricGu's recent post. However, when I get to this line:

     

    HealthRecordItemCollection items = searcher.GetMatchingItems()[0];

     

    I get an exception, "The unique identifier for the person cannot be '00000000-0000-0000-0000-000000000000'."

     

    The call stack in the exception is:

       at Microsoft.Health.EasyWebRequest.WaitForCompletion()
       at Microsoft.Health.EasyWebRequest.Fetch(Uri url)
       at Microsoft.Health.EasyWebRequest.Fetch(Uri url, IEasyWebResponseHandler customHandler)
       at Microsoft.Health.HealthServiceRequest.ExecuteInternal()
       at Microsoft.Health.Web.OfflineWebApplicationConnection.ExecuteRequestWithRetry(HealthServiceRequest request)
       at Microsoft.Health.HealthServiceRequest.Execute()
       at Microsoft.Health.HealthRecordSearcher.Execute()
       at Microsoft.Health.HealthRecordSearcher.GetMatchingItems()
       at healthvault.HealthVaultAdapter.Main(String[] args) in C:\src\foo\trunk\inbound-adapters\healthvault\HealthVaultAdapter.cs:line 28
       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()

     

    I am able to run the OfflineAccess sample--using the same person and record GUIDs--and when I get to the same line there, it goes without any problems. When I put a breakpoint in the sample and compare the locals in my console app against the sample, I can't see any differences.

     

    Eric, or anyone else out there, do you have an idea how to deal with this exception?

     

    Thanks,

    jeff

    Sunday, October 5, 2008 6:38 AM

Answers

  • I'm sorry the example isn't clearer.

     

    The user id and record ids need to be recorded from an online application after the user authorizes it. Typically, they'd be stored into your database in the record associated with that user.

     

    In this case, the assumption is that you've run the offline sample in the SDK, recorded the user id and record id, and pasted them into the console application.

     

    Note that you can also get the user id and record id from the patient connect scenario.

    Monday, October 6, 2008 4:19 PM

All replies

  • I'm sorry the example isn't clearer.

     

    The user id and record ids need to be recorded from an online application after the user authorizes it. Typically, they'd be stored into your database in the record associated with that user.

     

    In this case, the assumption is that you've run the offline sample in the SDK, recorded the user id and record id, and pasted them into the console application.

     

    Note that you can also get the user id and record id from the patient connect scenario.

    Monday, October 6, 2008 4:19 PM
  • Eric, the example was quite clear. I had gotten the user ID and record ID using the offline app. The problem was that I was trying to use them with the app ID I generated for *my* app, so it was, of course, barfing. I plugged in the app ID for the offline app, and it now works fine.

    Thanks,
    jeff
    Monday, October 6, 2008 11:23 PM