locked
Upload File using iOS HealthVault SDK RRS feed

  • Question

  • I am using iOS SDK below.

    https://github.com/microsoft-hsg/HealthVault-Mobile-iOS-Library

    This SDK includes a demo app that can download personal image. By modifying this method, I was able to download Jpeg image from File (Document). Now, what I want to do is to upload image into File. However, after I created xml format, it gives me error message.

    The 'data-xml' element is missing for a new thing.

    Is there anyone who knows how to create xml format to upload image?

    Thank you,


    <?xml version="1.0" encoding="utf-8"?>
    <wc-request:request xmlns:wc-request="urn:com.microsoft.wc.request">
    <auth>
    <hmac-data algName="HMACSHA256">30MbJ+NT+O5yN3u+VXkWFkKSKUUXcDvlSKkn+lPDOkg=</hmac-data>
    </auth>
    <header>
    <method>PutThings</method>
    <method-version>2</method-version>
    <record-id>1ef60614-2866-4183-bff2-baa054a40347</record-id>
    <auth-session>
    <auth-token>ASAAAJGYk+KvXOtFkwBwUMtHaBY5Z+74dldxuLl21ri3O/EGwnfQ2frkuKI7Fy3+bIKNKQBuNxxVjelCWJXI3CsgCdcS7PZoHgKqyYQr3T9dly2ACjjcUL34Ycn6PWGdpiuHeWfqy4I1inrNyDpA0hRMlpDqEG8xzNcwGaI0o6xH0nXxgAhqMqI60hbJJmlG+MiWLxKtEmwjy6+4dAuj0Bn7xVgkctS4dO8BXg9N4y2pTYe8OLn3zn53ErjhWsYJ/2micG/LWjHQaGFTXJWFPEE1acAKfNnQcRd5nj4eLtH7NMcksXRkMmEffWL6+TFc9chYmg==</auth-token>
    <offline-person-info>
    <offline-person-id>8f1607da-2f04-4b34-a77f-e1fa722fd2d1</offline-person-id>
    </offline-person-info>
    </auth-session>
    <language>en</language>
    <country>US</country>
    <msg-time>2013-03-21T03:53:24.074Z</msg-time>
    <msg-ttl>1800</msg-ttl>
    <version>iOS V1.0</version>
    <info-hash>
    <hash-data algName="SHA256">FjpsOFAAKWnsUAZb9zZsDIwOdeYxz0aHC/EeZt8FZbE=</hash-data>
    </info-hash>
    </header>
    <info>
    <thing>
    <type-id>bd0403c5-4ae2-4b0e-a8db-1888678e4528</type-id>
    <thing-state>Active</thing-state>
    <flags>0</flags>
    <blob-payload>
    <blob>
    <blob-info>
    <name/>
    <content-type>image/jpeg</content-type>
    <hash-info>
    <algorithm>SHA256Block</algorithm>
    <params>
    <block-size>2097152</block-size>
    </params>
    <hash>c9LjKhLuDZPS/5K2QUf6sDjHsCokmg2HDddrmee22jA=</hash>
    </hash-info>
    </blob-info>
    <content-length>19772</content-length>
    <base64data>!! Image Data should be here, but I remved here because it's too much info !!</base64data>
    </blob>
    </blob-payload>
    </thing>
    </info>
    </wc-request:request>

    Thursday, March 21, 2013 4:35 AM

Answers

  • Sorry, I just solved this issue by myself. I just had to add data-xml after flags. 

                         "<data-xml>"
                         "<file>"
                         "<name>634993151471348148.jpeg</name>"
                         "<size>19772</size>"
                         "<content-type>"
                         "<text>image/jpeg</text>"
                         "</content-type>"
                         "</file>"
                         "<common>"
                         "<note>Cats</note>"
                         "</common>"
                         "</data-xml>"

    • Marked as answer by Daiki2013 Thursday, March 21, 2013 4:48 AM
    Thursday, March 21, 2013 4:48 AM