WCF FileStreams

C

CsaaGuy

Sorry for the cross post but his group is far more active. I have a
need to pass mutiple file streams in WCF Is this possible? I can do
this as a regular web service. Simply pass a FileStream[] filled with
file streams. But don't how to do this with WCF

thanks
 
B

bruce barker

you can't do it with a webservice either. file streams are not serializable,
so can not be sent over either service.

you need to create you own file stream objects that are. just serialize the
context info (filename, current offset), then when the client does a read
from the stream, your stream object makes a call back to the server to get
another block of data. on the server side, open the file, seek to the offset,
then return a block of data, then close the file.

-- bruce (sqlwork.com)
 
C

CsaaGuy

you can't do it with a webservice either. file streams are not serializable,
so can not be sent over either service.

you need to create you own file stream objects that are. just serialize the
context info (filename, current offset), then when the client does a read
from the stream, your stream object makes a call back to the server to get
another block of data. on the server side, open the file, seek to the offset,
then return a block of data, then close the file.

-- bruce (sqlwork.com)



CsaaGuy said:
Sorry for the cross post but his group is far more active. I have a
need to pass mutiple file streams in WCF Is this possible? I can do
this as a regular web service. Simply pass a FileStream[] filled with
file streams. But don't how to do this with WCF
thanks- Hide quoted text -

- Show quoted text -

Thats a bummer, i was able to do it when it was in the same solution
with different projects so i was hoping it could be done.
 
A

Alvin Bruney [ASP.NET MVP]

How did you get it to work even in the same solution? How did it serialize
as a webservice?

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------



you can't do it with a webservice either. file streams are not
serializable,
so can not be sent over either service.

you need to create you own file stream objects that are. just serialize
the
context info (filename, current offset), then when the client does a read
from the stream, your stream object makes a call back to the server to get
another block of data. on the server side, open the file, seek to the
offset,
then return a block of data, then close the file.

-- bruce (sqlwork.com)



CsaaGuy said:
Sorry for the cross post but his group is far more active. I have a
need to pass mutiple file streams in WCF Is this possible? I can do
this as a regular web service. Simply pass a FileStream[] filled with
file streams. But don't how to do this with WCF
thanks- Hide quoted text -

- Show quoted text -

Thats a bummer, i was able to do it when it was in the same solution
with different projects so i was hoping it could be done.
 
C

CsaaGuy

I'm not an expert with c# or wcf but I smply created an arry of
filestreams and passed them. It worked fine. I have since tried
different projects and run into issues. I am now getting an error
saying timeouts are not supported in this stream.I have a co-worked
who claimns he is passing a stream with Message header and Message
body but he can only do one at a time.

How did you get it to work even in the same solution? How did it serialize
as a webservice?

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively onwww.lulu.com/owc$19.99
-------------------------------------------------------


you can't do it with a webservice either. file streams are not
serializable,
so can not be sent over either service.
you need to create you own file stream objects that are. just serialize
the
context info (filename, current offset), then when the client does a read
from the stream, your stream object makes a call back to the server to get
another block of data. on the server side, open the file, seek to the
offset,
then return a block of data, then close the file.
-- bruce (sqlwork.com)
CsaaGuy said:
Sorry for the cross post but his group is far more active. I have a
need to pass mutiple file streams in WCF Is this possible? I can do
this as a regular web service. Simply pass a FileStream[] filled with
file streams. But don't how to do this with WCF
thanks- Hide quoted text -
- Show quoted text -

Thats a bummer, i was able to do it when it was in the same solution
with different projects so i was hoping it could be done.- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top