[WebMethod()] public void GetFileByDocumentNumber(string DocumentNumber) { string FilePath = GetFile(DocumentNumber); string FullPath = ConfigurationManager.AppSettings["FilePath"] + FilePath; DownloadToBrowser(FullPath); } private void DownloadToBrowser(string filePath) { FileInfo file = new FileInfo(filePath); Context.Response.Clear(); Context.Response.ClearHeaders(); Context.Response.ClearContent(); Context.Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name); Context.Response.AddHeader("Content-Length", file.Length.ToString()); Context.Response.ContentType = "text/plain"; Context.Response.Flush(); Context.Response.TransmitFile(file.FullName); Context.Response.End(); } I'm using above code for my web service in order to download a file from the server.it's working fine in the local machine but when i host my webservice on a server and try to consume the service it gives the following error
Client found response content type of 'text/plain', but expected 'text/xml'. whats the reason for this error?