简体   繁体   中英

Exception rendering the result using SSRS in ashx file - Exception: SoapException - The input XML is not well-formed

I am trying to create PDF report through SQL Server Reporting Services using .WSDL.

I have followed the instructions in these two articles:

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/

I have gotten down to where rs.Render is called, but I am receiving the following exception: "The input XML is not well-formed. One or more elements is missing a closing tag or has mismatched tags: Data at the root level is invalid. Line 1, position 1."

The error message makes sense, but I'm not sure what XML it would be referencing. I have searched for solutions, but I can't seem to find anyone who has had this particular problem...which probably means I'm missing something really simple.

Here is my code that sets everything up. I have replaced passwords and our server name with X's. The last line is where the error occurs.

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);

Has anyone seen this before or have any ideas for a solution?

Thank you!

我遇到了同样的问题,并将null传递给rs.Render() devInfo参数来rs.Render()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM