RE: Dropping carriage return characters from web service



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.



.



Relevant Pages

  • RE: Soap Response
    ... Try refreshing the proxy. ... Thread-Topic: Soap Response ... webservice as per the following code in the proxy class: ... Public Function process3ParmRequest(ByVal inputHeader As String, ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Dropping carriage return characters from web service
    ... string data in soap response message. ... the SoapHttpClientProtocol(base class of client proxy)'s code, ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: SOAP serialization problem
    ... This exception is thrown by the generated proxy class on ... I've snooped the SOAP response, ... string XmlTest{ ... deserialization, but I've not found any that work. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Pro-gunner tactic of the week
    ... I've read every response you've made in this tread and all I can gather ... You posted the gun control beliefs from wikipedia (which ... Also if I present evidence in my favour you'll simply quote someone from ... DOES NOT support the interpretation. ...
    (talk.politics.guns)
  • Re: Surely someone has come across this problem before........
    ... running the configuration wizard again (probably will get you past this ... Event Type: Error ... see Help and Support Center at ... connectionString, SqlFile sqlFileId, String sqlSignaturePath, ...
    (microsoft.public.sharepoint.windowsservices)