SoapCore 错误

问题描述 投票:0回答:2

当我尝试访问我在 .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();
    });
c# asp.net-core .net-core soapcore
2个回答
8
投票

路径似乎区分大小写。抱歉,如果有人像我一样冷漠,请确保在访问您的路线时将其大小写与代码中的大小写相同。


0
投票

重载变量没有默认值。试试这个:

app.UseEndpoints(endpoints =>
    {
        endpoints.UseSoapEndpoint<MyService>("/Service.svc", new BasicHttpBinding(), SoapSerializer.DataContractSerializer,false,null,null,true,true);
        endpoints.MapControllers();
    });
© www.soinside.com 2019 - 2024. All rights reserved.