Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Developer
Posts: 26
Registered: ‎10-29-2009
My Device: Not Specified
Accepted Solution

Dynamic License Key test on AppWorld Main Application Data Page

I have been trying for four days to get a correct test response from the App World Application data New Application Submission page.  It's actually amazing what one will do after a couple days of frustration.  As it turns out, I believe it is there problem, not mine!!!

 

The test for claims to send:

 

POST /strokewatchkey.ashx HTTP/1.1
Content-Type: application/www-url-encoded
Host: www.mywebsite.com

 

PIN=12341234&email=storefrontmanager@rim.com&product=Strokewatch&version=1.0&transactionid=123&test=...

 

When I finally looked at what they were actually sending, IT TURNS OUT THAT THEY ARE NOT SENDING THE QUERYSTRING, they are just hitting my webpage with no arguments!!!!

 

That explains why I could get a correct response if I just return an test string, and have the response fail when I actually try to compute a dynamic key.  The site keeps returning a Content-Length of 4!!!

 

Took me a day to believe there was nothing wrong with my code and focus on the Content-Length that was being returned, which is "key=".   That's when I realized that my Dynamic Key length was zero.  It turns out it is zero because APP Worlds wasn't sending a querystring as they say they are, so there was not any REQUEST variables to use to create a DYNAMIC KEY!!

 

This whole thing makes me wonder how many people are actually using Dynamic Keys, they certainly could not a correct response from the submission.  Or maybe they just ignored the test and finished with the submission.  Is this a known problem with their application?

 

 

 

Developer
Posts: 484
Registered: ‎07-17-2008
My Device: Not Specified

Re: Dynamic License Key test on AppWorld Main Application Data Page

Seems to be working here.

 

Are you testing from the "Licensing" tab in the Vendor Portal?

Developer
Posts: 26
Registered: ‎10-29-2009
My Device: Not Specified

Re: Dynamic License Key test on AppWorld Main Application Data Page

This is my first blackberry application. I am in the Vendor Portal,


1.  Select Manage Applications
2.  Select Add Applications
3.  In step 2, I work my way down to the bottom after specifying paid License Type, price, and then Dynamic License Model.
4.  It then asks for a HTTP URL for keys.  When I enter it and press the Test button, my Test responses have been failing whenever I try create a dynamic key based on the the Request Query string variables that is suppose to be sent.  If I just ignore the variables and return a string like "testkey", it works fine.

 

I haven't seen a "licensing tab" in the Vendor portal

Developer
Posts: 26
Registered: ‎10-29-2009
My Device: Not Specified

Re: Dynamic License Key test on AppWorld Main Application Data Page

Incidentally, I also don't get the Content-Type: application/www-url-encoded requirement outlined in the DYNAMIC_LICENSE_FLOW.PDF document on the AppWorld site.  In that example it says the vendor portal expects the following response:

 

HTTP/1.1 200 OK
Content-Type: application/www-url-encoded
Content-Length: 20
key=ABCDEFGHIJK

 

The problem is that [key=ABCDEFGHIJK] is only 15 characters, not 20.  If you URL-Encode it, the string becomes [key%3dABCDEFGHIJK] and is only 17 characters.  So where does the 20 characters come from?  Besides that, the test button FAILS if you do encode the key string, the key=xxxxx needs to be sent back UNENCODED in the response.

 

So even if I ignore the test and just jimmy something up that will pass their test, I really don't know what to expect when I get something for real from App World.

 

I would love to hear from someone who actually has dynamic licensing working and able to sell and license in the marketplace.

Developer
Posts: 111
Registered: ‎12-16-2008
My Device: Not Specified

Re: Dynamic License Key test on AppWorld Main Application Data Page

I think there's a misunderstanding regarding how http POST works. The query string will not appear in the url, but is sent as the content of the POST request. Your script that receives it will have to expect POST data, not data in the url (GET). In PHP you use $_POST['PIN'], etc.

 

The Content-length of 20 is an error, clearly just an example. The content-length should be EXACTLY the number of characters in the returned data. In the example case, 15.

 

Lastly, the data shown is already url-encoded. The = sign should be left as-is since it's part of the data return scheme. So the response example is exactly correct except for the content-length.

 

E.g. If your key generated from the PIN is 12345 then content-length is 9 and return the string:

 

key=12345

 

Hope that helps.

 

Developer
Posts: 26
Registered: ‎10-29-2009
My Device: Not Specified

Re: Dynamic License Key test on AppWorld Main Application Data Page

Thanks, that works for me.  I just got it into my head that the request was a GET and not a POST. 

 

I asked elsewhere, but never got a response.  Is the PIN the DeviceInfo.GetDeviceId() value of the device?

 

 

Highlighted
Developer
Posts: 111
Registered: ‎12-16-2008
My Device: Not Specified

Re: Dynamic License Key test on AppWorld Main Application Data Page

Yes, that retreives the PIN number for the device. But be careful in that it returns it in decimal format. There are posts in the Java Development forum outlining how to format it in hex.