I've created a WCF Service to upload images. It works fine with images < 50KB or so but I get "The remote server returned an error: (400) Bad Request." with larger images. I've been looking for ages and tried lots of different things, including setting the maxRequestLength and several other settings.
On the client-side of things the web.config is picking it up as a basicHttpBinding and I'm after a wsHttpBinding (for the more up-to-date feature-set). If I manually change the the binding type to wsHttpBinding and change the corresponding options, I get a Unsupported Media Type error. Lookingin the WCF Test Client it shows the service as a basicHttpBinding too.
So my question is two-fold really.
- What do I need to do to allow my service to handle files > 50KB?
- What do I need to change for my service to be recognised as wsHttp instead of basicHttp?
Apologies if there is a question answering these - I have scoured stackoverflow and tried a few suggestions but it is possible I've missed it!
EDIT: As is always the way, I've managed to solve the wsHttpBinding issue now by fiddling around with the service web.config and manually changing the endpoint to wsHttpBinding. Still getting the large upload filesize issue though.
you will need to update your bindings in you web.config
e.g. this is how i did in my wcf restful service. i believe it will be very similar in your case as well