Assume that the following WebService method is defined:
Code
/// <Summary>
/// Calculate the length
/// </Summary>
/// <Param name = "text"> </param>
/// <Returns> </returns>
[WebMethod]
Public int GetLen (string text)
{
Return text. Length;
}
If the transmitted string text contains the "carriage return newline" character, that is, "\ r \ n", after being transmitted by WebService in C. "\ r" will disappear from the data received by the server !! That is, there are only one byte in "\ r \ n.
This BUG is really depressing today (the length before sending is not the same as the received length, resulting in the final signature mismatch, and the data can only be Base64 to Solve the Problem )...
Note:According to the link given by Wu meibo <active target. Net>, we know that the cause of the character loss is determined by the XML specification. Thank you for choosing :)
Http://xml.coverpages.org/xml10-chinese.html#sec-line-ends
Code
2.11 lines at the end
For the convenience of editing, computer files that store parsed XML objects are often organized in rows. These lines are usually separated by a combination of carriage returns (# xD) and line breaks (# xA.
To simplify the application work, any two-character constant sequence "# xD # xA" or a separate constant # xD, all XML processors should be replaced with # xA and passed to the application. (This can be achieved by standardizing all row separators into # xA before syntax analysis .)