RE: Dropping carriage return characters from web service
- From: rgliane <TopcoDev1@xxxxxxxxxxxxx>
- Date: Wed, 21 Feb 2007 15:43:18 -0800
Using a byte array is what I came up with also before my re-post of the
question. It works...I'm just surprised that the proxy was written to drop
the character. I could possibly understand if it was written for a UNIX
system where the LF is sufficient to designate EOL but the proxy code is
specifically for Windows. Weird...
Is there any way to configure the proxy creation so that it stops doing
this? Or if not now, can this be an enhancement request?
"Steven Cheng[MSFT]" wrote:
Hello Rgliane,.
Regarding on the CR(X0D) LF(x0A) characters issue, it is actually due to
the response conversion(in the client proxy's internal code) against the
string data in soap response message. Based on my tracing, both the 0D
and 0A chars are correctly sent back to the client-side, however, it is in
the SoapHttpClientProtocol(base class of client proxy)'s code, when it read
the content from the response stream, for string value, it will filtered
the "0A" char. I haven't got the exact code logic, based on reflector's
diassembled code, it is during the "ReadResponse" method.
So far I think for string type parameter or return value, it will force
this normalizing rules on the control character, if you do need to get the
exact character list, I suggest you consider transfer the string as byte
array (encoding it before transfer and decode it after received). e.g.
=========================
[WebMethod]
public byte[] GetBinaryData()
{
string str = string.Empty;
str = "abc\r\n";
return Encoding.Unicode.GetBytes(str);
}
=====================
=======client code==========
byte[] bytes = proxy.GetBinaryData();
string str = Encoding.Unicode.GetString(bytes);
Console.WriteLine(str.Length);
=====================
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- Follow-Ups:
- RE: Dropping carriage return characters from web service
- From: Steven Cheng[MSFT]
- RE: Dropping carriage return characters from web service
- References:
- RE: Dropping carriage return characters from web service
- From: Steven Cheng[MSFT]
- RE: Dropping carriage return characters from web service
- Prev by Date: Err svcutil.exe - Cannot obtain Metadata from http://localhost...
- Next by Date: Re: MSDiscoCodegenerator Failure with Java Axis
- Previous by thread: RE: Dropping carriage return characters from web service
- Next by thread: RE: Dropping carriage return characters from web service
- Index(es):
Relevant Pages
|