locked
How to upload CCD document from java project via .net web service? RRS feed

  • Question

  • My project is a java project, but I am using .net healthvault SDK since JAVA SDK doesnt completely support healthvault.
    As of now I have done this:
    1. Created a sample java application in eclipse environment and sending xml values[CCD document] as string using soap to .net environment... meanwhile created a .net web service method in .net which will access the xml values [in string format, which is been sent from java]. Now I want to take this xml file[which is a ccd document] to the healthvault server. To upload a CCD document in healthvault server I should write the below code:

    XmlDocument ccdDocument = new XmlDocument();
    ccdDocument.Load(fileLoc);
    PersonInfo personInfo = WebApplicationUtilities.PageOnPreLoad(HttpContext.Current, true);
    HealthRecordItem ccd = new HealthRecordItem(CCD_THING_GUID, ccdDocument);
    PersonInfo.SelectedRecord.NewItem(ccd);

    But I cannot write the above code in webservice method. So where should I write and how should I work on this particular scenario


    Simply;
    I want to upload CCD document into the healthvault server from java project. [FYI, I've posted the question in codeplex.com, but I didn't get the solution]. From java, CCD document can't be uploaded into healthvault server directly so I am using .net. Kindly guide me how to bridge java->.net->healthvault server

    Wednesday, January 20, 2010 9:49 PM

Answers

  • Hi Kumaresh,

    The CCD document  can be uploaded from the web service to healthvault server. You can add the below sample code in your webservice to upload the CCD document

     [WebMethod(EnableSession = true)]
            public bool UploadCCD(string filePath)
            {
               
                XmlDocument ccdDocument = new XmlDocument();
                ccdDocument.Load(filePath);
                if (personInfo == null)
                {
                    personInfo = WebApplicationUtilities.LoadPersonInfoFromCookie(HttpContext.Current);
                }          
                HealthRecordItem ccd = new HealthRecordItem(CCD_THING_GUID, ccdDocument);
                personInfo.SelectedRecord.NewItem(ccd);
                return true;
            }

    For detailed information on how to deal with webservices in HealthVault Applications is given in the below url.

    http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/0048152f-dd7a-4516-92cc-b89ab2f1a8da


    Regards,
    Madan Kamuju

    Thursday, January 21, 2010 8:12 PM

All replies

  • Hi Kumaresh,

    I am looking into this issue and i will update you.

    Regards,
    Madan Kamuju
    Thursday, January 21, 2010 7:25 PM
  • Hi Kumaresh,

    The CCD document  can be uploaded from the web service to healthvault server. You can add the below sample code in your webservice to upload the CCD document

     [WebMethod(EnableSession = true)]
            public bool UploadCCD(string filePath)
            {
               
                XmlDocument ccdDocument = new XmlDocument();
                ccdDocument.Load(filePath);
                if (personInfo == null)
                {
                    personInfo = WebApplicationUtilities.LoadPersonInfoFromCookie(HttpContext.Current);
                }          
                HealthRecordItem ccd = new HealthRecordItem(CCD_THING_GUID, ccdDocument);
                personInfo.SelectedRecord.NewItem(ccd);
                return true;
            }

    For detailed information on how to deal with webservices in HealthVault Applications is given in the below url.

    http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/0048152f-dd7a-4516-92cc-b89ab2f1a8da


    Regards,
    Madan Kamuju

    Thursday, January 21, 2010 8:12 PM