Why are you parsing the raw SOAP?  Why not make a call directly to the web
service using a proxy constructed from the WSDL for the web service?

Once you do that, you should be able to reference the parameter as a string.
Assuming that the doc has been base64 encoded, it should be a relatively
simple task to write the individual bytes out to a disk file.

-Rob

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of dave wanta
Sent: Friday, March 05, 2004 11:44 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] parsing a java webservice


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(r)  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

===================================
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

Reply via email to