locked
PutThings Validates with schema validator, but XML request format does not match the format required RRS feed

  • Question

  • fyi: as of last night around 10:PM PST, there are runtime errors on the Types References web page: http://developer.healthvault.com/types/verifytypexml.aspx?id=bd0403c5-4ae2-4b0e-a8db-1888678e4528

    My goal:
    I want to be able to programmatically upload arbitrary images (supported types, jpeg, etc) to healthvault, using the XML Api from the Ruby Language.  

    My Problem:
    Getting XML mismatch with the schema even when my Request validates with the "Verify XML".

    History:
    I am able to get my redirects working, and able to read profile information etc.  I am using the Ruby HealthVaultLib with comfortable successes reading data.


    Question:
    Is it safe to assume that if the Schema Validator validates my XML with the Method XML Verifier (http://developer.healthvault.com/types/verifytypexml.aspx?id=bd0403c5-4ae2-4b0e-a8db-1888678e4528 ) that I should not be seeing the below error:

    <?xml version="1.0" encoding="utf-8"?><response><status><code>3</code><error><message>The XML request format does not match the format required by the method.</message></error></status></response>
    Second Question:
    Is my best bet to install the samples and sniff the valid requests to help me formulate working Request messages?  Is there a point where the request is not ssl to make this possible? The very awesome tool xray (https://xray.getrealconsulting.com/ ) looked promising for this, but it seems it only gives up the xml object at rest, and not the xml request message that created the item.

    Here is my example request:
    <?xml version="1.0"?>
    <wc-request:request xmlns:wc-request="urn:com.microsoft.wc.request">
    	<auth>
    		<hmac-data algName="HMACSHA1">UC1twQj8M6gQ760lki9Zvw8tSW4=</hmac-data>
    	</auth>
    	<header>
    		<method>PutThings</method>
    		<method-version>1</method-version>
    		<record-id>c39e7c61-3a64-4f0e-ae6f-664923beb9ac</record-id>
    		<auth-session>
    			<auth-token>xASAAAJQ1R50J8HpMshAjeHkjh/gBYsx9nf25ZydIvCvkyHWGAnmoeotRbmgvwBLvvyF4a+oN9G4RC/ExdoZCFh9K/0jRgc1Qfu2HLReHT6HDHaaFerNjpSHeObgDZYY9eSFLHgk4dSfERPennGWkZzEpF8eKuBRYg9loDcq0UGkBp8bU62vEPxjmI5VstAws385UTh2nOr65eDmjx9Jf/yOY2Rl1kvJS</auth-token>
    			<user-auth-token>xASAAADcxjWnO77lCnm0iwjcQrAw0I2AwCqrgWZ8wk1R1irzhsO5o1lF81GfEl64qbYKcbrv48VoOIGufOL/skawhTwaRWku6+e8peFWwejrxTZh0SnOOweRJtW2MDIuwwc5ymsRUoLWEqZnBdvyEcOWsGW9xq7XI1QT6WnU9/qt/ucfTGGeing==</user-auth-token>
    		</auth-session>
    		<language>en</language>
    		<country>US</country>
    		<msg-time>2009-01-01T00:00:00Z</msg-time>
    		<msg-ttl>1800</msg-ttl>
    		<version>0.9.1712.2902</version>
    		<info-hash>
    			<hash-data algName="SHA1">Hco3FJe6c6q6NXJ1ZxYznIInSnQ=</hash-data>
    		</info-hash>
    	</header>
    	<info>
    		<thing>
    			<thing-id/>
    			<type-id>bd0403c5-4ae2-4b0e-a8db-1888678e4528</type-id>
    			<thing-state>Active</thing-state>
    			<data-xml>
    				<file>
    					<name>gar.tif</name>
    					<size>628</size>
    					<content-type/>
    				</file>
    			</data-xml>
    			<data-other content-type="image/tiff" content-encoding="base64">R0lGODlhIAAgANUAACEgIShj8VqJAQUoGEyYdax3pCAAOw==</data-other>
    		</thing>
    	</info>
    </wc-request:request>
    Thank you, any help on this is appreciated.
    Tuesday, September 22, 2009 12:56 PM

Answers

  • I understand that you are using Ruby.  But if you can run the .Net SDK based samples you can follow the instructions in the post below to log the request-response to a log file.

    http://healthblog.vitraag.com/2008/06/curious-about-whats-under-the-healthvault-sdks-hood/


    If you still wanted to sniff the wire, you can use tools such as fiddler (but need some extra configuration (and coding in case of .Net) so that the client will trust its automatically generated ssl certs).  Let me know if this is a direction you wanted to take.   But for all practical purposes I suggest you turning on logging and writing equivalent code using .Net SDK to get an idea on how the real messages look like.

     


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, September 22, 2009 1:08 PM

All replies

  • I understand that you are using Ruby.  But if you can run the .Net SDK based samples you can follow the instructions in the post below to log the request-response to a log file.

    http://healthblog.vitraag.com/2008/06/curious-about-whats-under-the-healthvault-sdks-hood/


    If you still wanted to sniff the wire, you can use tools such as fiddler (but need some extra configuration (and coding in case of .Net) so that the client will trust its automatically generated ssl certs).  Let me know if this is a direction you wanted to take.   But for all practical purposes I suggest you turning on logging and writing equivalent code using .Net SDK to get an idea on how the real messages look like.

     


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, September 22, 2009 1:08 PM
  • Raj is spot on: Fiddler (with HTTPS decoding enabled, see instructions on the Fiddler site) or .NET SDK Logging are both good options, and recommended to do more practical investigation to see real-world examples of the schemas in action.
    Tuesday, September 22, 2009 5:21 PM
  •  

    http://www.fiddler2.com/fiddler2/

     

    Make sure you do the additional steps to have Fiddler capture HTTPS traffic, as almost all HV traffic is HTTPS.  If you don't do this, you won't capture the necessary data.

     

    http://www.fiddler2.com/Fiddler/help/httpsdecryption.asp

    Tuesday, September 22, 2009 5:21 PM