2

I've been searching for a quite while now and not found what I'm looking for. I've self hosted a http WCF in a windows application. Now in one of my service's methods I need to receive a file and some form data fields. In similar questions the case is either sending one single file (Which is done by streaming data and then converting it) or they have hosted WCF in an environment that Asp.Net Compatibility can be turned on to access HttpContext and then getting all the needed data from HttpContext.Current. Any Suggestions ?

1 Answers1

1

After a while I found out that someone has already answered my question. for anyone out there facing a similar problem here is the link to the answer :

https://stackoverflow.com/a/14514351/11797674

this approach also uses stream input but not for a single file. It also can manage to get multiple files and form data by key. the sample presented in the answer is a little bit old. I suggest that you check the git repository and follow the sample there. It works like a charm for Http WCF's that are self hosted on a application type that is not web application and Asp.Net Compatibility mode activation is not a option (Since Sessions are different than web application and no http context is saved by the application which WCF is self hosted on)