4 Replies Latest reply on May 8, 2011 3:09 AM by ShAhBoUrA86

    Upgrading to Acrobat X Web service calls slower...

    ShAhBoUrA86

      Hey,

      we made a plug-in button using javascript that takes the current document and sends it to a server using a webservice, the document is divided in chunks and sent to the server in size of 10 mg per chunk.

       

      this plug-in was working great, until the customer demanded that we migrate to acrobat x.

      we ran the same code and hit the wall to something similiar to this problem:

      http://forums.adobe.com/thread/756218?decorator=print&displayFullThread=true

       

      see, we figured out that the time it takes to communicate with the web service became slower depending on the size of the parameter sent to this service.

      when sending a chunk of 10 mega using 9 it took almost 15 sec.

      when sending a chunk of 80 kbyte using x it took almost 15 min.

       

      a sample code is shown below:

       

          var stream = Collab.documentToStream(document);

          var service = Net.SOAP.connect(url);

          var bound = 10485760;

          var documentSize = document.filesize;

          var thermo = app.thermometer;

          thermo.duration = Math.round(documentSize / bound);

          thermo.text = "Sending document to server";

          var counter = 0;

          thermo.begin();

          try {

              var stringReaded;

              var fileName = '';

              var parameter = {

                  soapType: "xsd:string"

              };

              do {

                  thermo.value = counter;

                  stringReaded = stream.read(bound);

                      parameter.jsonPdf = stringReaded;

                      fileName = service.SavePdf(parameter);

                  }

       

                  counter++;

              }

              while (stringReaded.length == bound * 2);

          }

          catch (e) {

              app.alert(e);

          }

       

          thermo.end();