locked
Retrieving the Blood Glucose from the Healthvault in Offline model RRS feed

  • Question

  • Hi,

    On friday i have already added one thread related to accessing Offline access of data and that giving Exception i.e. WildCatException.
    So after that i have used there certificate which is already present in that folder having application id

    <

     

    add key="ApplicationId" value="37f55bd1-c5dc-4401-8aec-fe0d1b850c42" />

    so after that i can able to access the data of Height.
    But when i changed that type to Blood Glucose which will retrieve the Blood glucose data from Healthvault.
    But it is not retriving the Blood Glucose. So I thought that it is the problem with that application Id which we cant see in that config page that has not offline access rights to Blood Glucose.

    So now i have created once again certificate through Application Manager i uploded on to the Healthvault and Grant the IIS.
    I have change the rule to access all the data type of healthvault in Offline.
    So i saved that.

    But when i am trying to access with this application it is giving access denied for
    Microsoft.Health.HealthServiceAccessDeniedException

    So i cant identify whats the error.


    Thanks Shrivallabh
    Monday, July 20, 2009 12:52 PM

Answers

  • Clear all the personid and recordid you have obtained by using the application id in the SDK sample. (You just need to delete the offline.txt file created)

    Enter the applicationid of what you created in web.config
    Use your application id and get a new personid and recordid for the user for the applicationid you created.   The offline.txt will be recreated again.

    If you still get the exception, post the full message and the stacktrace.

    Raj


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, July 21, 2009 1:52 PM

All replies

  • Can you post more information?

    Specifically,

    a.  WHat is the code which throws the HealthServiceAccessDeniedException. 
    b.  THe stack trace and the error message in the exception.
    c.  The applicationId you are using

    Raj


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, July 20, 2009 1:22 PM
  • Hi Raj,
    I am using following line of code to access the Blood glucose,

    OfflineWebApplicationConnection

     

    offlineConn =

     

    new OfflineWebApplicationConnection(new Guid(ConfigurationManager.AppSettings["ApplicationId"]), ConfigurationManager.AppSettings["HealthServiceUrl"] + "wildcat.ashx", personId);

     

     

    HealthRecordAccessor hra = new HealthRecordAccessor(offlineConn, recordId);

     

    offlineConn.Authenticate();

     

    PersonInfo person = offlineConn.GetPersonInfo();

     

    HealthRecordAccessor accessor =

     

    new HealthRecordAccessor(offlineConn, recordId);

     

    HealthRecordSearcher searcher = accessor.CreateSearcher();

     

     

    HealthRecordFilter filter = new HealthRecordFilter(BloodGlucose.TypeId);

     

     

    searcher.Filters.Add(filter);

     

    int count = searcher.GetMatchingItems().Count;

     

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

    But the problem is that I am cannot able to retrieve the Blood glucose data it returns zero rows even the Blood Glucose information present in that.I can able to retrieve other info such as Height , Weight etc but Blood Glucose i cant able to retrieve can y give the Solution.

    I use the certifcate present in the sdk offline access sample code.

    Please give me the solution.


      

    Thanks Shrivallabh
    Tuesday, July 21, 2009 10:13 AM
  • In the first post you said mentioned that you are getting an exception.  Are you getting the exception or is it just that the search is returning 0 items?

    Please try creating your own application id.  Here is a video on how to do this.  I am suggesting this since I am not sure about the data type access configuration of the application id that comes with sdk.  Note that after you create the application id and configure your application to use it, you need to authorize the user seperately and then use the new personid and recordid.

    Raj
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, July 21, 2009 11:04 AM
  • When I am trying to use my own application ID at that time i am getting this exception. So i try with that Offline certificate id then it doesnt give the exception but it is not giving the Blood glucose information.
    I am trying to find solution but i didn't get any proper way to solve this problem. i have created 2 to 3 application ids. Given whole access for offline and online. But still problem remains same.
    Can y help me in this.

    Thanks Shrivallabh
    Tuesday, July 21, 2009 12:04 PM
  • Clear all the personid and recordid you have obtained by using the application id in the SDK sample. (You just need to delete the offline.txt file created)

    Enter the applicationid of what you created in web.config
    Use your application id and get a new personid and recordid for the user for the applicationid you created.   The offline.txt will be recreated again.

    If you still get the exception, post the full message and the stacktrace.

    Raj


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, July 21, 2009 1:52 PM