【问题标题】:Exception rendering the result using SSRS in ashx file - Exception: SoapException - The input XML is not well-formed在 ashx 文件中使用 SSRS 呈现结果时出现异常 - 异常:SoapException - 输入 XML 格式不正确
【发布时间】:2014-07-01 22:13:11
【问题描述】:

我正在尝试使用 .WSDL 通过 SQL Server Reporting Services 创建 PDF 报告。

我已按照这两篇文章中的说明进行操作:

http://blog.arvixe.com/creating-pdf-or-any-other-file-type-from-sql-reporting-services-using-wsdl-vs2012-part-2/

http://blog.arvixe.com/creating-pdf-or-any-other-file-type-from-sql-reporting-services-using-wsdl-vs2012-part-2/

我已经了解了调用 rs.Render 的位置,但我收到以下异常: “输入 XML 格式不正确。一个或多个元素缺少结束标签或标签不匹配:根级别的数据无效。第 1 行,位置 1。”

错误消息是有道理的,但我不确定它将引用什么 XML。我一直在寻找解决方案,但似乎找不到遇到此特定问题的任何人...这可能意味着我错过了一些非常简单的东西。

这是我设置所有内容的代码。我已经用 X 替换了密码和我们的服务器名称。最后一行是发生错误的地方。

ReportExecutionService rs = new ReportExecutionService();
            ExecutionInfo execInfo = new ExecutionInfo();
            ExecutionHeader execHeader = new ExecutionHeader();
            string historyId = null, encoding = "";
            string reportPath = "/wismusta/StudentHistory";
            string extension = "";
            string mimeType = "";
            string devInfo = "False";
            Warning[] warning = null;
            string[] streamId = null;
            byte[] result = null;

            rs.Url = "http://XXX.arvixe.com/ReportServer_SQL_Service/ReportExecution2005.asmx?wsdl";

            //add credentials
            rs.Credentials = new NetworkCredential("XXX", "XXX", "XXX.arvixe.com");

            //add parameters
            ParameterValue[] parameters = new ParameterValue[1];
            parameters[0] = new ParameterValue();
            parameters[0].Name = "auditionOrgId";
            parameters[0].Value = "1036";            

            rs.ExecutionHeaderValue = execHeader;
            execInfo = rs.LoadReport(reportPath, historyId);
            rs.SetExecutionParameters(parameters, "en-us");
            result = rs.Render("PDF", devInfo, out extension, out mimeType, out encoding, out warning, out streamId);

有没有人以前见过这种情况或对解决方案有任何想法?

谢谢!

【问题讨论】:

    标签: c# xml reporting-services wsdl


    【解决方案1】:

    我遇到了同样的问题,并通过将null 传递给rs.Render() 中的devInfo 参数来解决它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-03
      • 1970-01-01
      • 2014-09-21
      • 1970-01-01
      相关资源
      最近更新 更多