Last post Jan 13, 2012 02:52 AM by a.starreveld
Jan 12, 2012 04:26 AM|a.starreveld|LINK
I'm working on a wcf webservice witch is to be consumed with both php and asp.net clients. There's a requirement that says files need to be transfered by the (aspnet)webservice to (php)clients. By googling I found out there's a ton of ways to transfer files
with a webservice. I'm pretty new to WCF so I don't really know where to start. I need to transfer files up to 0,5mb and i wonder wether I should or should not implement "chunking". Also I wonder what's the best way to transfer data in such a manner that my
webservice remains easy to consume by non-microsoft languages like php.
I'm really curious what approach you guys would choose.
Thanx in advance,
Jan 12, 2012 10:28 AM|atconway|LINK
In order to communicate with non-.NET clients you will need to use the 'basicHttp' binding in WCF for interoperability with PHP. Obviously with .NET clients you could use any binding. As far as streamed vs buffered transfers, for files as small as you mentioned
I would opt for buffered transfers because of ease with interoperability. For example Silverlight clients (if for some reason you ever needed it) can not use the Streaming transport only buffered. Since your files are so small I think a buffered transfer (default)
using a Byte Array as the WCF parameter will work well.
WCF Bindings In Depth:
However the best solution to work with non-.NET client is to use a RESTful service which uses the webHttpBinding in WCF. It in my opinion is tad more difficult to work with when uploading files, but it is possible.
Is it possible to stream data using a WCF based REST service?
RESTful WCF service image upload problem:
Jan 13, 2012 02:52 AM|a.starreveld|LINK
Thanks a lot!
Have a nice day!