Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Client found response content type of '', but expected 'text/xml'

Back to Forum: Tech Off
  • User profile image

    Hello I am trying to render a report with the webservice and Igot that error.

    Hello, I have this problem trying to render to PDF


    ddlFormats.SelectedValue ="PDF"


    private void cargarReporteFromWS()



    //Format format = (Format)ddlFormats.SelectedValue;

    string encoding;

    string mimeType;

    ParameterValue[] parametersUsed;

    Warning[] warnings;

    string[] streamIds;

    rs = new ReportingService();

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

    rs.Url = "http://agamenon:90/reportserver/ReportingServices.asmx";

    byte[] data;

    string path = "/GescomRpts/RPT_MediosDesarrollo";

    data = rs.Render(path, ddlFormats.SelectedValue, null, null, null, null, null, out encoding, out mimeType, out parametersUsed, out warnings, out streamIds);

    FuncionesRS fs = new FuncionesRS() ;

    string extension = fs.GetExtension(mimeType);

    string filename = path + "." + extension;




    Response.AddHeader("Content-disposition","attachment; filename="+filename);




    This the full error page


    Server Error in '/GescomDllo' Application.

    Client found response content type of '', but expected 'text/xml'.
    The request failed with an empty response.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Client found response content type of '', but expected 'text/xml'.
    The request failed with an empty response.

    Source Error:

    Line 1704:        [return: System.Xml.Serialization.XmlElementAttribute("Result", DataType="base64Binary")]
    Line 1705:        public byte[] Render(string Report, string Format, string HistoryID, string DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, string ShowHideToggle, out string Encoding, out string MimeType, out ParameterValue[] ParametersUsed, out Warning[] Warnings, out string[] StreamIds) {
    Line 1706:            object[] results = this.Invoke("Render", new object[] {
    Line 1707:                        Report,
    Line 1708:                        Format,

    Source File: c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gescomdllo\27bee1ac\cdebe31b\App_WebReferences.4i0hyhkt.0.cs    Line: 1706

    Stack Trace:

    [InvalidOperationException: Client found response content type of '', but expected 'text/xml'.
    The request failed with an empty response.]
       System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +533395
       System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
       RSWebService.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds) in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\gescomdllo\27bee1ac\cdebe31b\App_WebReferences.4i0hyhkt.0.cs:1706
       Protected_01_Administradores_rptmediosdesarrollo.cargarReporteFromWS() in c:\Inetpub\wwwroot\GescomDllo\Protected\01_Administradores\rptmediosdesarrollo.aspx.cs:44
       Protected_01_Administradores_rptmediosdesarrollo.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\GescomDllo\Protected\01_Administradores\rptmediosdesarrollo.aspx.cs:23
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

  • User profile image

    On our app, we get this error when the web service takes too long to respond. You could try upping the timeout value.

  • User profile image

    Check the return values of the Render call. Do you get back any data? What encoding and mime type values are returned? What about warnings?
    Analyzing this should lead you to the source of the problem.

  • User profile image

    I changed this line
    rs.Url = "http://agamenon:90/reportserver/ReportingServices.asmx";

    to this

    rs.Url = http://agamenon:90/reportserver/ReportingExecution2005.asmx;  or something like this, I dont remember exactly,  and now it renders the things ok.

  • User profile image

    I changed the url of the webservice to reportexecution.asmx and now it works

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.