locked
HealthServiceAccessDeniedException in CCR-CCD example RRS feed

  • Question

  • Hi,

    I am giving a spin to the HealthVault .NET SDK. I was successful in running the HelloWorld example from within Visual Web Developer Express Edition. The application successfully fetched the personal info of my test user and also it posted the hard coded value of 2.0 (user's weight) to the user's record in HealthVault. However, in the CCD_CCR example, when I try to post the CCR, I get a
    HealthServiceAccessDeniedException ("Access is denied.") on the line shown below.

        protected void c_AddCCR_Click(object sender, EventArgs e)
        {
            XmlDocument ccrDocument = new XmlDocument();
            ccrDocument.Load(MapPath("ExampleCCR.xml"));

            HealthRecordItem ccr = new HealthRecordItem(CCR_THING_GUID, ccrDocument);

            PersonInfo.SelectedRecord.NewItem(ccr); <- this is where the exception is thrown

            FetchCCRRecords();
        }

    Please note I do have the checkbox checked in my rules for CCR and CCD. My application id is a87ac166-14e9-429c-bcf6-3be291a7dec0.

    Interestingly, when I was testing the HelloWorld repeatedly, at one point, I kept getting the HealthServiceAccessDeniedException. I tried all I could possibly do with my limited .NET knowledge (I am a java developer), but it did not help. So, I registered a new user and tested. The application worked. Am I missing something here?

    I would appreciate any help.

    Thanks,
    Abbas
    Sunday, October 19, 2008 9:24 PM

Answers

  • hi Abbas -

     

    Your application does have access to CCR_CCD_THING (1e1ccbfc-a55d-4d91-8940-fa2fbf73c195). Can you share the stack trace which you get from the exception thrown at NewItem?

     

    If i understand correctly, your application id works correctly with Hello Wolrd sample but fails in the CCR_CCD sample - right?

     

    Just FYI - any application changes in rules take 20-30 mins to propagate. If you just made the changes in your application authorization rule and then see this anamoly - chances are that the applicaiton configuration has not propagated.

     

    Hope this helps.

     

    regards,

    Vaibhav

     

    Wednesday, October 22, 2008 5:45 PM

All replies

  • Is this a problem with one specific user or have you tried the code with another user too?

    Let me know


    Tuesday, October 21, 2008 3:45 PM
  • The problem is not with a specific user. I created multiple users to test it. I keep getting the same exception for all users. Just to clarify, I am using my registered application's id for the 'ApplicationId' attribute in Web.Config. I have used the same application id for my hello world and it works.

    Thanks in advance, Rajesh.

    Abbas
    Tuesday, October 21, 2008 4:14 PM
  • hi Abbas -

     

    Your application does have access to CCR_CCD_THING (1e1ccbfc-a55d-4d91-8940-fa2fbf73c195). Can you share the stack trace which you get from the exception thrown at NewItem?

     

    If i understand correctly, your application id works correctly with Hello Wolrd sample but fails in the CCR_CCD sample - right?

     

    Just FYI - any application changes in rules take 20-30 mins to propagate. If you just made the changes in your application authorization rule and then see this anamoly - chances are that the applicaiton configuration has not propagated.

     

    Hope this helps.

     

    regards,

    Vaibhav

     

    Wednesday, October 22, 2008 5:45 PM
  • Hi Vaibhav,

    First off, thanks so much for your response and information about application rules propagation. For kicks, I created a new user now on live.com and tried the CCR/CCD example and lo and behold it works with my application id. I will try to see if it works with my previous test user.

    Btw, I wanted to export the certificate pair from HealthVault Application Manager to java key store so that I can try my application id with the Java HealthVault SDK/test UI app from codeplex. However, while converting the key pair, the tools prompt for password. I do not recall having provided any password when I generated the certificate with HealthVault Application Manager. Do you have any suggestion? I am thinking of generating a key pair in java key store, converting it to pfx and importing into HealthVault Application Manager. Would that work?

    Regards,
    Abbas
    Thursday, October 23, 2008 3:03 AM
  • hi Abbas -

     

    Wrt to the Java library, you will find the information on this thread useful:

    http://www.codeplex.com/HealthVaultJavaLib/Thread/View.aspx?ThreadId=33813

     

    Essential folks have create a public private key pair using the java keytool and then uploaded the relevant cer file as a public certificate for their applicaiton via applicaiton configuration centre.

     

    Hope this helps.

     

    regards,

    Vaibhav

     

    Friday, October 24, 2008 1:41 AM