将 ASMX 转换为 WCF Web 服务需要付出多少努力? [英] How much effort is required to convert an ASMX to WCF web service?

查看:20
本文介绍了将 ASMX 转换为 WCF Web 服务需要付出多少努力?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 2 个 web 服务,总共有大约 6 个 web 方法,大部分代码都是以任何方式位于程序集中的,而 web 服务 asmx 实际上只是调用这些程序集方法并返回它们的返回类型.

I have 2 web services with about 6 web methods in total, most of the code is ofc sitting in assemblies any way, and the web service asmx is really just calling these assembly methods and returning their return type.

将 Web 服务从 ASMX 转换为 WCF 需要多少工作?

How much effort is it to convert the web services from ASMX to WCF?

在这个阶段,我几乎控制着唯一的——非基于 Web 的客户端连接到 Web 服务,所以这不是一个真正的问题,产品处于预发布阶段.

I pretty much at this stage control the only - non web based clients connecting to the web services, so this is not really a problem, product is in prelaunch.

推荐答案

您应该会发现转换非常简单 - 特别是如果您现有的 asmx Web 方法只是调用其他类.只需从 Visual Studio 创建一个新的 WCF 服务 - 这样您仍然可以完整地保留现有的 Web 服务.它会自动为您创建一个 http 端点,因此您可以直接将其转储到 IIS(只需进行一些配置).您将需要描述您的 DataContract 类,但它也非常简单.

You should find it extremely simple to convert - especially if your existing asmx web methods are just calling into other classes. Just create a new WCF Service from Visual Studio - that way you still have your existing web services intact. It will automatically create an http end-point for your so you can just dump it straight into IIS (with a little configuration). You will need to describe your DataContract classes but that it trivially simple too.

我最近做了这个,很高兴!

I did this recently and it was a joy!

这篇关于将 ASMX 转换为 WCF Web 服务需要付出多少努力?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆