Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Are web method calls synchronous (not counting result/fault handlers)?

Explorer ,
Jan 15, 2014 Jan 15, 2014

Take the following code:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="ws.loadWSDL('someWSDL');">

    <mx:Script>

        <![CDATA[

            private function onLoad():void

            {

                ws.WebMethodCall("msg");

                navigateToURL(new URLRequest("someURL"), "_self");

            }

        ]]>

    </mx:Script>

    <mx:WebService id="ws" load="onLoad()">

        <mx:operation name="WebMethodCall"/>

    </mx:WebService>

</mx:Application>

Will ws.WebMethodCall("msg"); definitely fully transmit the method call to the server before the next line is entered into?  I know that the server may take time to process the call and try to resond, but that's not what I'm talking about.  Will the call definitely be transmitted to the server, as in a ball being thrown from one person to another in a game of catch, before the next line of code is entered into and executed?  Is there any chance whatsoever that navigateToURL may provoke a fault?  Thank you.

TOPICS
ActionScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 15, 2014 Jan 15, 2014

you cannot rely on the server receiving anything from flash before (or after) navigateToURL causes your browser to redirect. 

and sinious is correct: if you want to ensure that the server receives the call before your redirect use a listener for confirmation that the server received the call before executing navigateToURL.

Translate
Community Expert ,
Jan 15, 2014 Jan 15, 2014

that line of code will execute but the server will not receive the call before the navigateToURL executes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2014 Jan 15, 2014

So this could provoke a fault?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2014 Jan 15, 2014

there's no way for anyone reading your post to determine what your call is doing and how that's related to your navigateToURL or anything else. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2014 Jan 15, 2014

I just wanted to make sure you were saying that, even without networking issues, the server won't necessarily receive the call before the page redirects and kills the client script.  I mean, I'm pretty sure that's what you're saying, but I just wanted to confirm.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2014 Jan 15, 2014

you cannot rely on the server receiving anything from flash before (or after) navigateToURL causes your browser to redirect. 

and sinious is correct: if you want to ensure that the server receives the call before your redirect use a listener for confirmation that the server received the call before executing navigateToURL.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2014 Jan 15, 2014

Awesome, thanks, y'all.  There had been a little bit of misunderstanding with the API sometime ago, and we were having to split hairs at the office over it.  It was hard to find this in the documentation or bytecode or anything though.  Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 15, 2014 Jan 15, 2014
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 15, 2014 Jan 15, 2014

It is asynchronous for a multitude of reasons. To be sure, just do what you know. Assign a result handler and only when the server responds will you know it received the request so you can fire off your navigateToURL().

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines