c# - InnerChannel = 'webServiceProxy.InnerChannel' 抛出异常
问题描述
我正在尝试为 SSRS 报告使用 WCF 服务。
我试图超过消息大小限制,但它给了我以下例外:
InnerChannel = 'webServiceProxy.InnerChannel' threw an exception of type 'System.ServiceModel.CommunicationObjectFaultedException'
Channel = 'webServiceProxy.Channel' threw an exception of type 'System.ServiceModel.CommunicationObjectFaultedException'
要在服务器端导出以使用 WCF 的代码..
尝试 {
var webServiceProxy = new ReportExecutionServiceSoapClient(wcfEndpointConfigName);
// End Point Name is Coming here,写在 web Config 文件中:basicHttpEndpoint
webServiceProxy.ClientCredentials.Windows.AllowedImpersonationLevel =
System.Security.Principal.TokenImpersonationLevel.Impersonation;
webServiceProxy.ClientCredentials.Windows.ClientCredential = clientCredentials;
// Init Report to execute
ServerInfoHeader serverInfoHeader;
ExecutionInfo executionInfo;
ExecutionHeader executionHeader = webServiceProxy.LoadReport(null, report, null,
out serverInfoHeader, out executionInfo);
// Attach Report Parameters
webServiceProxy.SetExecutionParameters(executionHeader, null, parameters, null, out executionInfo);
// Render
serverInfoHeader =
webServiceProxy.Render(executionHeader, null, GetExportFormatString(format), null,
out output, out extension, out mimeType, out encoding, out warnings,
out streamIds);
}
catch (FaultException e)
{
throw new FaultException(e.Message);
}
网页配置文件
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportExecutionServiceSoap" receiveTimeout="05:00:00"
sendTimeout="05:00:00" allowCookies="true" maxReceivedMessageSize="5242880">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://../ReportServer/ReportExecution2005.asmx"
binding="basicHttpBinding" bindingConfiguration="ReportExecutionServiceSoap"
contract="MyServiceReference.ReportExecutionServiceSoap" name="basicHttpEndpoint" />
</client>
</system.serviceModel>
有人可以指导我在哪里做错了吗?我被困了好几天。
解决方案
推荐阅读
- c# - 可以在控制台应用程序中访问 API,但不能访问 ASP.Net MVC 应用程序
- c# - 如何在 Open XML 中使项目符号变大?
- angular - 使用带有 *ngFor 的 _.groupby() lodash - 对象错误
- javafx - 如何在javafx中按下一个键(ENTER)后选择下一个文本字段?
- highcharts - 在 highcharts 版本 5 中使用 highcharts-more
- python - 从 pandas .value_counts() 获取系列的第一个元素
- vba - 如何使用 VBA 将记录从 rs1 移动到 rs2 (ADODB.Recordsets)?
- javascript - 为什么 fetch 函数说我必须使用绝对 url,即使我设置了代理?
- r - 在多个栅格上绘制多个 shapefile
- c# - 如何在访问数据库与 2 个日期之间进行搜索?