none
Errors on Licensing RRS feed

  • Question

  • I've been following this guide to add licensing to my app:

    http://blogs.msdn.com/b/officeapps/archive/2012/11/01/creating-and-verifying-licensing-in-a-paid-app-for-office.aspx

    However, I'm getting a couple of errors:

    - On Convert.FromBase64String(decodedURL), I get "Invalid character in a Base-64 string". I'm guessing that's because the HttpUtility.UrlDecode doesn't seem to do anything. What is it supposed to do? And why might it go wrong?

    - VerificationServiceClient client = new VerificationServiceClient() gives me an error: "Could not find default endpoint element that references contract 'VerificationService.IVerificationService' in the ServiceModel client configuration section." Any ideas what I'm doing wrong?

    At the moment I'm just testing the license by reading it in (using StreamReader) from the .TOK file. The TOK string is:

    <r>
      <t
        aid="WA900006056"
        pid="{b9ef8724-0838-4aec-9c64-5cace46452e3}"
        cid="32F3E7FC559F4F49"
        did="{0672BAE9-B41B-48FE-87F1-7F4D3DD3F3B1}"
        ts="30"
        et="Trial"
        ad="2012-01-12T21:58:13Z"
        ed="2012-06-30T21:58:13Z"
        sd="2012-01-12T00:00:00Z"
        te="2012-10-29T02:49:34Z"
        test="true" />
      <d>VNNAnf36IrkyUVZlihQJNdUUZl/YFEfJOeldWBtd3IM=</d>
    </r>

    I also tried it with this one (both copied from different instructional pages and modified the 'pid' setting):

    <r v="1"> <t aid="WA103403563" pid="b9ef8724-0838-4aec-9c64-5cace46452e3" cid="8491CA951DB109E0" ts="1" et="Paid" ad="2012-09-05T09:07:40Z" sd="2012-09-05" te="2012-10-06T07:20:45Z" /> <d>jFHyWsqnl4JFuFHBwX01ZiLGezvk7bt4JHk35wu7wtg=</d> </r>

    Please do let me know if you have any suggestions.

    Friday, November 16, 2012 11:59 AM

Answers

  • Hi iEditor,

    If you read the tok file using streamreader then it won't be encoded in base64 and therefore shows you an error about invalid characters. The token in base64 will look like this:

    PAByAD4APAB0ACAAYQBpAGQAPQAiAFcAQQAxADAAMgA4ADkAOQA1ADYANgAiACAAcABpAGQAPQAiADMAZAAyADgANwAwADcAYQAtAGYAYwBjAGUALQA0ADUAMQA3AC0AYQBjADYAZQAtAGMAYQAwAGEAZABkADYAMwA3ADMAYQBhACIAIABjAGkAZAA9ACIAMgAzAEEANwBFAEIAOABBADQAQwA0ADcARgA1AEEAMgAiACAAdABzAD0AIgAwACIAIABzAGwAPQAiAHQAcgB1AGUAIgAgAGUAdAA9ACIARgByAGUAZQAiACAAYQBkAD0AIgAyADAAMQAyAC0AMAA1AC0AMgAyAFQAMQA4ADoAMQAyADoAMgAzAFoAIgAgAHMAZAA9ACIAMgAwADEAMgAtADAANQAtADIAMgAiACAAdABlAD0AIgAyADAANgA3AC0AMAAyAC0AMgAzAFQAMQA4ADoAMQA0ADoAMAAwAFoAIgAgAC8APgA8AGQAPgAyADIAWABLAEEAdgA0ADMAQgBtAHMAcwByADAAcgBxADUANQBGAHUAdgBpAFUAVgBSAGkAVgBLAFMASQBEAGcAeAAyAHAAMgA0AFoAZwBzAGwANgBNAD0APAAvAGQAPgA8AC8AcgA%2bAA%3d%3d

    If you follow the article further to the full MSDN Article on how to add licensing then you will see how to retrieve the token for your app via the "et" parameter using HTTP Get from the Querystring. This will return the token from your tok file in base64 encoding and then it should correctly decode it for you.

    I hope this helps.

    Regards,
    Philip

    Wednesday, November 28, 2012 10:43 PM
    Moderator

All replies

  • Hi iEditor,

    Thanks for posting in the MSDN Forum.

    Would you please change aid for the seconde file and try it again?

    Have a goo day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 19, 2012 5:55 AM
    Moderator
  • Hi Tom,

    Thanks for this. But how do I get an Asset ID? Is it assigned when I submit the app? If so, how am I supposed to test it before submission?

    Monday, November 26, 2012 11:13 AM
  • Hi iEditor,

    If you read the tok file using streamreader then it won't be encoded in base64 and therefore shows you an error about invalid characters. The token in base64 will look like this:

    PAByAD4APAB0ACAAYQBpAGQAPQAiAFcAQQAxADAAMgA4ADkAOQA1ADYANgAiACAAcABpAGQAPQAiADMAZAAyADgANwAwADcAYQAtAGYAYwBjAGUALQA0ADUAMQA3AC0AYQBjADYAZQAtAGMAYQAwAGEAZABkADYAMwA3ADMAYQBhACIAIABjAGkAZAA9ACIAMgAzAEEANwBFAEIAOABBADQAQwA0ADcARgA1AEEAMgAiACAAdABzAD0AIgAwACIAIABzAGwAPQAiAHQAcgB1AGUAIgAgAGUAdAA9ACIARgByAGUAZQAiACAAYQBkAD0AIgAyADAAMQAyAC0AMAA1AC0AMgAyAFQAMQA4ADoAMQAyADoAMgAzAFoAIgAgAHMAZAA9ACIAMgAwADEAMgAtADAANQAtADIAMgAiACAAdABlAD0AIgAyADAANgA3AC0AMAAyAC0AMgAzAFQAMQA4ADoAMQA0ADoAMAAwAFoAIgAgAC8APgA8AGQAPgAyADIAWABLAEEAdgA0ADMAQgBtAHMAcwByADAAcgBxADUANQBGAHUAdgBpAFUAVgBSAGkAVgBLAFMASQBEAGcAeAAyAHAAMgA0AFoAZwBzAGwANgBNAD0APAAvAGQAPgA8AC8AcgA%2bAA%3d%3d

    If you follow the article further to the full MSDN Article on how to add licensing then you will see how to retrieve the token for your app via the "et" parameter using HTTP Get from the Querystring. This will return the token from your tok file in base64 encoding and then it should correctly decode it for you.

    I hope this helps.

    Regards,
    Philip

    Wednesday, November 28, 2012 10:43 PM
    Moderator