C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Wednesday, December 31, 2014

Limitations with hosting WCF Service on Visual Studio Development Server

Scenario
For uploading large files using WCF service, Microsoft recommends to use Stream objects and implement streamed transfer mode. We created a sample POC using
Message Contracts passing streams and writing a stream to a folder. We also created a Sample Console application to consume the WCF service and to write large files
to a folder. Both WCF service and Sample Console application were part of a single solution file.

Issue
We started the WCF service over the Visual Studio Development Server and then run the console application to test the WCF service. We repeatedly got the
following error:
The remote server returned an error: (400) Bad Request
We checked all the configurations in both Client and Service and everything was fine.  One major limitation was we were not able to debug the service, since it was
not hitting the breakpoint.

Resolution
We then hosted the WCF service on IIS and the service started working. We were able to debug the code and the functionality worked as expected.

The recommendation would be to always host WCF service on IIS, since there are some limitations while hosting it on File-System. When the WCF service is hosted
on File-System, we were unable to debug the code, even if we attach the process.  We were spending a lot of time in analysis and debugging even when there
was no issue.

No comments:

Post a Comment