You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by serkan <se...@likyateknoloji.com> on 2020/06/25 06:53:12 UTC

empty object is being behaved as if an xml

Hi,

Regarding the exception :



When the "parameters" is null it is being behaved like an xml node by 
AbstractOperation with the code piece below :

             if (ctype == CONTENT_TYPE_XML)
             {

                 if (parameters is String && xmlEncode == null)
                 {
                     paramsToSend = parameters as String;
                 } else {
                     paramsToSend = parameters.toXMLString();
                 }

In fact Flex version checks if it is XMLNode or not than creates some 
kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to 
empty xml string ? Checking null is not working because it is not null 
in royale bu an empty Array, which is an object according to the code 
below :



Thanks,
Serkan

Re: empty object is being behaved as if an xml

Posted by "serkan@likyateknoloji.com" <se...@likyateknoloji.com>.
Simply no Alex, i do not want rewrite xml classes.

I am going to prepare a fix and create pr than we can discuss on that.

Thanks,
Serkan.

Android için Outlook<https://aka.ms/ghei36>'u edinin

________________________________
From: Alex Harui <ah...@adobe.com>
Sent: Friday, June 26, 2020 11:14:24 AM
To: serkan <se...@likyateknoloji.com>; users@royale.apache.org <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml


I’m out of time for tonight.  I’m still confused because I thought we were discussing handling an empty array but now it appears the array is not empty.



If I understand correctly, you want AbstractOperation to use SimpleXMLEncoder to convert an array of values to XML.  That sounds like a lot of work because it sounds like it would require emulating Flash classes like XMLNode and XMLDocument, so depending on how complex the XML needs to be, I’d recommend a hopefully simpler array to string conversion.



HTH,

-Alex



From: serkan <se...@likyateknoloji.com>
Date: Friday, June 26, 2020 at 12:43 AM
To: Alex Harui <ah...@adobe.com>, "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml



Hi Alex,

26.06.2020 10:10 tarihinde Alex Harui yazdı:

Parameters is null upon entry into AbstractOperation.sendBody?

Yes it is null.


I would think you would get a different exception.  I don’t have a test case to debug, but the code looks like if you call Operation.send() with no args, then sendBody would get an empty array and you would get the exception you posted.

Exactly.




If parameters is null on entry, then it is probably worth figuring out why it is null and not an empty array.

The issue not the "parameters" to be null Alex, flex works with this way.

The signature of method :

    override public function send(... args:Array):AsyncToken

and in this method :

   override public function send(... args:Array):AsyncToken
    {
        if (_multiService != null)
            _multiService.initialize();

        if (operationManager != null)
            return operationManager(args);

        var params:Object;

        var filter:SerializationFilter = getSerializationFilter();
        if (filter != null)
        {
 ===>           params = filter.serializeParameters(this, args);
        }

The marked line creates array for params in both Royale and Flex.

Things changes from here the

sendBody(parameters:Object):AsyncToken

of AbstractOperations of Flex, can handle the new array but Royale can not.

In flex,

        if (ctype == CONTENT_TYPE_XML)
        {
            if (parameters is String && xmlEncode == null)
            {
                paramsToSend = parameters as String;
            }
            else if (!(parameters is XMLNode) && !(parameters is XML))
            {
                if (xmlEncode != null)
                {
                    var funcEncoded:Object = xmlEncode(parameters);
                    if (null == funcEncoded)
                    {
                        token = new AsyncToken(null);
                        msg = resourceManager.getString(
                            "rpc", "xmlEncodeReturnNull");
                        fault = new Fault(ERROR_ENCODING, msg);
                        faultEvent = FaultEvent.createEvent(fault, token);
                        new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
                        return token;
                    }
                    else if (!(funcEncoded is XMLNode))
                    {
                        token = new AsyncToken(null);
                        msg = resourceManager.getString(
                            "rpc", "xmlEncodeReturnNoXMLNode");
                        fault = new Fault(ERROR_ENCODING, msg);
                        faultEvent = FaultEvent.createEvent(fault, token);
                        new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
                        return token;
                    }
                    else
                    {
                        paramsToSend = XMLNode(funcEncoded).toString();
                    }
                }
                else
                {
                    var encoder:SimpleXMLEncoder = new SimpleXMLEncoder(null);
                    var xmlDoc:XMLDocument = new XMLDocument();

                    //right now there is a wasted <encoded> wrapper tag
                    //call.appendChild(encoder.encodeValue(parameters));
                    var childNodes:Array = encoder.encodeValue(parameters, new QName(null, "encoded"), new XMLNode(1, "top")).childNodes.concat();
                    for (var i:int = 0; i < childNodes.length; ++i)
                        xmlDoc.appendChild(childNodes[i]);

      ========>         paramsToSend = xmlDoc.toString();
                }


paramsToSend = xmlDoc.toString(); is return value.

 In royale ;

if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
   ===>             paramsToSend = parameters.toXMLString();
                }

paramsToSend = parameters.toXMLString();    is called which throws exception.

checking parameters for if an empty array and than returning

paramsToSend = parameters as String;

may remove exception.

Thanks,
Serkan




-Alex



From: serkan <se...@likyateknoloji.com>
Date: Thursday, June 25, 2020 at 11:31 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml



Actually "parameters" is null but converted to something in AbstractOperations.

Checking the object if array and size is my first choice, I wanted to discuss if we need different approach .

Than if we agree I can create PR.

Thanks,
Serkan

26.06.2020 09:14 tarihinde Alex Harui yazdı:

It is unlikely that XMLNode is a factor.  More people used e4x than flash.xml.



I’m confused because the screenshots indicate that parameters is not null or an array but rather, some string that begins with “user



Assuming there is no “request” or “argumentNames” property, then it looks like Operation will pass sendBody an empty array as params so maybe check for params is Array and params.length = 0;



HTH,

-Alex



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 12:40 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml



+

The problem is not about "parameters" to be null but the handling of the null valued parameter by Royale.

25.06.2020 20:26 tarihinde serkan yazdı:

If we consider authAndCall of BasicAuthenticationHandler at line 69, send() is called.

  if (parameter == null) {
    return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(), mx.rpc.AsyncToken, true);
  }
  return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter), mx.rpc.AsyncToken, true);

For here, the function being called is "mx.rpc.http.Operation.prototype.send()"

The suspendapp method of menubar :

            private function suspendApp(eventObj:CloseEvent):void {
                if(eventObj.detail == Alert.OK) {
                    suspendAppResult.token = BasicAuthenticationHandler.authAndCall(jobManagerService, "suspendapp");
                }
            }


I can share the sources for com.likya.pinara.utils.BasicAuthenticationHandler and com.likya.pinara.comps.MenuBar if you prefer.

Thanks,
Serkan




25.06.2020 20:14 tarihinde Alex Harui yazdı:

I have no idea where “parameters” came from and what it is.  Which method in the call stack created what is “parameters”?  Maybe suspendApp?  Or authAndCall?



I think we need to understand why Flex has null at some point but Royale doesn’t.



-Alex



From: "serkan@likyateknoloji.com"<ma...@likyateknoloji.com> <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 9:51 AM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml



Which part you want to look Alex ?

Android için Outlook<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C6c0be6f938ad454909c608d819a48fa0%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287541882401178&sdata=NOCpzDgFEZBImjlU5eCNKKbLG%2BD7GUFjD8wk3znnnkA%3D&reserved=0>'u edinin



________________________________

From: Alex Harui <ah...@adobe.com>
Sent: Thursday, June 25, 2020 7:47:13 PM
To: users@royale.apache.org<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml



What does the code look like that calls this?



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml



Hi,

Regarding the exception :

[cid:image001.png@01D64B57.20C3D030]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64B57.20C3D030]

Thanks,
Serkan












Re: empty object is being behaved as if an xml

Posted by Alex Harui <ah...@adobe.com>.
I’m out of time for tonight.  I’m still confused because I thought we were discussing handling an empty array but now it appears the array is not empty.

If I understand correctly, you want AbstractOperation to use SimpleXMLEncoder to convert an array of values to XML.  That sounds like a lot of work because it sounds like it would require emulating Flash classes like XMLNode and XMLDocument, so depending on how complex the XML needs to be, I’d recommend a hopefully simpler array to string conversion.

HTH,
-Alex

From: serkan <se...@likyateknoloji.com>
Date: Friday, June 26, 2020 at 12:43 AM
To: Alex Harui <ah...@adobe.com>, "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml

Hi Alex,
26.06.2020 10:10 tarihinde Alex Harui yazdı:
Parameters is null upon entry into AbstractOperation.sendBody?

Yes it is null.

I would think you would get a different exception.  I don’t have a test case to debug, but the code looks like if you call Operation.send() with no args, then sendBody would get an empty array and you would get the exception you posted.
Exactly.


If parameters is null on entry, then it is probably worth figuring out why it is null and not an empty array.

The issue not the "parameters" to be null Alex, flex works with this way.

The signature of method :

    override public function send(... args:Array):AsyncToken

and in this method :

   override public function send(... args:Array):AsyncToken
    {
        if (_multiService != null)
            _multiService.initialize();

        if (operationManager != null)
            return operationManager(args);

        var params:Object;

        var filter:SerializationFilter = getSerializationFilter();
        if (filter != null)
        {
 ===>           params = filter.serializeParameters(this, args);
        }

The marked line creates array for params in both Royale and Flex.

Things changes from here the

sendBody(parameters:Object):AsyncToken

of AbstractOperations of Flex, can handle the new array but Royale can not.

In flex,

        if (ctype == CONTENT_TYPE_XML)
        {
            if (parameters is String && xmlEncode == null)
            {
                paramsToSend = parameters as String;
            }
            else if (!(parameters is XMLNode) && !(parameters is XML))
            {
                if (xmlEncode != null)
                {
                    var funcEncoded:Object = xmlEncode(parameters);
                    if (null == funcEncoded)
                    {
                        token = new AsyncToken(null);
                        msg = resourceManager.getString(
                            "rpc", "xmlEncodeReturnNull");
                        fault = new Fault(ERROR_ENCODING, msg);
                        faultEvent = FaultEvent.createEvent(fault, token);
                        new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
                        return token;
                    }
                    else if (!(funcEncoded is XMLNode))
                    {
                        token = new AsyncToken(null);
                        msg = resourceManager.getString(
                            "rpc", "xmlEncodeReturnNoXMLNode");
                        fault = new Fault(ERROR_ENCODING, msg);
                        faultEvent = FaultEvent.createEvent(fault, token);
                        new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
                        return token;
                    }
                    else
                    {
                        paramsToSend = XMLNode(funcEncoded).toString();
                    }
                }
                else
                {
                    var encoder:SimpleXMLEncoder = new SimpleXMLEncoder(null);
                    var xmlDoc:XMLDocument = new XMLDocument();

                    //right now there is a wasted <encoded> wrapper tag
                    //call.appendChild(encoder.encodeValue(parameters));
                    var childNodes:Array = encoder.encodeValue(parameters, new QName(null, "encoded"), new XMLNode(1, "top")).childNodes.concat();
                    for (var i:int = 0; i < childNodes.length; ++i)
                        xmlDoc.appendChild(childNodes[i]);

      ========>         paramsToSend = xmlDoc.toString();
                }


paramsToSend = xmlDoc.toString(); is return value.

 In royale ;

if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
   ===>             paramsToSend = parameters.toXMLString();
                }

paramsToSend = parameters.toXMLString();    is called which throws exception.

checking parameters for if an empty array and than returning

paramsToSend = parameters as String;

may remove exception.

Thanks,
Serkan


-Alex

From: serkan <se...@likyateknoloji.com>
Date: Thursday, June 25, 2020 at 11:31 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml

Actually "parameters" is null but converted to something in AbstractOperations.

Checking the object if array and size is my first choice, I wanted to discuss if we need different approach .

Than if we agree I can create PR.

Thanks,
Serkan
26.06.2020 09:14 tarihinde Alex Harui yazdı:
It is unlikely that XMLNode is a factor.  More people used e4x than flash.xml.

I’m confused because the screenshots indicate that parameters is not null or an array but rather, some string that begins with “user

Assuming there is no “request” or “argumentNames” property, then it looks like Operation will pass sendBody an empty array as params so maybe check for params is Array and params.length = 0;

HTH,
-Alex

From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 12:40 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml

+

The problem is not about "parameters" to be null but the handling of the null valued parameter by Royale.
25.06.2020 20:26 tarihinde serkan yazdı:
If we consider authAndCall of BasicAuthenticationHandler at line 69, send() is called.

  if (parameter == null) {
    return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(), mx.rpc.AsyncToken, true);
  }
  return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter), mx.rpc.AsyncToken, true);

For here, the function being called is "mx.rpc.http.Operation.prototype.send()"

The suspendapp method of menubar :

            private function suspendApp(eventObj:CloseEvent):void {
                if(eventObj.detail == Alert.OK) {
                    suspendAppResult.token = BasicAuthenticationHandler.authAndCall(jobManagerService, "suspendapp");
                }
            }


I can share the sources for com.likya.pinara.utils.BasicAuthenticationHandler and com.likya.pinara.comps.MenuBar if you prefer.

Thanks,
Serkan



25.06.2020 20:14 tarihinde Alex Harui yazdı:
I have no idea where “parameters” came from and what it is.  Which method in the call stack created what is “parameters”?  Maybe suspendApp?  Or authAndCall?

I think we need to understand why Flex has null at some point but Royale doesn’t.

-Alex

From: "serkan@likyateknoloji.com"<ma...@likyateknoloji.com> <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 9:51 AM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml

Which part you want to look Alex ?
Android için Outlook<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C6c0be6f938ad454909c608d819a48fa0%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287541882401178&sdata=NOCpzDgFEZBImjlU5eCNKKbLG%2BD7GUFjD8wk3znnnkA%3D&reserved=0>'u edinin

________________________________
From: Alex Harui <ah...@adobe.com>
Sent: Thursday, June 25, 2020 7:47:13 PM
To: users@royale.apache.org<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml


What does the code look like that calls this?



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml



Hi,

Regarding the exception :

[cid:image001.png@01D64B57.20C3D030]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64B57.20C3D030]

Thanks,
Serkan











Re: empty object is being behaved as if an xml

Posted by serkan <se...@likyateknoloji.com>.
Hi Alex,

26.06.2020 10:10 tarihinde Alex Harui yazdı:
>
> Parameters is null upon entry into AbstractOperation.sendBody?
>

Yes it is null.
>
> I would think you would get a different exception.  I don’t have a 
> test case to debug, but the code looks like if you call 
> Operation.send() with no args, then sendBody would get an empty array 
> and you would get the exception you posted.
>
Exactly.
>
> If parameters is null on entry, then it is probably worth figuring out 
> why it is null and not an empty array.
>

The issue not the "parameters" to be null Alex, flex works with this way.

The signature of method :

     override public function send(... args:Array):AsyncToken

and in this method :

   override public function send(... args:Array):AsyncToken
     {
         if (_multiService != null)
             _multiService.initialize();

         if (operationManager != null)
             return operationManager(args);

         var params:Object;

         var filter:SerializationFilter = getSerializationFilter();
         if (filter != null)
         {
  ===>           params = filter.serializeParameters(this, args);
         }

The marked line creates array for params in both Royale and Flex.

Things changes from here the

sendBody(parameters:Object):AsyncToken

of AbstractOperations of Flex, can handle the new array but Royale can not.

In flex,

        if (ctype == CONTENT_TYPE_XML)
         {
             if (parameters is String && xmlEncode == null)
             {
                 paramsToSend = parameters as String;
             }
             else if (!(parameters is XMLNode) && !(parameters is XML))
             {
                 if (xmlEncode != null)
                 {
                     var funcEncoded:Object = xmlEncode(parameters);
                     if (null == funcEncoded)
                     {
                         token = new AsyncToken(null);
                         msg = resourceManager.getString(
                             "rpc", "xmlEncodeReturnNull");
                         fault = new Fault(ERROR_ENCODING, msg);
                         faultEvent = FaultEvent.createEvent(fault, token);
                         new AsyncDispatcher(dispatchRpcEvent, 
[faultEvent], 10);
                         return token;
                     }
                     else if (!(funcEncoded is XMLNode))
                     {
                         token = new AsyncToken(null);
                         msg = resourceManager.getString(
                             "rpc", "xmlEncodeReturnNoXMLNode");
                         fault = new Fault(ERROR_ENCODING, msg);
                         faultEvent = FaultEvent.createEvent(fault, token);
                         new AsyncDispatcher(dispatchRpcEvent, 
[faultEvent], 10);
                         return token;
                     }
                     else
                     {
                         paramsToSend = XMLNode(funcEncoded).toString();
                     }
                 }
                 else
                 {
                     var encoder:SimpleXMLEncoder = new 
SimpleXMLEncoder(null);
                     var xmlDoc:XMLDocument = new XMLDocument();

                     //right now there is a wasted <encoded> wrapper tag
//call.appendChild(encoder.encodeValue(parameters));
                     var childNodes:Array = 
encoder.encodeValue(parameters, new QName(null, "encoded"), new 
XMLNode(1, "top")).childNodes.concat();
                     for (var i:int = 0; i < childNodes.length; ++i)
                         xmlDoc.appendChild(childNodes[i]);

       ========>         paramsToSend = xmlDoc.toString();
                 }


paramsToSend = xmlDoc.toString(); is return value.

  In royale ;

if (ctype == CONTENT_TYPE_XML)
             {

                 if (parameters is String && xmlEncode == null)
                 {
                     paramsToSend = parameters as String;
                 } else {
    ===>             paramsToSend = parameters.toXMLString();
                 }

paramsToSend = parameters.toXMLString();    is called which throws 
exception.

checking parameters for if an empty array and than returning

paramsToSend = parameters as String;

may remove exception.

Thanks,
Serkan
>
> -Alex
>
> *From: *serkan <se...@likyateknoloji.com>
> *Date: *Thursday, June 25, 2020 at 11:31 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>, Alex Harui 
> <ah...@adobe.com>
> *Subject: *Re: empty object is being behaved as if an xml
>
> Actually "parameters" is null but converted to something in 
> AbstractOperations.
>
> Checking the object if array and size is my first choice, I wanted to 
> discuss if we need different approach .
>
> Than if we agree I can create PR.
>
> Thanks,
> Serkan
>
> 26.06.2020 09:14 tarihinde Alex Harui yazdı:
>
>     It is unlikely that XMLNode is a factor.  More people used e4x
>     than flash.xml.
>
>     I’m confused because the screenshots indicate that parameters is
>     not null or an array but rather, some string that begins with “user
>
>     Assuming there is no “request” or “argumentNames” property, then
>     it looks like Operation will pass sendBody an empty array as
>     params so maybe check for params is Array and params.length = 0;
>
>     HTH,
>
>     -Alex
>
>     *From: *serkan <se...@likyateknoloji.com>
>     <ma...@likyateknoloji.com>
>     *Reply-To: *"users@royale.apache.org"
>     <ma...@royale.apache.org> <us...@royale.apache.org>
>     <ma...@royale.apache.org>
>     *Date: *Thursday, June 25, 2020 at 12:40 PM
>     *To: *"users@royale.apache.org" <ma...@royale.apache.org>
>     <us...@royale.apache.org> <ma...@royale.apache.org>, Alex
>     Harui <ah...@adobe.com> <ma...@adobe.com>
>     *Subject: *Re: empty object is being behaved as if an xml
>
>     +
>
>     The problem is not about "parameters" to be null but the handling
>     of the null valued parameter by Royale.
>
>     25.06.2020 20:26 tarihinde serkan yazdı:
>
>         If we consider authAndCall of BasicAuthenticationHandler at
>         line 69, send() is called.
>
>           if (parameter == null) {
>         *return /* implicit cast */
>         org.apache.royale.utils.Language.as(service.operations[operationName].send(),
>         mx.rpc.AsyncToken, true);*
>           }
>           return /* implicit cast */
>         org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter),
>         mx.rpc.AsyncToken, true);
>
>         For here, the function being called is
>         "mx.rpc.http.Operation.prototype.send()"
>
>         The suspendapp method of menubar :
>
>                     private function
>         suspendApp(eventObj:CloseEvent):void {
>                         if(eventObj.detail == Alert.OK) {
>                             suspendAppResult.token =
>         BasicAuthenticationHandler.authAndCall(jobManagerService,
>         "suspendapp");
>                         }
>                     }
>
>
>         I can share the sources for
>         com.likya.pinara.utils.BasicAuthenticationHandler and
>         com.likya.pinara.comps.MenuBar if you prefer.
>
>         Thanks,
>         Serkan
>
>
>         25.06.2020 20:14 tarihinde Alex Harui yazdı:
>
>             I have no idea where “parameters” came from and what it
>             is.  Which method in the call stack created what is
>             “parameters”? Maybe suspendApp?  Or authAndCall?
>
>             I think we need to understand why Flex has null at some
>             point but Royale doesn’t.
>
>             -Alex
>
>             *From: *"serkan@likyateknoloji.com"
>             <ma...@likyateknoloji.com>
>             <se...@likyateknoloji.com> <ma...@likyateknoloji.com>
>             *Reply-To: *"users@royale.apache.org"
>             <ma...@royale.apache.org> <us...@royale.apache.org>
>             <ma...@royale.apache.org>
>             *Date: *Thursday, June 25, 2020 at 9:51 AM
>             *To: *"users@royale.apache.org"
>             <ma...@royale.apache.org> <us...@royale.apache.org>
>             <ma...@royale.apache.org>
>             *Subject: *Re: empty object is being behaved as if an xml
>
>             Which part you want to look Alex ?
>
>             Android için Outlook
>             <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C664d55ec2ef64441c45c08d8199a9797%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287499048223523&sdata=rYJfuVSEvRvVBqD%2FZ6pKfGaNiYwZZ1wa1QcyFxmonhM%3D&reserved=0>'u
>             edinin
>
>             ------------------------------------------------------------------------
>
>             *From:*Alex Harui <ah...@adobe.com> <ma...@adobe.com>
>             *Sent:* Thursday, June 25, 2020 7:47:13 PM
>             *To:* users@royale.apache.org
>             <ma...@royale.apache.org> <us...@royale.apache.org>
>             <ma...@royale.apache.org>
>             *Subject:* Re: empty object is being behaved as if an xml
>
>             What does the code look like that calls this?
>
>             *From: *serkan <se...@likyateknoloji.com>
>             <ma...@likyateknoloji.com>
>             *Reply-To: *"users@royale.apache.org"
>             <ma...@royale.apache.org> <us...@royale.apache.org>
>             <ma...@royale.apache.org>
>             *Date: *Wednesday, June 24, 2020 at 11:53 PM
>             *To: *"users@royale.apache.org"
>             <ma...@royale.apache.org> <us...@royale.apache.org>
>             <ma...@royale.apache.org>
>             *Subject: *empty object is being behaved as if an xml
>
>             Hi,
>
>             Regarding the exception :
>
>
>
>             When the "parameters" is null it is being behaved like an
>             xml node by AbstractOperation with the code piece below :
>
>                         if (ctype == CONTENT_TYPE_XML)
>                         {
>
>                             if (parameters is String && xmlEncode == null)
>                             {
>                                 paramsToSend = parameters as String;
>                             } else {
>                                 paramsToSend = parameters.toXMLString();
>                             }
>
>             In fact Flex version checks if it is XMLNode or not than
>             creates some kind of empty XML "<>"
>
>             How can I check if "parameters" is not an xml string and
>             convert it to empty xml string ? Checking null is not
>             working because it is not null in royale bu an empty
>             Array, which is an object according to the code below :
>
>
>
>             Thanks,
>             Serkan
>
>
>
>
>
>


Re: empty object is being behaved as if an xml

Posted by Alex Harui <ah...@adobe.com>.
Parameters is null upon entry into AbstractOperation.sendBody?  I would think you would get a different exception.  I don’t have a test case to debug, but the code looks like if you call Operation.send() with no args, then sendBody would get an empty array and you would get the exception you posted.

If parameters is null on entry, then it is probably worth figuring out why it is null and not an empty array.

-Alex

From: serkan <se...@likyateknoloji.com>
Date: Thursday, June 25, 2020 at 11:31 PM
To: "users@royale.apache.org" <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml

Actually "parameters" is null but converted to something in AbstractOperations.

Checking the object if array and size is my first choice, I wanted to discuss if we need different approach .

Than if we agree I can create PR.

Thanks,
Serkan
26.06.2020 09:14 tarihinde Alex Harui yazdı:
It is unlikely that XMLNode is a factor.  More people used e4x than flash.xml.

I’m confused because the screenshots indicate that parameters is not null or an array but rather, some string that begins with “user

Assuming there is no “request” or “argumentNames” property, then it looks like Operation will pass sendBody an empty array as params so maybe check for params is Array and params.length = 0;

HTH,
-Alex

From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 12:40 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml

+

The problem is not about "parameters" to be null but the handling of the null valued parameter by Royale.
25.06.2020 20:26 tarihinde serkan yazdı:
If we consider authAndCall of BasicAuthenticationHandler at line 69, send() is called.

  if (parameter == null) {
    return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(), mx.rpc.AsyncToken, true);
  }
  return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter), mx.rpc.AsyncToken, true);

For here, the function being called is "mx.rpc.http.Operation.prototype.send()"

The suspendapp method of menubar :

            private function suspendApp(eventObj:CloseEvent):void {
                if(eventObj.detail == Alert.OK) {
                    suspendAppResult.token = BasicAuthenticationHandler.authAndCall(jobManagerService, "suspendapp");
                }
            }


I can share the sources for com.likya.pinara.utils.BasicAuthenticationHandler and com.likya.pinara.comps.MenuBar if you prefer.

Thanks,
Serkan


25.06.2020 20:14 tarihinde Alex Harui yazdı:
I have no idea where “parameters” came from and what it is.  Which method in the call stack created what is “parameters”?  Maybe suspendApp?  Or authAndCall?

I think we need to understand why Flex has null at some point but Royale doesn’t.

-Alex

From: "serkan@likyateknoloji.com"<ma...@likyateknoloji.com> <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 9:51 AM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml

Which part you want to look Alex ?
Android için Outlook<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C664d55ec2ef64441c45c08d8199a9797%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287499048223523&sdata=rYJfuVSEvRvVBqD%2FZ6pKfGaNiYwZZ1wa1QcyFxmonhM%3D&reserved=0>'u edinin

________________________________
From: Alex Harui <ah...@adobe.com>
Sent: Thursday, June 25, 2020 7:47:13 PM
To: users@royale.apache.org<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml


What does the code look like that calls this?



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml



Hi,

Regarding the exception :

[cid:image001.png@01D64B4E.2A8F6060]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64B4E.2A8F6060]

Thanks,
Serkan







Re: empty object is being behaved as if an xml

Posted by serkan <se...@likyateknoloji.com>.
Actually "parameters" is null but converted to something in 
AbstractOperations.

Checking the object if array and size is my first choice, I wanted to 
discuss if we need different approach .

Than if we agree I can create PR.

Thanks,
Serkan

26.06.2020 09:14 tarihinde Alex Harui yazdı:
>
> It is unlikely that XMLNode is a factor. More people used e4x than 
> flash.xml.
>
> I’m confused because the screenshots indicate that parameters is not 
> null or an array but rather, some string that begins with “user
>
> Assuming there is no “request” or “argumentNames” property, then it 
> looks like Operation will pass sendBody an empty array as params so 
> maybe check for params is Array and params.length = 0;
>
> HTH,
>
> -Alex
>
> *From: *serkan <se...@likyateknoloji.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Thursday, June 25, 2020 at 12:40 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>, Alex Harui 
> <ah...@adobe.com>
> *Subject: *Re: empty object is being behaved as if an xml
>
> +
>
> The problem is not about "parameters" to be null but the handling of 
> the null valued parameter by Royale.
>
> 25.06.2020 20:26 tarihinde serkan yazdı:
>
>     If we consider authAndCall of BasicAuthenticationHandler at line
>     69, send() is called.
>
>       if (parameter == null) {
>     *return /* implicit cast */
>     org.apache.royale.utils.Language.as(service.operations[operationName].send(),
>     mx.rpc.AsyncToken, true);*
>       }
>       return /* implicit cast */
>     org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter),
>     mx.rpc.AsyncToken, true);
>
>     For here, the function being called is
>     "mx.rpc.http.Operation.prototype.send()"
>
>     The suspendapp method of menubar :
>
>                 private function suspendApp(eventObj:CloseEvent):void {
>                     if(eventObj.detail == Alert.OK) {
>                         suspendAppResult.token =
>     BasicAuthenticationHandler.authAndCall(jobManagerService,
>     "suspendapp");
>                     }
>                 }
>
>
>     I can share the sources for
>     com.likya.pinara.utils.BasicAuthenticationHandler and
>     com.likya.pinara.comps.MenuBar if you prefer.
>
>     Thanks,
>     Serkan
>
>     25.06.2020 20:14 tarihinde Alex Harui yazdı:
>
>         I have no idea where “parameters” came from and what it is. 
>         Which method in the call stack created what is “parameters”? 
>         Maybe suspendApp?  Or authAndCall?
>
>         I think we need to understand why Flex has null at some point
>         but Royale doesn’t.
>
>         -Alex
>
>         *From: *"serkan@likyateknoloji.com"
>         <ma...@likyateknoloji.com> <se...@likyateknoloji.com>
>         <ma...@likyateknoloji.com>
>         *Reply-To: *"users@royale.apache.org"
>         <ma...@royale.apache.org> <us...@royale.apache.org>
>         <ma...@royale.apache.org>
>         *Date: *Thursday, June 25, 2020 at 9:51 AM
>         *To: *"users@royale.apache.org"
>         <ma...@royale.apache.org> <us...@royale.apache.org>
>         <ma...@royale.apache.org>
>         *Subject: *Re: empty object is being behaved as if an xml
>
>         Which part you want to look Alex ?
>
>         Android için Outlook
>         <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C51699958d9174889ecee08d8193f8f46%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287108072633214&sdata=uXo7D0H0N4xgGoTdyM9M%2BKuw%2Flngqt5UEh1enskoPIM%3D&reserved=0>'u
>         edinin
>
>         ------------------------------------------------------------------------
>
>         *From:*Alex Harui <ah...@adobe.com> <ma...@adobe.com>
>         *Sent:* Thursday, June 25, 2020 7:47:13 PM
>         *To:* users@royale.apache.org <ma...@royale.apache.org>
>         <us...@royale.apache.org> <ma...@royale.apache.org>
>         *Subject:* Re: empty object is being behaved as if an xml
>
>         What does the code look like that calls this?
>
>         *From: *serkan <se...@likyateknoloji.com>
>         <ma...@likyateknoloji.com>
>         *Reply-To: *"users@royale.apache.org"
>         <ma...@royale.apache.org> <us...@royale.apache.org>
>         <ma...@royale.apache.org>
>         *Date: *Wednesday, June 24, 2020 at 11:53 PM
>         *To: *"users@royale.apache.org"
>         <ma...@royale.apache.org> <us...@royale.apache.org>
>         <ma...@royale.apache.org>
>         *Subject: *empty object is being behaved as if an xml
>
>         Hi,
>
>         Regarding the exception :
>
>
>
>         When the "parameters" is null it is being behaved like an xml
>         node by AbstractOperation with the code piece below :
>
>                     if (ctype == CONTENT_TYPE_XML)
>                     {
>
>                         if (parameters is String && xmlEncode == null)
>                         {
>                             paramsToSend = parameters as String;
>                         } else {
>                             paramsToSend = parameters.toXMLString();
>                         }
>
>         In fact Flex version checks if it is XMLNode or not than
>         creates some kind of empty XML "<>"
>
>         How can I check if "parameters" is not an xml string and
>         convert it to empty xml string ? Checking null is not working
>         because it is not null in royale bu an empty Array, which is
>         an object according to the code below :
>
>
>
>         Thanks,
>         Serkan
>
>
>


Re: empty object is being behaved as if an xml

Posted by Alex Harui <ah...@adobe.com>.
It is unlikely that XMLNode is a factor.  More people used e4x than flash.xml.

I’m confused because the screenshots indicate that parameters is not null or an array but rather, some string that begins with “user

Assuming there is no “request” or “argumentNames” property, then it looks like Operation will pass sendBody an empty array as params so maybe check for params is Array and params.length = 0;

HTH,
-Alex

From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 12:40 PM
To: "users@royale.apache.org" <us...@royale.apache.org>, Alex Harui <ah...@adobe.com>
Subject: Re: empty object is being behaved as if an xml

+

The problem is not about "parameters" to be null but the handling of the null valued parameter by Royale.
25.06.2020 20:26 tarihinde serkan yazdı:
If we consider authAndCall of BasicAuthenticationHandler at line 69, send() is called.

  if (parameter == null) {
    return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(), mx.rpc.AsyncToken, true);
  }
  return /* implicit cast */ org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter), mx.rpc.AsyncToken, true);

For here, the function being called is "mx.rpc.http.Operation.prototype.send()"

The suspendapp method of menubar :

            private function suspendApp(eventObj:CloseEvent):void {
                if(eventObj.detail == Alert.OK) {
                    suspendAppResult.token = BasicAuthenticationHandler.authAndCall(jobManagerService, "suspendapp");
                }
            }


I can share the sources for com.likya.pinara.utils.BasicAuthenticationHandler and com.likya.pinara.comps.MenuBar if you prefer.

Thanks,
Serkan

25.06.2020 20:14 tarihinde Alex Harui yazdı:
I have no idea where “parameters” came from and what it is.  Which method in the call stack created what is “parameters”?  Maybe suspendApp?  Or authAndCall?

I think we need to understand why Flex has null at some point but Royale doesn’t.

-Alex

From: "serkan@likyateknoloji.com"<ma...@likyateknoloji.com> <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 9:51 AM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml

Which part you want to look Alex ?
Android için Outlook<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C51699958d9174889ecee08d8193f8f46%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287108072633214&sdata=uXo7D0H0N4xgGoTdyM9M%2BKuw%2Flngqt5UEh1enskoPIM%3D&reserved=0>'u edinin

________________________________
From: Alex Harui <ah...@adobe.com>
Sent: Thursday, June 25, 2020 7:47:13 PM
To: users@royale.apache.org<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml


What does the code look like that calls this?



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml



Hi,

Regarding the exception :

[cid:image001.png@01D64B46.6474D2E0]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64B46.6474D2E0]

Thanks,
Serkan




Re: empty object is being behaved as if an xml

Posted by serkan <se...@likyateknoloji.com>.
+

The problem is not about "parameters" to be null but the handling of the 
null valued parameter by Royale.

25.06.2020 20:26 tarihinde serkan yazdı:
> If we consider authAndCall of BasicAuthenticationHandler at line 69, 
> send() is called.
>
>   if (parameter == null) {
> *return /* implicit cast */ 
> org.apache.royale.utils.Language.as(service.operations[operationName].send(), 
> mx.rpc.AsyncToken, true);*
>   }
>   return /* implicit cast */ 
> org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter), 
> mx.rpc.AsyncToken, true);
>
> For here, the function being called is 
> "mx.rpc.http.Operation.prototype.send()"
>
> The suspendapp method of menubar :
>
>             private function suspendApp(eventObj:CloseEvent):void {
>                 if(eventObj.detail == Alert.OK) {
>                     suspendAppResult.token = 
> BasicAuthenticationHandler.authAndCall(jobManagerService, "suspendapp");
>                 }
>             }
>
>
> I can share the sources for 
> com.likya.pinara.utils.BasicAuthenticationHandler and 
> com.likya.pinara.comps.MenuBar if you prefer.
>
> Thanks,
> Serkan
>
>
> 25.06.2020 20:14 tarihinde Alex Harui yazdı:
>>
>> I have no idea where “parameters” came from and what it is.  Which 
>> method in the call stack created what is “parameters”?  Maybe 
>> suspendApp?  Or authAndCall?
>>
>> I think we need to understand why Flex has null at some point but 
>> Royale doesn’t.
>>
>> -Alex
>>
>> *From: *"serkan@likyateknoloji.com" <se...@likyateknoloji.com>
>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Date: *Thursday, June 25, 2020 at 9:51 AM
>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Subject: *Re: empty object is being behaved as if an xml
>>
>> Which part you want to look Alex ?
>>
>> Android için Outlook 
>> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C9adde787224c40a2859c08d819280960%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287007035345242&sdata=kXec8lJ%2Fa%2Bjs0PPAS1U0KGBuDId3pyboXFOxDvFKbvA%3D&reserved=0>'u 
>> edinin
>>
>> ------------------------------------------------------------------------
>>
>> *From:*Alex Harui <ah...@adobe.com>
>> *Sent:* Thursday, June 25, 2020 7:47:13 PM
>> *To:* users@royale.apache.org <us...@royale.apache.org>
>> *Subject:* Re: empty object is being behaved as if an xml
>>
>> What does the code look like that calls this?
>>
>> *From: *serkan <se...@likyateknoloji.com>
>> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Date: *Wednesday, June 24, 2020 at 11:53 PM
>> *To: *"users@royale.apache.org" <us...@royale.apache.org>
>> *Subject: *empty object is being behaved as if an xml
>>
>> Hi,
>>
>> Regarding the exception :
>>
>>
>>
>> When the "parameters" is null it is being behaved like an xml node by 
>> AbstractOperation with the code piece below :
>>
>>             if (ctype == CONTENT_TYPE_XML)
>>             {
>>
>>                 if (parameters is String && xmlEncode == null)
>>                 {
>>                     paramsToSend = parameters as String;
>>                 } else {
>>                     paramsToSend = parameters.toXMLString();
>>                 }
>>
>> In fact Flex version checks if it is XMLNode or not than creates some 
>> kind of empty XML "<>"
>>
>> How can I check if "parameters" is not an xml string and convert it 
>> to empty xml string ? Checking null is not working because it is not 
>> null in royale bu an empty Array, which is an object according to the 
>> code below :
>>
>>
>>
>> Thanks,
>> Serkan
>>
>


Re: empty object is being behaved as if an xml

Posted by serkan <se...@likyateknoloji.com>.
If we consider authAndCall of BasicAuthenticationHandler at line 69, 
send() is called.

   if (parameter == null) {
*return /* implicit cast */ 
org.apache.royale.utils.Language.as(service.operations[operationName].send(), 
mx.rpc.AsyncToken, true);*
   }
   return /* implicit cast */ 
org.apache.royale.utils.Language.as(service.operations[operationName].send(parameter), 
mx.rpc.AsyncToken, true);

For here, the function being called is 
"mx.rpc.http.Operation.prototype.send()"

The suspendapp method of menubar :

             private function suspendApp(eventObj:CloseEvent):void {
                 if(eventObj.detail == Alert.OK) {
                     suspendAppResult.token = 
BasicAuthenticationHandler.authAndCall(jobManagerService, "suspendapp");
                 }
             }


I can share the sources for 
com.likya.pinara.utils.BasicAuthenticationHandler and 
com.likya.pinara.comps.MenuBar if you prefer.

Thanks,
Serkan


25.06.2020 20:14 tarihinde Alex Harui yazdı:
>
> I have no idea where “parameters” came from and what it is.  Which 
> method in the call stack created what is “parameters”?  Maybe 
> suspendApp?  Or authAndCall?
>
> I think we need to understand why Flex has null at some point but 
> Royale doesn’t.
>
> -Alex
>
> *From: *"serkan@likyateknoloji.com" <se...@likyateknoloji.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Thursday, June 25, 2020 at 9:51 AM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: empty object is being behaved as if an xml
>
> Which part you want to look Alex ?
>
> Android için Outlook 
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C9adde787224c40a2859c08d819280960%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287007035345242&sdata=kXec8lJ%2Fa%2Bjs0PPAS1U0KGBuDId3pyboXFOxDvFKbvA%3D&reserved=0>'u 
> edinin
>
> ------------------------------------------------------------------------
>
> *From:*Alex Harui <ah...@adobe.com>
> *Sent:* Thursday, June 25, 2020 7:47:13 PM
> *To:* users@royale.apache.org <us...@royale.apache.org>
> *Subject:* Re: empty object is being behaved as if an xml
>
> What does the code look like that calls this?
>
> *From: *serkan <se...@likyateknoloji.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Wednesday, June 24, 2020 at 11:53 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *empty object is being behaved as if an xml
>
> Hi,
>
> Regarding the exception :
>
>
>
> When the "parameters" is null it is being behaved like an xml node by 
> AbstractOperation with the code piece below :
>
>             if (ctype == CONTENT_TYPE_XML)
>             {
>
>                 if (parameters is String && xmlEncode == null)
>                 {
>                     paramsToSend = parameters as String;
>                 } else {
>                     paramsToSend = parameters.toXMLString();
>                 }
>
> In fact Flex version checks if it is XMLNode or not than creates some 
> kind of empty XML "<>"
>
> How can I check if "parameters" is not an xml string and convert it to 
> empty xml string ? Checking null is not working because it is not null 
> in royale bu an empty Array, which is an object according to the code 
> below :
>
>
>
> Thanks,
> Serkan
>


Re: empty object is being behaved as if an xml

Posted by Alex Harui <ah...@adobe.com>.
I have no idea where “parameters” came from and what it is.  Which method in the call stack created what is “parameters”?  Maybe suspendApp?  Or authAndCall?

I think we need to understand why Flex has null at some point but Royale doesn’t.

-Alex

From: "serkan@likyateknoloji.com" <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, June 25, 2020 at 9:51 AM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml

Which part you want to look Alex ?
Android için Outlook<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Faka.ms%2Fghei36&data=02%7C01%7Caharui%40adobe.com%7C9adde787224c40a2859c08d819280960%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287007035345242&sdata=kXec8lJ%2Fa%2Bjs0PPAS1U0KGBuDId3pyboXFOxDvFKbvA%3D&reserved=0>'u edinin

________________________________
From: Alex Harui <ah...@adobe.com>
Sent: Thursday, June 25, 2020 7:47:13 PM
To: users@royale.apache.org <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml


What does the code look like that calls this?



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml



Hi,

Regarding the exception :

[cid:image001.png@01D64AD9.6052B500]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64AD9.6052B500]

Thanks,
Serkan

Re: empty object is being behaved as if an xml

Posted by "serkan@likyateknoloji.com" <se...@likyateknoloji.com>.
Which part you want to look Alex ?

Android için Outlook<https://aka.ms/ghei36>'u edinin

________________________________
From: Alex Harui <ah...@adobe.com>
Sent: Thursday, June 25, 2020 7:47:13 PM
To: users@royale.apache.org <us...@royale.apache.org>
Subject: Re: empty object is being behaved as if an xml


What does the code look like that calls this?



From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml



Hi,

Regarding the exception :

[cid:image001.png@01D64AD5.9A683B60]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64AD5.9A683B60]

Thanks,
Serkan


Re: empty object is being behaved as if an xml

Posted by Alex Harui <ah...@adobe.com>.
What does the code look like that calls this?

From: serkan <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Wednesday, June 24, 2020 at 11:53 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: empty object is being behaved as if an xml

Hi,

Regarding the exception :

[cid:image001.png@01D64AD5.9A683B60]

When the "parameters" is null it is being behaved like an xml node by AbstractOperation with the code piece below :

            if (ctype == CONTENT_TYPE_XML)
            {

                if (parameters is String && xmlEncode == null)
                {
                    paramsToSend = parameters as String;
                } else {
                    paramsToSend = parameters.toXMLString();
                }

In fact Flex version checks if it is XMLNode or not than creates some kind of empty XML "<>"

How can I check if "parameters" is not an xml string and convert it to empty xml string ? Checking null is not working because it is not null in royale bu an empty Array, which is an object according to the code below :

[cid:image002.png@01D64AD5.9A683B60]

Thanks,
Serkan