Master/Child applications

Nov 18, 2011 at 2:23 PM

Hi Rob.

I need to create a couple of "child" applications for a master one. I created a master application by going to ACC and now for creating the child applications, it seems to me that the only way to do so is through APIs. Is that the case? If so, does the Java library support that? Any pointer would be appreciated.

 

Thanks,

Ali.

Nov 18, 2011 at 7:28 PM

hi Ali --

Yes the only way to create Master child applications would be to use API. The Java SDK does have AddApplication method which you can use to create the child application.

An example of .NET equivalent is at --
http://healthblog.vitraag.com/2008/07/creating-a-healthvault-child-application/

Hope this helps.

regards,
Vaibhav 

Nov 18, 2011 at 10:18 PM

Thanks Vaibhav, I will give that a try. If I create a child application, will it show up in ACC as well?

Ali.

Nov 21, 2011 at 2:27 PM

Vaibhav,m

I am also not very clear as to how the authentication happens in this case; I am used to using the personId and profileId of an end user for an off-line communication; authorization and authentication would happen using those but in this case, it is not an end user who is creating the child application; it is the "application admin"(the one who created the master app) who is doing that so how does the authentication happen to grant access to create a child app? If I am the admin, how should I authenticate myself in the java code to have such permissions?

Thanks

Ali.

Coordinator
Nov 21, 2011 at 6:51 PM

The master/child admin methods (Add/UpdateApplication) only require application level authentication.  You do not need to include a user-token or offline-user-id with the request.

The child applications will not display in ACC, afaik.

Nov 21, 2011 at 7:11 PM

Thanks Rob. I was looking at the AddApplication method earlier today and I believe I would need some help with setting up the child app and application level authentication. Is there a snippet of code that you can point me to (in Java)? The .Net version was not very helpful to see what I need to do in the Java version; any help is greatly appreciated.

 

Thanks,

Ali.

Nov 30, 2011 at 1:23 PM

Hi Rob.

 

Will you be able to provide some java snippets or point me to an example done in Java to get me going? Any help is appreciated.

Many thanks,

Ali.

Dec 3, 2011 at 1:24 PM

Rob,

Could you please tell me how I can authenticate the "admin" person who needs to access the ACC to create the child app? In case of reading medical data on behalf of a patient, I send the user to HV, get a token and then get personId/recordId to be used for subsequent calls on behalf of that user but in this case where I want to create a child app,it is very different fro that pattern;  it is the admin who needs to be authenticated and that is against ACC, so how does that work? Do I need to do something similar to get a token for the admin or directly use username/password? I don't know how the authentication should happen.

 

Any help is greatly appreciated; our GO-LIVE process is pending on creating a child app and I need to get that done as quickly as possible.

 

Thanks

Ali.

Coordinator
Dec 9, 2011 at 3:52 PM

Hi Ali,

Master/Child doesn't go through ACC.  Only the master application needs to be created there.  The Add/UpdateApplication method calls go directly to HealthVault.  You will need to call Add/UpdateApplication with the master application to create the child app.  There isn't a user involved so you do not need to include a user-token in the request.  Only the master application needs to be authenticated.

--Rob

Dec 9, 2011 at 4:01 PM

Rob,

I managed to get that working. One issue I am seeing is the following: I am making my request like the following:

 

AddApplicationRequest req = new AddApplicationRequest();
// add all the stuff needed to the request
OnlineRequestTemplate requestTemplate = new OnlineRequestTemplate(ConnectionFactory.getConnection(masterAppId, url));

Object response = requestTemplate.makeRequest(req);

 

 It all works fine, it does create a child app and returns the following XML (based on the log):

<response>
  <status>
    <code>0</code>
  </status>
  <wc:info xmlns:wc="urn:com.microsoft.wc.methods.response.AddApplication">

    <id>[some app id, deleted here]</id>
  </wc:info>
</response>

but the 

Object response = requestTemplate.makeRequest(req);

in my code returns null, so I have to look at the log to get the appid, etc. Is there something else that I need to do to send the request?

 

Thanks,

Ali.

Dec 20, 2011 at 4:00 PM

Rob,

Another issue I see is that when I tried to use the UpdateApplicationRequest, it threw an exception since that class doesn't have JAXB annotation. Is that by design or a mI missing something?

 

Thanks,

Ali.

Coordinator
Dec 31, 2011 at 6:24 AM

Hi Ali,

Let me look at those methods and see if they were good to go for Jaxb.

--Rob

Dec 31, 2011 at 6:38 AM

I would appreciate that Rob.

Ali.

Coordinator
Dec 31, 2011 at 6:54 AM

I see the problem with AddApplication.  I'll add the annotations to UpdateApplication too. Then some unit tests and away we go....I'll post here when I'm done.

--Rob

Coordinator
Dec 31, 2011 at 8:42 AM

The fixes are checked into the trunk.  I'll have to push another release to pick up the most recent changes, but I don't anticipate that for another month or so.  You can check out the trunk directly.