.net - WCF 4 REST - Acquiring the underlying response stream object for writing -


background: using visual studio 2010 online template "wcf rest service template 40(cs)" , works great json based service. i've got working return stream when returning image.

scenario: looking server push & multipart/x-mixed-replace technology replace polling images method using.

the problem: issue facing unable find way underlying response stream rest request, know the template trying abstracting away me, in order implement multipart/x-mixed-replace mechanism need write directly stream , have full control of write client.

any appreciated. server push tech seems cool!

i have returned sorts of things in response, including documents, spreadsheets etc. looks this:

[servicecontract] public class myservice {     [operationcontract]     [webget(uritemplate="{id}")]     public stream getdocuments(int id)     {        weboperationcontext.current.outgoingresponse.contenttype = getcontenttype();        stream result = createtemporarystream();        /* write data in correct format */        return result;      }   } 

you can pretty return format wish. client have able parse stream , extract individual streams response.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -