Well if .NET returned the data with &lt; and &gt; Flex won’t do anything to decode it.  You’ll need to go through and replace the entities with <  and > (maybe the RegEx classes can help speed that up) and then go ahead and do new XML passing in that string to get it parsed.

 

So going with a custom decoder might be the thing to do here.  In the next build the decoder might be better documented for you to create some stuff on your own to get it working.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Wednesday, November 30, 2005 6:55 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex2 :: XML-RPC (char replacement nuisance)

 

Nested CDATA is not allowed!?  What crackhead wrote that spec?

 

Weird dude, I connected to SOAP with Flash no problem back in MX, and MX 2004.  I know both had different classes, but... I never actually tried a .NET XML-RPC, but I did try a LiveJournal one.  Not sure what theirs is written in, but I'd get the XML back correctly, whether I was using my own custom parsing, or Central's built-in support.

 

I fail to see why Flex can't handle it; hopefully Matt'll catch this on the next run through.

 

----- Original Message -----

Sent: Wednesday, November 30, 2005 8:28 AM

Subject: Re: [flexcoders] Flex2 :: XML-RPC (char replacement nuisance)

 

Hey Jesse,

The XMLRPC already contains CDATA, and nested CDATA is not allowed.

Also this is what the specs have to say:

  • What characters are allowed in strings? Non-printable characters? Null characters? Can a "string" be used to hold an arbitrary chunk of binary data?

Any characters are allowed in a string except < and &, which are encoded as &lt; and &amp;. A string can be used to encode binary data.

( http://www.xmlrpc.com/spec)

So i guess the question is, how do one return a xml-type in a XmlRPC reply?

Thanks for your time, and suggetion Jesse!

Cheers

 -michael

On 11/30/05, JesterXL <[EMAIL PROTECTED]> wrote:

All jacked character data is supposed to use CDATA, like so:

 

<string><![CDATA[&lt;tag&gt;testing&lt;/tag&gt;]]></string>

 

Like the script tag in Flex.  Is there not a way to intercept .NET's response and wrap it?


 

 

----- Original Message -----

Sent: Tuesday, November 29, 2005 6:01 PM

Subject: Re: [flexcoders] Flex2 :: XML-RPC (char replacement nuisance)

 

Thanks for the reply Matt,

I got a hold on what's going on.

When sending a RPC request to the .net, it replies something like the following:

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <string>[HERE BE THE REPLY/PAYLOAD]</string>
      </value>
    </param>
  </params>
</methodResponse>

Now because .net regards what is inbetween <string></string> as a 'payload' wrapped in a RPC protocol, the data inside these tags cannot have chars like '<',and '>', since this would potentially invalidate the xml structure of the reply as a whole. Therefore whatever is between <string></string> is html-encoded, e.g. < translated to &lt;

Example:

If the service was to return a xml dodument like

<tag>testing</tag>

the reply from the service would be:

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <string>&lt;tag&gt;testing&lt;/tag&gt;</string>
      </value>
    </param>
  </params>
</methodResponse>

which is decoded by flex to a string (Flex correctly interprets the data received as 'raw' data as has no other choice) and _not_ a xml document. Therefore the data is not passed, and the Object tree is not created.

I guess other rpc services do not html-encode the 'payload'?? Flickr(PHP??) seems to work just fine... Is Microsoft right in doing this encoding?

Anybody out there a genius on RPC??  (less may also do it :)

Cheers

 -michael


PS. The linefeeds are definetly not the problem in this case. There's only one type (CRLF), and tests show that this works just fine. :)


On 11/29/05, Matt Chotin <[EMAIL PROTECTED]> wrote:

Probably less people are testing against .NET right now.  We do have tests that did pass but we've also seen some issues with the player (well also the compiler).  The issue that we had internally was one of line-endings where the XML was mixed in using Windows line endings (CRLF or \r\n) and Unix (LF or \n).  Any way of checking how the service is coming back (I'd assume since it's .NET that it's CRLF)?

 

Matt 

 


From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Michael Hansen
Sent: Tuesday, November 29, 2005 10:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex2 :: XML-RPC (char replacement nuisance)

 

Hi list,

I'm doing some Xml RPC to .net backend, and having problems with char replacements.

I call the service, and it replies something like:

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;tag&gt;
&lt;/tag&gt;

where e.g., < is replaced by &lt;

As a result flex do _not_ decoding into the desired object-array.

If a do a .aspx page that write the xml to the document stream i receive

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

and all is well.

If a do a .net webservice, the payload (i.e. the result) is also 'char-replaced' and once again flex2 chokes. If I do a .net client that connects to the webservice all is well.

Who's at 'fault' here? and is there a way to fix it without writing a custom xmlDecoder? (either on .net or flex2)

Am I really the only one that have had problems with this or am I stupid (gotta be realistic sometimes :o)

Cheers

  -michael








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



YAHOO! GROUPS LINKS

 

 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com



YAHOO! GROUPS LINKS

 

 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to