Yeah still no dice...

Thanks for the suggestion. One minor note is that replacing "\n" does
nothing, but replacing "\r" at least replaces the line feed with
something else. However, replacing "\r" with either "\n" or "\r\n"
yields the same result.

It seems apparent that the problem lies between FLEX and .NET, the
soap packet in the Network monitor [in Flexbuilder] clearly shows
carriage returns of some sort. (both before I did the replace test you
mentioned previously and after, and both with "\n" and "'\r\n")

I pared down the .NET webservice test so it just takes the incoming
request and returns the entire input text as the response, and the
Network monitor shows my response string without carriage returns in
every case.

For time's sake I am going with a hack, replacing the "\n" with
something silly like "|WHEREISMYCARRIAGERETURN|" in FLEX, then
replacing "|WHEREISMYCARRIAGERETURN|" with "\n" in the webservice.

This works just fine (I tested it), with the exception of the shame
heaped upon me like so many burning coals.

I do want to know if anyone else has encountered this, and what they
have done to get around it.



On 4/18/05, Matt Chotin <[EMAIL PROTECTED]> wrote:
>  
>  
> 
> I think that the carriage return that we send from a TextArea is just \n and
> Windows expects it to be \r\n.  What if you try iterating through the string
> and replacing any \n with \r\n and then executing the web service. 
> 
>   
> 
> Var newStr : String = ""; 
> 
> Var sourceStr : String = myTextArea.text; 
> 
> For (var c : Number = 0; c < sourceStr.length; c++) 
> 
> { 
> 
>   Var ch : String = sourceStr.getCharAt(c); 
> 
>   if (ch == '\n') 
> 
>    newStr += '\r'; 
> 
>   newStr += ch; 
> 
> } 
> 
> myService.myOp(newStr); 
> 
>   
> 
> Actually, a more efficient implementation might be: 
> 
>   
> 
> var arr : Array = myTextArea.text.split('\n'); 
> 
> var newStr : String = arr.join("\r\n"); 
> 
> myService.myOp(newStr); 
> 
>   
> 
> Let us know if that helps, 
> 
>   
> 
> Matt 
> 
>   
>  
>  ________________________________
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
>  Sent: Monday, April 18, 2005 12:49 PM
>  To: flexcoders@yahoogroups.com
>  Subject: [flexcoders] carriage return via web service 
> 
>   
> 
> Well I'm stumped. 
>  
>  I am calling a .NET web service that inserts text from a TextArea into
>  the database. When I try the Webservice from a .NET  HTML form, if I
>  have carriage returns in the text it saves them to the database just
>  fine.
>  
>  When I call the webservice from FLEX and I have carriage returns in
>  the text, the character gets dropped. I confirmed the Keycode is
>  correct (ASCII 13), and when I run the Application in flexbuilder and
>  view the network monitor, the SOAP packet seems to have the carriage
>  returns in place.
>  
>  The carriage return seems to be getting lost before the SOAP packet
>  reaches the  web service. I'm wondering if there is something in the
>  underlying JRun application that is removing the character.
>  
>  Has anyone else run into this? I've searched the groups for anything
>  related to "carriage return" or "line feed" and have come up empty.
>  
>  Thanks for any help.
>  
>  
>  ________________________________
>  Yahoo! Groups Links
>  
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to