It’s possible that Flex 1.5 does this differently but my guess is that if you’re doing object deserialization (resultFormat=”object” or no resultFormat specified) that this is what will happen.  You’d need to do resultFormat=”xml” and your own deserialization to maintain the spaces.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Zeljko Pavic
Sent: Friday, May 13, 2005 10:27 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] SOAP response and deserialization to AS object

 

Hi all,

 

I’m running into a snag here and I was wondering if anyone has a workaround.  We’re using .NET webservices to pass an object hierarchy back and forth to flex.  For the most part, this works very well for us – except in the case where we have a string with space characters.  For example:

 

var paramObj = new Object();

paramObj.name = “someName”;

paramObj.value = “ “;   // one or more space characters

 

This gets sent to a .NET webservice with a similarily defined class

 

class myParamObj

{

      public string name;

      public string vale;

 

      // etc…

}

 

Everything gets translated appropriately. 

When we’re sending the object back to Flex via a SOAP response, I can see that we’re preserving the “ “ in the SOAP response shown in the Flex server window but Flex translates this to null.

 

function webService_response( event )

{

      trace( event.result.name );               // outputs: someName

      trace( typeof(event.result.name) );       // outputs: object

      trace( event.result.value );              // outputs: null   < =========

      trace( typeof(event.result.value) );      // outputs: null   < =========

}

 

Is there any way I can preserve the empty space(s) for this variable or am I SOL?  Is this an issue fixed in Flex 1.5?

 

 

 



Yahoo! Groups Links

Reply via email to