Hi Alex,
I am going to prepare a PR for the issue including both URLLoader
override and the emulation AbstractOperation.sendBody fix.
I going in to another big issue. Before getting deep I would like to
discuss it with you.
I my application I am using Http Basic Authentication. If you use Basic
Authentication(BA), browser requests username and password with a native
browser windows.
Although I have login window and get the username and password (u/p) via
login window, browser asks when you click the button on the login window.
To prevent the browser to request the u/p until logged out from the
application, I developed some functions sending the u/p through http
requests authentication headers,
and embed the u/p to request and send the info on every call to the
server side.
It is live and working for the flex version.
I did not completely tested and debugged it yet but before getting in, I
want to ask, is there any possibility for Royale to not support this
kind of approach ?
For my first attempts, I have some doubts that the same approach will
not work.
Thanks,
Serkan
17.03.2019 03:35 tarihinde Alex Harui yazdı:
Hi Serkan,
OK, sound like you found the right fix.
Thanks,
-Alex
*From: *Serkan Taş <[email protected]>
*Reply-To: *"[email protected]" <[email protected]>
*Date: *Friday, March 15, 2019 at 11:58 PM
*To: *"[email protected]" <[email protected]>
*Subject: *Re: Work on Emulation
Alex,
In flex, it goes through the first case in if statement, not the
second one : (The flex version send body method is attached)
The parameters variable comes as string to the method. Current
sendBody assumes that the "parameters" is always XML. But if we check
if it is as string than the enters the first case. (emulation of
sendBody is attached)
if (parameters is String && xmlEncode == null)
{
paramsToSend = parameters as String;
} else {
paramsToSend = parameters.toXMLString();
}
Thanks,
Serkan
16.03.2019 09:40 tarihinde Alex Harui yazdı:
Hi Serkan,
That doesn’t make sense to me. Is the same code (before your
proposed changes) in the Flex version of AbstractOperation? If
so, then how does parameters.toXMLString() not throw an exception
in Flex?
-Alex
*From: *Serkan Taş <[email protected]>
<mailto:[email protected]>
*Reply-To: *"[email protected]"
<mailto:[email protected]> <[email protected]>
<mailto:[email protected]>
*Date: *Friday, March 15, 2019 at 11:28 PM
*To: *"[email protected]" <mailto:[email protected]>
<[email protected]> <mailto:[email protected]>
*Subject: *Re: Work on Emulation
Hi Alex,
I checked the flow in debug and can say that there is no
conversion for XML, it is just string and I guess we have to check
it and than use it as string.
If change the AbstractOperation.sendBody as below :
if (ctype == CONTENT_TYPE_XML)
{
if (parameters is String && xmlEncode == null)
{
paramsToSend = parameters as String;
} else {
paramsToSend = parameters.toXMLString();
}
then in js debug :
cid:[email protected]
can see that is passes.
Thanks,
Serkan
15.03.2019 06:55 tarihinde Alex Harui yazdı:
If the Flex version works and in the Flex version a string is
being passed into authAndCall yet in Operation it is XML, we
need to understand where Flex code or the Flash runtime
converted the string back to XML. So you might need to check
again more carefully at the Flex version.
Then we will know where we might want to put similar
conversion code.
Thanks,
-Alex
*From: *Serkan Taş <[email protected]>
<mailto:[email protected]>
*Reply-To: *"[email protected]"
<mailto:[email protected]> <[email protected]>
<mailto:[email protected]>
*Date: *Thursday, March 14, 2019 at 1:55 PM
*To: *"[email protected]"
<mailto:[email protected]> <[email protected]>
<mailto:[email protected]>
*Subject: *Re: Work on Emulation
Alex, I already debugged the flex code and then sent the code
pieces.
Although autheandcall method has parameter as string, the
method loginresulthandler create and xml and passes the xml
string as parameter.
Ant the flex version works as expected.
Tomorrow I will send you the orginal flex debug results of
abstractoperation.sendbody method call.
Note: I ll take care of event casting issue later.
Thanx
Serkan
Android için Outlook
<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C254e7fbf783f4c2ba97d08d6a9dcd691%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636883163301294907&sdata=1CMbK1gCL%2FxRqbKcxbVXBc6Vv1YDkO8elB8dKX94BvQ%3D&reserved=0>'u
edinin
On Thu, Mar 14, 2019 at 11:46 PM +0300, "Alex Harui"
<[email protected] <mailto:[email protected]>> wrote:
Hi Serkan,
In the code you posted, it looks like “authAndCall” has a
“parameter” that is a String. It is not obvious to me how
parameter could be XML. I suggest that debug into that
first before changing any emulation code.
Also, you may have to pay close attention to code like
XML(event.target.data).result. That converts
event.target.data to XML (I hope), but what you get from
the “result” property may not be XML or XMLList as it
might be in Flash so there might need to be another cast
or coercion. Again, debugging into it and comparing
against the Flash version may help.
HTH,
-Alex