John Saunders said:
First, be really sure that it is actually returning \r\n (don't just look
at
the code - look at what is actually returned). Then, look at the XML that
gets sent to the client. See how that differs from what you expected.
Then, maybe you should write a small set of programs that reproduce the
problem, and post it all here (client, service, wsdl).
Thank for your reply,
I have notice that the problem occurs when I return a string from
Exception.Message.
The web service code:
[WebMethod]
public string ValidateAmount(string amount)
{
string errorMessage;
try
{
if (amount == null)
throw new ArgumentException("Argument cannot be empty",
"Amount");
else
errorMessage = "No Error";
}
catch (Exception ex)
{
errorMessage = ex.Message;
}
return errorMessage;
}
The client code:
string amount = null;
Service1 NewLineService = new Service1();
tbResult.Text = NewLineService.ValidateAmount(amount);