locked
Weight Conversion and PutThings Request RRS feed

  • Question

  • Hi,

    I am using the JAVA API to make updates to Microsoft HealthVault and I had a quick question on the PutThings request.

    In the request I make, If I fail to set the <kg> parameter (which translates to a 0.0 value for the <kg> parameter, the request returns with an error (invalid XML). If I convert the value from lbs to Kg, when I choose to edit the field in HealthVault, I do not get the display value but a value converted based on the Kg value. Here is an example:

    Display Value: 80 lbs; Kg: converted to 35.36

    On the main Weight measurement page - it looks fine. When I select to edit the record, I get the value as 79 lbs and 15.xxx ounces. The value should be 80 lbs as set in the display value.

    Is this not the way to set the weight values?

    Please note that I am using PutThings method when I make this call and not PutThings2. Still havent figured out how to use PutThings2.

    Thanks,

    Shyam

    Wednesday, February 16, 2011 12:30 AM

Answers

  • Hello Shyam,

    Thanks a lot for reporting this issue to us. Currently Shell converts the weight-value to pounds when editing.  It doesn’t use the display value. Value is getting reduced due to the conversion that Shell does. We will work on this and will try to come up with the best approach in future release.

    Can you please let me know whether the you are still getting the "Unexpected error"?

    Thanks and Regards,

    Aneesh D.

    • Proposed as answer by Aneesh D Friday, February 25, 2011 7:58 PM
    • Marked as answer by Aneesh D Friday, May 20, 2011 7:44 PM
    Friday, February 25, 2011 7:58 PM

All replies

  • Hello Shyam,

    Can you please paste the request XML that you are using for the PutThings method here?

    Thanks and Regards,

    Aneesh D.

    Wednesday, February 16, 2011 6:21 PM
  • Aneesh,

    Here is the request/response - when i get an error.

    <wc-request:request xmlns:wc-request="urn:com.microsoft.wc.request"><auth><hmac-data algName="HMACSHA1">XLguz2sqt/jwPLkJNAB1BVMQSos=</hmac-data></auth><header><method>PutThings</method><method-version>1</method-version><record-id>9315274c-2369-4436-95ea-58ad2fd8e849</record-id><auth-session><auth-token>ASAAANIyPz9kxE9LqGWIuUKYRyVgJDoU5SRgbXUxCuG7HcPWU3ptiN0/ZjaYfU7fDhoMttTRwBRr4tUACaMyuOcSk3Cz5GDhSQC8Xv+N5pPLy8UcTrnNB/u9WnQyetIPyLjIRaY+HF9VxPKrE/7kWpIaXsBTLQuPV+ZOsAMZvAzVPSJZ+UR6vvsVUdr9Mm2ACvbPLDINIJR3d7bbe4lwdlzGTW0kj8YOq/mT8EgbvgXBMhp6</auth-token><offline-person-info><offline-person-id>983d6e62-e9a0-4d08-9e53-c6028a9bef1a</offline-person-id></offline-person-info></auth-session><language>en</language><country>US</country><msg-time>2011-02-16T14:04:52.762-05:00</msg-time><msg-ttl>29100</msg-ttl><version>0.0.0.1</version><info-hash><hash-data algName="SHA1">pgx1ZxtpuS84J+N+W4zzrK/w/O0=</hash-data></info-hash></header><info><thing><type-id>3d34d87e-7fc1-4153-800f-f56592cb0d17</type-id><data-xml><weight><when><date><y>2011</y><m>2</m><d>16</d></date><time><h>14</h><m>4</m><s>48</s></time></when><value><kg>45.35147392290249</kg><display units="lb" units-code="lb">100.0</display></value></weight></data-xml></thing><thing/></info></wc-request:request>

    <?xml version="1.0" encoding="utf-8"?><response><status><code>1</code><error><message>An unexpected error occurred while processing the request.</message><error-info>failed-item-index=1</error-info></error></status></response>

    This one works

    <wc-request:request xmlns:wc-request="urn:com.microsoft.wc.request"><auth><hmac-data algName="HMACSHA1">iPvmJxtKDKQAksAXF/TfI17uBqQ=</hmac-data></auth><header><method>PutThings</method><method-version>1</method-version><record-id>9315274c-2369-4436-95ea-58ad2fd8e849</record-id><auth-session><auth-token>ASAAAAc0l5GS909AhtAG6llej2WJtlvl4oQuKD/CBOd4aivp1mAvKpLMGuT2PrY5n8JGEmzanXA+eawyUTwV7z6QdhnIig6ykhvelnQ6pH8dfNzNhE1y5HWWos1ByUg5IOc43NYwGlOdB0RWGEqisRwUP9TlnM/8QinPnnkLh/me7QTPXQJuCuVfEKlllnjeNHsagzt9qNGXSGjotatOzQa8lrffvlCsENV2SMVdoLHS639C</auth-token><offline-person-info><offline-person-id>983d6e62-e9a0-4d08-9e53-c6028a9bef1a</offline-person-id></offline-person-info></auth-session><language>en</language><country>US</country><msg-time>2011-02-16T14:15:01.157-05:00</msg-time><msg-ttl>29100</msg-ttl><version>0.0.0.1</version><info-hash><hash-data algName="SHA1">rz37eDNzMptSUpeddkKYOXgMLq8=</hash-data></info-hash></header><info><thing><type-id>3d34d87e-7fc1-4153-800f-f56592cb0d17</type-id><data-xml><weight><when><date><y>2011</y><m>2</m><d>16</d></date><time><h>14</h><m>14</m><s>57</s></time></when><value><kg>36.28</kg><display units="lb" units-code="lb">80.0</display></value></weight></data-xml></thing></info></wc-request:request>

    <response><status><code>0</code></status><wc:info xmlns:wc="urn:com.microsoft.wc.methods.response.PutThings"><thing-id version-stamp="3ed21a6f-7f4d-49e6-9585-66d2ccd36668">57f78b9b-6d69-4314-baea-25f4181df52b</thing-id></wc:info></response>

    Wednesday, February 16, 2011 7:17 PM
  • Aneesh,

    Another point of note is that when the uploaded record is edited, I see the weight in pounds as 79 lbs and 15.73934 ounces and not 80 lbs.

    Not sure why the display value is not being used to display the edit field.

    Thanks

    Shyam

    Wednesday, February 16, 2011 7:20 PM
  • Hello Shyam,

    Thanks for sending the request XML. I am currently investigating this issue. I will get back to you with the results as soon as possible.

    Regards,

    Aneesh D.

    Friday, February 18, 2011 3:08 AM
  • Hello Shyam,

    I am able to reproduce the second issue you have mentioned. After adding 80lb as the display value on the edit box I am seeing 79 lbs and 15.73934 ounces. Thanks for bringing this to our attention. I will comminicate this to our developement team and will get back to you with the results once I hear back from them.

    Regarding the first issue where you are getting "Unexpected error", I could see that you have an empty "<thing/>" tag inside the info tag. Can you please try the method after removing this empty thing tag?

    Thanks and Regards,

    Aneesh D.

    • Proposed as answer by Aneesh D Friday, February 25, 2011 7:58 PM
    Friday, February 18, 2011 8:55 PM
  • Hello Shyam,

    Thanks a lot for reporting this issue to us. Currently Shell converts the weight-value to pounds when editing.  It doesn’t use the display value. Value is getting reduced due to the conversion that Shell does. We will work on this and will try to come up with the best approach in future release.

    Can you please let me know whether the you are still getting the "Unexpected error"?

    Thanks and Regards,

    Aneesh D.

    • Proposed as answer by Aneesh D Friday, February 25, 2011 7:58 PM
    • Marked as answer by Aneesh D Friday, May 20, 2011 7:44 PM
    Friday, February 25, 2011 7:58 PM