HTTPService call and result synchronization conflict

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTPService call and result synchronization conflict

Serkan Taş
Hi,

I am debugging HTTPService call in my application.

<s:HTTPService id="treePanelService"
                       method="POST"
                       showBusyCursor="true"
                       resultFormat="e4x"
                       url="{serviceUrl}"
                       result="treePanelService_resultHandler(event)"
                       fault="treePanelService_faultHandler(event)"
                       />



I have 2 break points:
first on server side and
second on client side in
treePanelService_resultHandler.

when execute the application, first stop in server side. When I continue to execution,  means that the response of the server is sent to the client.

The second stop is in the js.




In the js debugger, the treeXml does not contain the service result and it is empty.



At the same time when I check the network view, I can see the that the service response is not in the network view :


After running from the second break point, I can see in network view that result is printed on response tab.



Call stack at the break :



As a result, I am wondering the sequence of the service flow is not working as I assume.

May be the service result handler is executed before the data is received from the server side.

I am trying to simplify the scenario to open a case but not sure how to do it without opening real application to the ones interested.

Need your advises.

Thanks,
Serkan


Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Greg Dove

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg




On Sun, Nov 10, 2019 at 1:25 AM Serkan Taş <[hidden email]> wrote:
Hi,

I am debugging HTTPService call in my application.

<s:HTTPService id="treePanelService"
                       method="POST"
                       showBusyCursor="true"
                       resultFormat="e4x"
                       url="{serviceUrl}"
                       result="treePanelService_resultHandler(event)"
                       fault="treePanelService_faultHandler(event)"
                       />



I have 2 break points:
first on server side and
second on client side in
treePanelService_resultHandler.

when execute the application, first stop in server side. When I continue to execution,  means that the response of the server is sent to the client.

The second stop is in the js.




In the js debugger, the treeXml does not contain the service result and it is empty.



At the same time when I check the network view, I can see the that the service response is not in the network view :


After running from the second break point, I can see in network view that result is printed on response tab.



Call stack at the break :



As a result, I am wondering the sequence of the service flow is not working as I assume.

May be the service result handler is executed before the data is received from the server side.

I am trying to simplify the scenario to open a case but not sure how to do it without opening real application to the ones interested.

Need your advises.

Thanks,
Serkan


Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Serkan Taş
Hi Greg,

I checked the
event.message.body and it is not empty. The value I was expecting from event.result is stored in body.

Can we say that royale is behaves different from flex implementation ?

Should I switch to body rather than result to get the data ?

Thanks,
Serkan

9.11.2019 21:06 tarihinde Greg Dove yazdı:

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg




On Sun, Nov 10, 2019 at 1:25 AM Serkan Taş <[hidden email]> wrote:
Hi,

I am debugging HTTPService call in my application.

<s:HTTPService id="treePanelService"
                       method="POST"
                       showBusyCursor="true"
                       resultFormat="e4x"
                       url="{serviceUrl}"
                       result="treePanelService_resultHandler(event)"
                       fault="treePanelService_faultHandler(event)"
                       />



I have 2 break points:
first on server side and
second on client side in
treePanelService_resultHandler.

when execute the application, first stop in server side. When I continue to execution,  means that the response of the server is sent to the client.

The second stop is in the js.




In the js debugger, the treeXml does not contain the service result and it is empty.



At the same time when I check the network view, I can see the that the service response is not in the network view :


After running from the second break point, I can see in network view that result is printed on response tab.



Call stack at the break :



As a result, I am wondering the sequence of the service flow is not working as I assume.

May be the service result handler is executed before the data is received from the server side.

I am trying to simplify the scenario to open a case but not sure how to do it without opening real application to the ones interested.

Need your advises.

Thanks,
Serkan



Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Serkan Taş
Greg, I added trace and I checked both event.message.body and event.result and both are correct but the structure is different so I missed the values.
first one is XML, trace (event.result);
second : trace (event.message.body);




May be I should check the why the Tree object s not populated correctly with the XML.

            protected function treePanelService_resultHandler(event:ResultEvent):void {
                trace("treePanelService_resultHandler");
                //RO: var treeXml:XML = XML(event.result);
                trace (event.result);
                trace (event.message.body);
                var treeXml:XML = XML(event.message.body);
                var treeOpenItems:Object;
               
                treeOpenItems = liveTree.openItems;
               
                try {
                    liveTreeDP = new XMLList(treeXml);
                    liveTree.validateNow();

                    for each(var item:XML in treeOpenItems) {
                        if(item.name() == "list") {
                            // trace(treeOpenItems);
                            liveTree.expandItem(liveTreeDP[0], true);
                        } else {
                            liveTree.expandItem(liveTreeDP..jobGroup.(@id == item.@id)[0], true);
                        }
                    }
                    liveTree.validateNow();
                } catch(err:Error) {
                    Alert.show(resourceManager.getString("messages", "jobDetailsError") + errorString);
                    trace(err);
                }
               
                setSelectedNode();
            }



Thanks,
Serkan

9.11.2019 23:57 tarihinde Serkan Taş yazdı:
Hi Greg,

I checked the
event.message.body and it is not empty. The value I was expecting from event.result is stored in body.

Can we say that royale is behaves different from flex implementation ?

Should I switch to body rather than result to get the data ?

Thanks,
Serkan

9.11.2019 21:06 tarihinde Greg Dove yazdı:

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg



Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Greg Dove
In reply to this post by Serkan Taş
Hi Serkan, it should behave the same, but  there appears to be an issue with the result format decoding to e4x here. 
Is there any way you can share the exact contents of the  event.message.body ?  (please include any white space, or anything else - the exact contents as a text file, if possible).
I can use that to understand what the issue is, I believe, and hopefully fix it, or let you know what the issue is. If you don't want to share it publicly feel free to send it directly to me.
Adding this as a github issue with the attachment is another good way to let me address this.

Thanks,
Greg
 


On Sun, Nov 10, 2019 at 9:58 AM Serkan Taş <[hidden email]> wrote:
Hi Greg,

I checked the
event.message.body and it is not empty. The value I was expecting from event.result is stored in body.

Can we say that royale is behaves different from flex implementation ?

Should I switch to body rather than result to get the data ?

Thanks,
Serkan

9.11.2019 21:06 tarihinde Greg Dove yazdı:

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg




On Sun, Nov 10, 2019 at 1:25 AM Serkan Taş <[hidden email]> wrote:
Hi,

I am debugging HTTPService call in my application.

<s:HTTPService id="treePanelService"
                       method="POST"
                       showBusyCursor="true"
                       resultFormat="e4x"
                       url="{serviceUrl}"
                       result="treePanelService_resultHandler(event)"
                       fault="treePanelService_faultHandler(event)"
                       />



I have 2 break points:
first on server side and
second on client side in
treePanelService_resultHandler.

when execute the application, first stop in server side. When I continue to execution,  means that the response of the server is sent to the client.

The second stop is in the js.




In the js debugger, the treeXml does not contain the service result and it is empty.



At the same time when I check the network view, I can see the that the service response is not in the network view :


After running from the second break point, I can see in network view that result is printed on response tab.



Call stack at the break :



As a result, I am wondering the sequence of the service flow is not working as I assume.

May be the service result handler is executed before the data is received from the server side.

I am trying to simplify the scenario to open a case but not sure how to do it without opening real application to the ones interested.

Need your advises.

Thanks,
Serkan



Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Greg Dove
In reply to this post by Serkan Taş

Ah ok, got it.
So the event.result is correct, it is just not updating in the Tree?

My guess is that the 
'validateNow()' call on the Tree might not be doing anything. But I have not checked to see if that is the case, so that might be wrong. That is probably a question more for others who have worked more closely on the Tree and emulation compoents recently.



On Sun, Nov 10, 2019 at 10:18 AM Serkan Taş <[hidden email]> wrote:
Greg, I added trace and I checked both event.message.body and event.result and both are correct but the structure is different so I missed the values.
first one is XML, trace (event.result);
second : trace (event.message.body);




May be I should check the why the Tree object s not populated correctly with the XML.

            protected function treePanelService_resultHandler(event:ResultEvent):void {
                trace("treePanelService_resultHandler");
                //RO: var treeXml:XML = XML(event.result);
                trace (event.result);
                trace (event.message.body);
                var treeXml:XML = XML(event.message.body);
                var treeOpenItems:Object;
               
                treeOpenItems = liveTree.openItems;
               
                try {
                    liveTreeDP = new XMLList(treeXml);
                    liveTree.validateNow();

                    for each(var item:XML in treeOpenItems) {
                        if(item.name() == "list") {
                            // trace(treeOpenItems);
                            liveTree.expandItem(liveTreeDP[0], true);
                        } else {
                            liveTree.expandItem(liveTreeDP..jobGroup.(@id == item.@id)[0], true);
                        }
                    }
                    liveTree.validateNow();
                } catch(err:Error) {
                    Alert.show(resourceManager.getString("messages", "jobDetailsError") + errorString);
                    trace(err);
                }
               
                setSelectedNode();
            }



Thanks,
Serkan

9.11.2019 23:57 tarihinde Serkan Taş yazdı:
Hi Greg,

I checked the
event.message.body and it is not empty. The value I was expecting from event.result is stored in body.

Can we say that royale is behaves different from flex implementation ?

Should I switch to body rather than result to get the data ?

Thanks,
Serkan

9.11.2019 21:06 tarihinde Greg Dove yazdı:

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg



Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Serkan Taş
In reply to this post by Greg Dove
Hi Greg,

I just got your mail. I already sent a response about the subject. I was wrong when saying the values are different, sorry.

Take my last mail in to account pls.

Serkan,
Thanks

10.11.2019 00:18 tarihinde Greg Dove yazdı:
Hi Serkan, it should behave the same, but  there appears to be an issue with the result format decoding to e4x here. 
Is there any way you can share the exact contents of the  event.message.body ?  (please include any white space, or anything else - the exact contents as a text file, if possible).
I can use that to understand what the issue is, I believe, and hopefully fix it, or let you know what the issue is. If you don't want to share it publicly feel free to send it directly to me.
Adding this as a github issue with the attachment is another good way to let me address this.

Thanks,
Greg
 


On Sun, Nov 10, 2019 at 9:58 AM Serkan Taş <[hidden email]> wrote:
Hi Greg,

I checked the
event.message.body and it is not empty. The value I was expecting from event.result is stored in body.

Can we say that royale is behaves different from flex implementation ?

Should I switch to body rather than result to get the data ?

Thanks,
Serkan

9.11.2019 21:06 tarihinde Greg Dove yazdı:

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg




On Sun, Nov 10, 2019 at 1:25 AM Serkan Taş <[hidden email]> wrote:
Hi,

I am debugging HTTPService call in my application.

<s:HTTPService id="treePanelService"
                       method="POST"
                       showBusyCursor="true"
                       resultFormat="e4x"
                       url="{serviceUrl}"
                       result="treePanelService_resultHandler(event)"
                       fault="treePanelService_faultHandler(event)"
                       />



I have 2 break points:
first on server side and
second on client side in
treePanelService_resultHandler.

when execute the application, first stop in server side. When I continue to execution,  means that the response of the server is sent to the client.

The second stop is in the js.




In the js debugger, the treeXml does not contain the service result and it is empty.



At the same time when I check the network view, I can see the that the service response is not in the network view :


After running from the second break point, I can see in network view that result is printed on response tab.



Call stack at the break :



As a result, I am wondering the sequence of the service flow is not working as I assume.

May be the service result handler is executed before the data is received from the server side.

I am trying to simplify the scenario to open a case but not sure how to do it without opening real application to the ones interested.

Need your advises.

Thanks,
Serkan




Reply | Threaded
Open this post in threaded view
|

Re: HTTPService call and result synchronization conflict

Serkan Taş
In reply to this post by Greg Dove
Exactly, it is just Tree update problem.

And you are right, in UIComponenet.as

    public function validateNow():void
    {
    }

does nothing :)


Thanks,
Serkan

10.11.2019 00:22 tarihinde Greg Dove yazdı:

Ah ok, got it.
So the event.result is correct, it is just not updating in the Tree?

My guess is that the 
'validateNow()' call on the Tree might not be doing anything. But I have not checked to see if that is the case, so that might be wrong. That is probably a question more for others who have worked more closely on the Tree and emulation compoents recently.



On Sun, Nov 10, 2019 at 10:18 AM Serkan Taş <[hidden email]> wrote:
Greg, I added trace and I checked both event.message.body and event.result and both are correct but the structure is different so I missed the values.
first one is XML, trace (event.result);
second : trace (event.message.body);




May be I should check the why the Tree object s not populated correctly with the XML.

            protected function treePanelService_resultHandler(event:ResultEvent):void {
                trace("treePanelService_resultHandler");
                //RO: var treeXml:XML = XML(event.result);
                trace (event.result);
                trace (event.message.body);
                var treeXml:XML = XML(event.message.body);
                var treeOpenItems:Object;
               
                treeOpenItems = liveTree.openItems;
               
                try {
                    liveTreeDP = new XMLList(treeXml);
                    liveTree.validateNow();

                    for each(var item:XML in treeOpenItems) {
                        if(item.name() == "list") {
                            // trace(treeOpenItems);
                            liveTree.expandItem(liveTreeDP[0], true);
                        } else {
                            liveTree.expandItem(liveTreeDP..jobGroup.(@id == item.@id)[0], true);
                        }
                    }
                    liveTree.validateNow();
                } catch(err:Error) {
                    Alert.show(resourceManager.getString("messages", "jobDetailsError") + errorString);
                    trace(err);
                }
               
                setSelectedNode();
            }



Thanks,
Serkan

9.11.2019 23:57 tarihinde Serkan Taş yazdı:
Hi Greg,

I checked the
event.message.body and it is not empty. The value I was expecting from event.result is stored in body.

Can we say that royale is behaves different from flex implementation ?

Should I switch to body rather than result to get the data ?

Thanks,
Serkan

9.11.2019 21:06 tarihinde Greg Dove yazdı:

Hi Serkan,

Just a quick question. 
I understand that you are confirming that event.result is empty in the result handler. Is event.message.body empty? If it is not, is is possible for you to post that content please.

thanks
Greg