Problem passing multiple parameters through actionqs

May 18, 2011 at 6:25 AM
Edited May 18, 2011 at 6:25 AM

Our application would like to pass two parameters through actionqs back to us. But our second parameter is dropped when we get the response. We hope to use the standard way to pass these parameters. What could we do?

Our app calls the shell like this:


The redirect from the shell is like this:


I think that the last & may be the problem. I also tried %26 without any luck. What could I do?

Thanks in advance,


May 18, 2011 at 5:27 PM
Edited May 18, 2011 at 8:46 PM

Hi May,

This type of question that isn't directly related to the Java SDK is better asked at the HealthVault forums here.  They have a number of people that can answer questions.

That said, the actionqs parameter will be appended to your redirect URL in it's entirety.  You can include a path and/or query parameters.  I bolded your actionqs parameter below: 

Query string parameters are separated by the "&" character.  Url parsing treats the string myParamTwo=MyValueTwo as a separate query string parameter to the redirect.aspx page and is not releated to the actionqs paramter. 

My suggestion is to use the following pseudo-logic:  Note the use of Url encoding.

String actionqsString = URLEncoder.encode("/a/path/to/somewhere?myParamOne=MyValueOne&myParamTwo=MyValueTwo");

String targetqsString = URLEncoder.encode("appid=blablabla&redirect=http://localhost:8080/myapp&actionqs=" + actionqsString);

String redirectString = "" + targetqsString;

In the end you will be redirected to "http://localhost:8080/myapp/a/path/to/somewhere?myParamOne=MyValueOne&myParamTwo=MyValueTwo".


To be fair, HealthVault redirects you to your redirect url with target=AppAuthSuccess&actionqs=%2fa%2fpath%2fto%2fsomewhere%3fmyParamOne%3dMyValueOne%26myParamTwo%3dMyValueTwo&wctoken=ADAC64...

Typically, your action page will parse the actionqs and forward the parameters along.  Many action pages issue a redirect to the final destination.


May 19, 2011 at 12:57 AM

Thanks Rob for the quick reply. I tried your suggestion and the encoding worked for the second parameter. but I still do not get the correct redirect. I will post to the HealthVault forum as you suggested and see what answers I get.

With the following response, I need to process the response and do another redirect to the correct page:




May 19, 2011 at 4:48 PM
Edited May 19, 2011 at 4:48 PM

Hi May,

What is the correct result you are looking for?  What did you get? The logic above should be correct. 

Yes, it is up to your application to process the AppAuthSucess action and continue on according to the actionqs.


May 19, 2011 at 6:44 PM

Hi Rob,

    I am looking for a redirect to "http://localhost:8080/myapp/a/path/to/somewhere?myParamOne=MyValueOne&myParamTwo=MyValueTwo". With the extra action page your recommended, I am all fine now. Thanks!