客户发现响应内容类型为

客户发现响应内容类型为

本文介绍了客户发现响应内容类型为“",但预期为"text/xml".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试执行我的SSRS报告时收到此错误. 客户发现响应内容类型为'',但预期为"text/xml".
请求失败,响应为空.
VB代码:

I get this error when trying to execute my SSRS reports. Client found response content type of '''', but expected ''text/xml''.
The request failed with an empty response.
VB Code:

Private Sub btnprint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnprint.Click
        'RenderPDF()
        Dim rview As New Microsoft.Reporting.WebForms.ReportViewer()
        Dim apr As New AppSettingsReader()
        rview.ServerReport.ReportServerUrl = New Uri(apr.GetValue("ReportServer", GetType(String)))
        Dim paramList As New System.Collections.Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)()
        paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("@DateServed", RadDatePick.SelectedDate))
        paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("@Location", ddlSch.SelectedValue))
        paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("@MenuType", ddlmenutype.SelectedValue))
        rview.ServerReport.ReportPath = "/ReportFolder/ReportName"
        rview.ServerReport.SetParameters(paramList)
        Dim mimeType As String = Nothing
        Dim encoding As String = Nothing
        Dim extension As String = Nothing
        Dim deviceInfo As String = Nothing
        Dim streamIds As String() = Nothing
        Dim warnings As Microsoft.Reporting.WebForms.Warning() = Nothing
        Dim format As String = "PDF"
        deviceInfo = "<DeviceInfo>" + "<SimplePageHeaders>True</SimplePageHeaders>" + "</DeviceInfo>"
        Dim bytes As Byte() = rview.ServerReport.Render(format, deviceInfo, mimeType, encoding, extension, streamIds, warnings)
        Response.Clear()
        If format = "PDF" Then
            Response.ContentType = "application/pdf"
            Response.AddHeader("Content-disposition", "filename=output.pdf")
        End If
        Response.OutputStream.Write(bytes, 0, bytes.Length)
        Response.OutputStream.Flush()
        Response.OutputStream.Close()
        Response.Flush()
        Response.Close()
    End Sub

推荐答案

SharePoint部署中Reporting Services的服务帐户要求


使用内置帐户的限制适用于Reporting Services的某些部署拓扑,其中包括以SharePoint集成模式运行的报表服务器.以下因素的组合将导致对服务帐户的要求:
* Report Server与包含多台计算机的SharePoint服务器场集成.
*报表服务器和SharePoint管理中心网站在单独的计算机上运行.

在这种情况下,如果Report Server服务在内置帐户(例如NetworkService)下运行,则SharePoint管理中心中的授予数据库访问"选项将无法正常工作.因此,通过SharePoint网站访问任何Reporting Services功能都会导致以下错误:

"连接到报表服务器时发生意外错误.请验证报表服务器是否可用并且已配置为SharePoint集成模式.->服务器无法处理请求.->客户端找到了响应内容类型" text/html; charset = utf-8",但预期为"text.xml" ."

选择以下两种方法之一来避免出现此错误:

*在承载报表服务器的计算机上,继续以NetworkService的身份运行报表服务器服务,并将内置帐户(例如NT_AUTHORITY \ NetworkService)添加到WSS_WPG Windows组.
-或-

*将服务帐户配置为在域用户帐户下运行,如下所示:
1.启动Reporting Services配置工具并连接到报表服务器.
2.在服务帐户"页面上,单击使用其他帐户",输入域用户帐户,然后单击应用".
3.单击"Web服务标识",对于报表服务器",单击新建",键入一个应用程序,然后重新启动报表服务器服务.

Service Account Requirements for Reporting Services in a SharePoint deployment


Restrictions on using built-in accounts apply to some deployment topologies of Reporting Services that include a report server running in SharePoint integrated mode. The following combination of factors will result in service account requirements:
* Report Server is integrated with a SharePoint farm comprising more than one computer.
* The report server and SharePoint Central Administration web site run on separate computers.

In this scenario, if the Report Server service runs under a built-in account such as NetworkService, the Grant database access option in SharePoint Central Administration will not work correctly. Consequently, accessing any Reporting Services feature through a SharePoint site will result in the following error:

"An unexpected error occurred while connecting to the report server. Verify that the report server is available and configured for SharePoint integrated mode. --> Server was unable to process request. --> Client found response content type of ''text/html; charset=utf-8'', but expected ''text.xml''."

Choose either of the following approaches to avoid this error:

*On the computer that hosts the report server, continue to run the Report Server service as NetworkService and add the built-in account, such as NT_AUTHORITY\NetworkService to the WSS_WPG Windows group.

-- Or --

*Configure the service account to run under a domain user account as follows:
1.Start the Reporting Services Configuration tool and connect to the report server.
2.On the Service Account page, click Use another account, enter a domain user account, and click Apply.
3.Click Web Service Identity, for Report Server, click New, type an application Restart the Report Server service.


这篇关于客户发现响应内容类型为“",但预期为"text/xml".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 08:43