Hi All, Hopefully I can explain this one with out mucking this up.;-) I've got to consume a Java webservice (which I know nothing about).
A co-worker gave me the code that mades the Soap request, using a WebRequest (only way we could get .NET to talk to the service successfully). Which works great. So now I get the ResponseStream, which contains the Soap XML (of which is embedded a binary word document). I need to parse the response stream to find where the word document starts and ends, and extract it. So I'm reading the stream with a StreamReader, using Encoding.UTF8. I locate where the word doc starts and stops in the string, and then covert that substring back to a byte[], and save it. but the word doc gets corrupt in the process. Are there any recommendations on how to convert Stream --> String --> SubString --> Byte[] without loosing/corrupting any of the data? If I go Stream --> byte[], and manually locate the word doc ( I physically counted the offset where the doc starts and ends), and then save that sub array, everything works. Obviously, I can't do this in production, but I verified the word doc is not corrupt. Any ideas? Thanks, Dave =================================== This list is hosted by DevelopMentorŪ http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com