Uploading of file to Microsoft healthvault using Java API

Dec 1, 2011 at 1:22 PM

Hi there,

I have requirement to upload audio file (.mp3 ) to microsoft healthvault using Java API.

Currently there is no sample or snippet available on web to show how exactly this requirement can be met.

Issue is Java library allows only uploading of file schema and not actual contents


there are only three set options in java library for file

-           Name

-          Size

-          CodableValue (contentType)

 there is no option to set actual content or content path  in java

In C#, its available as

Microsoft.Health.ItemTypes.File file =    File.CreateFromFilePath(@"C:\My Pictures\picture.jpg”, new CodableValue("image/jpg"));



I tried to add set option for path (in XML payload of file ) but I got error response XML from healthvault system 

Then I went with second approach wherein I tried to upload File Schema + Blob carrying file content data using version 2 API since version 1 doesn’t supports

blobPayload under thing packet  

This time file got uploaded and got listed under uploaded files head but it was again lacking blob contents since while uploading I specified typeId for file and not for Blob (which I didn’t find in API docs)

 I am stuck in getting file uploaded with data on healt vault system and there is no working sample available on web for this.

 Can anybody provide help on this ? Thanks in advance (Its urgent)

Dec 2, 2011 at 9:27 PM


I have not yet implemented blob streaming for this library.  How large are the mp3 files you are uploading?  If they are less than 12MB or so, you can include them as an inline blob.

The blob itself is Base64 encoded and placed in the DataOther element. 


DataOther data = new DataOther();


Does that help? I don't have an example to use but it would be worthwhile to include a test and example for this case.