0 Replies Latest reply on Feb 1, 2009 10:37 AM by wildcathoya

    Asynchronous web service call doesn't work

    wildcathoya Level 1

      I'm trying to convert a synchronous web service call into an asynchronous call. (Folder-level Javascript, Acrobat Professional 8.1, Windows XP).

      Everything works fine when I call Soap.Request as a synchronous call. It calls the web service and gets the expected result. However, when I try to convert Soap.Request into an asynchronous call by adding the OAsync property, as described on pp. 198-199 of "Developing Acrobat Applications Using JavaScript," NONE of the various OAsync functions (i.e. result, response, wait) are ever called. IOW, the Javascript code continues executing after the Soap.Request call and doesn't wait for my web service call to return. Indeed, the web service method on the server doesn't even BEGIN to execute by the time the Javascript code runs to completion. (I can confirm this by watching my ASP.Net code execute in the Visual Studio debugger. In fact, the Javascript code runs to completion even before the Global.asax Session_Start code begins to execute, much less the web service method itself.) So, the problem is not with the web service, which works fine when Soap.Request is called as a synchronous method.

      To reiterate, my Javascript code is identical to the code on pp. 198-199 of "Developing Acrobat Applications Using JavaScript." In troubleshooting this, I've tried calling the OAsync functions (mySync.wait(), mySync.result(), mySync.response()) after calling the Soap.Request, but nothing works.

      Is there something else that I must add to my Javascript code (e.g. an additional Soap.Request property, or something after calling Soap.Request) to force the Javascript to wait until the web service method returns?