9 Replies Latest reply on Aug 28, 2012 6:32 AM by Dave Merchant

    How to use Net.HTTP.request in Reader, not in Acrobat?


      I found that it seemed impossible to use Net.HTTP.request in Reader.


      What I want is to post data to my server when doc, "DidSave", and I've realized it successfully in Acrobat via a method wrapped Net.HTTP.request and running in non-privilleged context via app.trustedFunction.


      But when I copied the same js file into Reader's App javascript folder, and ran the script in Reader. It threw a "NotAllowedError" when I tried to save file. However, if the wrapping method had called from the initialization, not in app, it would run smoothly without any error.


      I checked the api reference and also searched the forums, but unfortunately nothing can explain this.


      Does that means the Net.HTTP.request method can't be used in Reader at app or doc context, even via app.trustedFunction?

      Is there anyone kindly help me out of the mass?


      ---- The Code -----


      myTrustedHTTPTest = app.trustedFunction( function ()


      // start of trusted method
          var requestString = "Hello World!";
          var srcStm = SOAP.streamFromString(requestString);


          console.println("start testing HTTP ...");
          var myTrustedRetn = Net.HTTP.request({
              cVerb: "POST",
              cURL: "",
              oRequest: srcStm
          console.println("end testing HTTP ...");


      // end of trusted method


      return myTrustedRetn;




      doc.setAction("DidSave", "myTrustedHTTPTest();");