Web 服务与 DLL;优点和缺点?

发布于 2024-12-11 18:25:48 字数 181 浏览 0 评论 0原文

我正在为我们的网站实施一项网络服务,该服务通过互联网请求并接收来自第三方的数据。我还被要求创建一个 DLL,为内部 Windows 应用程序复制 Web 服务的功能。

我的问题是;不创建 DLL 并使用 WEB 服务用于内部和 Web 应用程序有哪些优点/缺点?

从维护的角度来看,我更愿意支持单一服务。想法或想法?

I am implementing a web service for our website which requests and receives data from a third party via the internet. I have also been asked to create a DLL duplicating the functionality of the web service for an internal windows application.

My question is; what are the advantages/disadvantages of NOT creating the DLL and using the WEB Service for both internal and web applications?

From a maintenance point of view I would prefer to support a single service. Thoughts or ideas?

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

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

发布评论

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

评论(2

眼眸里的快感 2024-12-18 18:25:48

创建 WCF 服务。 Windows应用程序可以直接访问dll中的服务类,而WCF将其公开为Web服务。您只需以这种方式编写和维护一段代码即可。

Create a WCF Service. The Windows application can access the service class in the dll directly, while WCF exposes it as a web service. You just have to write and maintain one piece of code that way.

终难愈 2024-12-18 18:25:48

在我看来,您应该将此逻辑创建为类似 WCF 服务的东西,可以以多种格式托管。接口优先的开发策略仍然允许您通过直接实例化服务来将其用作内存中的类,但您也可以使用带有代理的“共享内存”端点来轻松地在使用服务之间移动Web 边界与共享内存与 TCP/IP。

托管模型可以是 IIS,并使用 basicHttp 绑定,其外观和行为与传统的 WebService 非常相似,但也可以托管在 Windows 服务、Windows 窗体应用程序甚至 ConsoleHost 应用程序中。

In my opinion you should create this logic as something like a WCF-Service which can be hosted in a variety of formats. The interface-first development strategy would still allow you to use the service as nothing more than an in-memory class by directly instantiating it, but you could also use the "shared memory" endpoint with a proxy to easily move between consuming the service across a web boundary versus shared memory versus TCP/IP.

The hosting model could be IIS and use the basicHttp binding to look and act very much like a traditional WebService, but could also be hosted within Windows Service, or Windows Forms application or even a ConsoleHost application..

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