什么是Dotnet Core中基于.ASMX的肥皂的推荐替代方案?

发布于 2025-02-12 06:46:35 字数 398 浏览 1 评论 0原文

我们正在将服务器应用程序升级到.NET Core 6。它通过.ASMX页面向几个现有客户提供肥皂Web服务。 .NET Core不再支持服务器端WCF。建议使用GRPC或至少CoreWCF。不幸的是,我们无法控制数百个部署的客户端应用程序。替代方案必须与它们完全兼容,包括硬编码的URL和消息格式。

据我了解,GRPC是WCF的替代品,但目前尚不清楚它是否能够通过HTTP支持肥皂。另一个替代方案CoreWCF确实支持了它,但对于定格漏技术来说,这可能是一项重大的技术投资。将学习曲线朝着更新的东西来利用学习曲线会很高兴。目前尚不清楚两个解决方案是否能够为ASMX文件提供服务。

GRPC支持肥皂吗?如果是这样,它是直接的,还是需要大量的开发工作?最后,CoreWCF或GRPC支持提供ASMX文件吗?如果没有,是否可以简单地无缝响应ASMX URL?

We're upgrading a server application to .NET Core 6. It provides SOAP Web Services to several existing clients via .ASMX pages. .NET Core doesn't support server-side WCF anymore. gRPC, or at the very least CoreWCF, are recommended alternatives. Unfortunately, we have no control over the hundreds of deployed client applications. The alternative must be fully compatible with them, including the URL, which is hardcoded, and message formatting.

From my understanding, gRPC is a replacement for WCF, but it's unclear if it's capable of supporting SOAP over HTTP. Another alternative, CoreWCF, does support it, but it might be a significant technical investment for a stop-gap technology. It would be nice to leverage the learning curve towards something more current. It's unclear whether either of the solutions is capable of servicing ASMX files.

Does gRPC support SOAP? If so, is it straightforward, or does it require a considerable amount of development effort? Finally, does either CoreWCF or gRPC support serving ASMX files? If not, is it possible to simply respond to ASMX URLs seamlessly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余生共白头 2025-02-19 06:46:38

我找到了SOAPCORE,这是一种完美满足我们需求的解决方案。

https://github.com/digdes/soapcore

我不可值地认为ASMX是WCF功能只是ASP.NET提供的基本服务器端HTTP/SOAP的设施。由于我们的应用程序基于ASP.NET,因此可以通过MVC URL路由访问ASMX URL:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSoapCore();
    services.TryAddSingleton<ServiceContractImpl>();
    services.AddMvc();
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    app.UseRouting();

    // Route "ServicePath.asmx" to our service endpoint
    app.UseEndpoints(endpoints => {
        endpoints.UseSoapEndpoint<ServiceContractImpl>("/ServicePath.asmx", new SoapEncoderOptions(), SoapSerializer.DataContractSerializer);
    });
    
}

虽然它是一个定格差距解决方案,但它特别是肥皂消息传递库,而不是通用双重协议框架。设置并将其投入生产是直接和简单的。

I found SoapCore, a solution that serves our needs perfectly.

https://github.com/DigDes/SoapCore

I incorrectly thought ASMX was a WCF feature, but it's just a facility provided by ASP.NET for basic server-side HTTP/SOAP. Since our application is based on ASP.NET, the ASMX URL can be accessed via MVC URL routing:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSoapCore();
    services.TryAddSingleton<ServiceContractImpl>();
    services.AddMvc();
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    app.UseRouting();

    // Route "ServicePath.asmx" to our service endpoint
    app.UseEndpoints(endpoints => {
        endpoints.UseSoapEndpoint<ServiceContractImpl>("/ServicePath.asmx", new SoapEncoderOptions(), SoapSerializer.DataContractSerializer);
    });
    
}

While it is a stop-gap solution, it's specifically a SOAP messaging library rather than a general-purpose protocol framework. Setting it up and putting it into production is straight-forward and simple.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文