ASP.NET MVC upload file to a web service

There was a requirement from the client to upload a file from a mvc page to a web service. The following code is not meant to be complete but it will give you the main idea how to implement an uploder in javascript integrated with the ASP.NET MVC and a SOAP web service.

The cshtml was rendered in this way:

The javascript button handler:

The SOAP web service can be decorated in this way:


And the implementation in C# looks like this:


About Ionut Afloarei

Senior .Net Developer with 14+ years of experience in Microsoft Technologies (, MVC, MSSQL, Entity Framework, Visual Studio, TFS, IIS, Azure Cloud, Microsfot Dynamics).