当我尝试访问我在 .Net Core 3.0 中创建的服务的 wsdl 页面时,我一直遇到这个问题。请求到达管道的末尾而不执行端点:“SoapCore”。如果使用路由,请使用“IApplicationBuilder.UseEndpoints(...)”注册 EndpointMiddleware。
SoapCore 版本:1.1.0.1-beta 我也尝试了 1.0.0 版本,结果相同
代码:配置服务功能
services.AddControllers();
services.AddSoapCore();
services.TryAddSingleton<MyService>();
services.AddMvc();
配置功能
if (env.IsDevelopment() || env.IsEnvironment("local"))
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.UseSoapEndpoint<MyService>("/Service.svc", new BasicHttpBinding(), SoapSerializer.DataContractSerializer);
endpoints.MapControllers();
});