This project is read-only.

Reference

To simplify the provisioning process and sending requests and receiving responses from the HealthVault service, the mobile library does some of the hard work for you. This is done through the following classes:

HealthVaultService

The HealthVaultService class handles creating and processing the request and response envelope xml, performing the provisioning process, and saving and loading the information that allows the application to talk to the service.

Constructor
-
> The url of the HealthVault service
-> The url of the HealthVault shell
-> The master application id

 

BeginSendRequest
-> The request to send, defined in a HealthVaultRequest instance.

When the request is completed the notification routine that is defined in the request will be called.

 

GetApplicationCreationUrl

Returns the URL that should be passed to the mobile devices browser to create and authorize the application.

 

LoadSettings
-> The name of the settings file

Loads the configuration information from the mobile platform’s storage for this application.

 

SaveSettings
-> The name of the settings file

Saves the configuration information to the mobile platform’s storage for this application.

 

BeginAuthenticationCheck
-> A handler to call if the user needs to be sent to the HealthVault shell.
-> A handler to call when the authentication check is done.

This method will perform the provisioning flow. If the user needs to be sent to the HealthVault shell, it will call the handler for the application to do that. If the provisioning is complete, the second handler will be called.

The application must call this method on startup. When either of the handlers are called, the application must call the SaveSettings method to save the current state.

 

BeginAuthorizeRecords
-> A handler to call if the user needs to be sent to the HealthVault shell.
-> A handler to call when the authentication check is done.

Sends the user back to the HealthVault shell to authorize additional records. Works just like BeginAuthenticationCheck, and should use the same handlers.

 

Records

A collection of HealthVaultRecord items, where each item corresponds to one of the records the user has authorized the application to access.

 

CurrentRecord

The record that will be used when sending record-related requests (get things or put things) to the HealthVault service. It must be set to one of the records in the Records collection.

This property will be saved and restored by SaveSettings() and LoadSettings().

 

HealthVaultRequest

The HealthVaultRequest class holds the information for a specific request that will be sent to the HealthVault service.

Constructor
-> The name of the method to be called.
-> The version of the method to be called.
-> The “info” section of the xml for the request.
-> An event handler to be called when the request is complete.

A list of methods and versions can be found on the HealthVault Developer Center. You can find the XSD for each of the methods at that location.

The info section is the request-specific information.

The application should check the ErrorText property on the event args in the event handler.

 

HealthVaultResponse

The HealthVaultResponse class holds the information that has come back from a request to the HealthVault service.

If an error occurred during the request, the ErrorMessage property will be non-null.

MobilePlatform

The MobilePlatform class encapsulates some of the operations that are likely to be platform-specific.

Provisioner

The Provisioner class handles the process started by BeginCheckAuthentication method.

WebTransport

The WebTransport provides a simple transport optimized for doing POST requests.

Last edited May 18, 2011 at 5:31 PM by vaibhavb_msft, version 2

Comments

No comments yet.