Modify soap extension message

I am using .Net web services in client side. The wsdl which is created in Java at server side. I have multiline text box which is having multiline string. When it is sent to server the text string value with carriage return character "\r\n" (i.e test \r\n test) is sent. When it returns back, means the soap response is (i.e test \n test). "\r" stripping when it receives. so the multiline textbox display with square box character for carriage return. Basically windows communicates "\r\n", unix communicates "\n". This is my problem.

I can't nothing to do with server side. I want to modify the soap extension in client side with replacing the "\n" character with "\r\n". So i created soap extension and tried some sample code to modify the soap message stream. It is not working for me. So please post sample code to modify the soapmessage using soapextension.Once read the stream and i will get the xml string. I want to modify the xml string which contains "\n". I don't want to modify using xml serializer or using xmldocument and loop through the elements and modify it.

Below is sample code i tried

newStream.Position = 0;

TextReader textReader = new StreamReader(newStream);

string xml = textReader.ReadToEnd();

xml = xml.Replace("\n","\r\n");

Please anyone help this.




Answer this question

Modify soap extension message