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: [email protected] [mailto: [email protected]] On Behalf Of Michael Hansen
Sent: Tuesday, November 29, 2005 10:06 AM
To: [email protected]
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




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