简体   繁体   English

将Web服务转换为WCF

[英]Converting Web Service to WCF

I recently wrote a wrapper (C#) for an ApplinX web service - this is a product that is part of the Software AG Adabas offering. 我最近为ApplinX Web服务编写了包装程序(C#)-这是Software AG Adabas产品的一部分。 The web service interface is really primitive and I wrote the wrapper to make it easier to use. Web服务接口确实很原始,我编写了包装程序以使其易于使用。

The wrapper is in use on web applications (C# + Asp.Net) but I want to a Windows client to access it using WCF. 该包装程序正在Web应用程序(C#+ Asp.Net)上使用,但我希望Windows客户端使用WCF访问它。 Would it be better to write the WCF services from scratch or simply wrap the existing wrapper in WCF? 从头开始编写WCF服务还是将现有的包装器包装在WCF中会更好吗?

Is the wrapper in a seperate class library? 包装器位于单独的类库中吗? If not, you can move the wrapper into a class ibrary and allow both the ASP.NET app and the windows client app to consume it. 如果没有,则可以将包装器移到类库中,并允许ASP.NET应用程序和Windows客户端应用程序使用它。 This would eliminate any adition wrappers and abstraction layers. 这将消除任何附加包装程序和抽象层。 It would also allow the windows client to directly consume the service without having to go through the ASP.NET application. 它还将允许Windows客户端直接使用服务,而不必通过ASP.NET应用程序。

If you wrap the current wrapper in as a WCF service, then from the windows client, you will be making a service call to your ASP.NET app, which will turn around and make another call to the service it is consuming. 如果将当前包装器包装为WCF服务,则将从Windows客户端对ASP.NET应用程序进行服务调用,ASP.NET应用程序将转过来并对其使用的服务进行另一个调用。 The above recommendation will eliviate that. 以上建议将消除这种情况。 If however there is some business logic you need to encapsulate and only want to be on the server, then I would create a WCF service on the ASP.NET application and wrap the calls to your wrapper service in that. 但是,如果有一些业务逻辑需要封装并且只希望位于服务器上,那么我将在ASP.NET应用程序上创建WCF服务,并在其中包装对包装器服务的调用。 The Windows client can then consume the WCF service. Windows客户端然后可以使用WCF服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM