RemoveThings throws Exception

Apr 3, 2009 at 9:01 PM

I have an application that can read and write weight and blood pressure measurements from healthvault. But trying to delete or update something fails with an uncathegorized exception.
I tried this code to remove

    StringBuilder infoBuilder = new StringBuilder(256);


            infoBuilder.append("<thing-id>" + thingID + "</thing-id>");


    Request request = new Request();



    request.setTtl(3600 * 8 + 300);  



    Connection con = ConnectionFactory.getConnection();

    HVAccessor accessor = new HVAccessor();

    accessor.send(request, con);

    Response response = accessor.getResponse();

shouldn't PutThings with a given <thing-id> replace an existing element? For me this throws and Exception too. My Application does have full access rights to the record.

Any clues?


Apr 4, 2009 at 1:31 AM

You will need to include the version-stamp for the thing in order to call PutThings or RemoveThings.  The version-stamp identifies the specific version of the thing you are modifying.  You will also need to send more information about the thing itself.  A good place to start learning about the general framework of HealthVault is here: 

You should be able to examine the response to get more information about exceptions.