【发布时间】:2022-01-22 04:41:27
【问题描述】:
为了获取报告,我们将数据从我们的主项目发送到报告服务。 主项目是用.net 3.1开发的。服务类型:WCF。要使用该服务,我们将其作为服务引用添加到项目中。我们可以使用服务的子方法如下。
WebService1SoapClient service = new WebService1SoapClient(WebService1SoapClient.EndpointConfiguration.WebService1);
var serviceOutput = await service.ReportsAsync(modelService);
当我在本地运行程序并想要得到报告时,我可以得到一个没有任何错误的报告。但是当我尝试在服务器端运行它时,出现以下错误。你能帮帮我吗?
System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://xxx.xxx.com/WebService1.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
web.config 文件中的端点
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ReportServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="ReportServiceBinding" maxReceivedMessageSize="4194304" transferMode="Streamed">
<readerQuotas maxArrayLength="4194304" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ReportServiceBehavior" name="[ProjectName].ReportPages.ReportService1">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="ReportServiceBinding" contract="DevExpress.XtraReports.Service.IReportService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
【问题讨论】:
标签: asp.net-core wcf endpoint