.net 4.0还支持asmx吗

发布于 2024-10-15 21:06:56 字数 356 浏览 4 评论 0原文

  1. 我在 VS2010 中打开了 .net 2.0 ASMX Web 服务并迁移到 .net4.0。如果我只是运行我的 ASMX 而不将代码更改为 WCF 格式,我仍然可以在 .net 4.0 下运行旧的 asmx 服务?这会按原样工作吗?
  2. 我的 web.config 文件也有 WSE 设置,这会发生什么?
  3. WCF/net4.0 不支持附件,我是否需要更改我的 asmx webmethod 以作为正文中的数据集返回,这可以工作吗?
  4. 我尝试使用数据集作为 .net 4.0 中的附件来运行现有的 asmx 服务,它有效吗?
  5. 我可以看到asmx文件可以添加到.net 2010中吗?他们仍然受到支持吗?
  1. I Opened my .net 2.0 ASMX webservice in VS2010 and migrated to .net4.0. If i simply run my ASMX w/o changing te code to WCF format i can still run old asmx service under .net 4.0 ?? will this work as it is?
  2. My web.config file also has WSE settings what happens to this?
  3. WCF/net4.0 does not support attachments, do i need to change my asmx webmethod to return as dataset in the body and will this work?
  4. I tried running my existing asmx service using dataset as attachments in .net 4.0 and it worked?
  5. I can see asmx file can be added in the .net 2010? are they still supported?

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

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

发布评论

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

评论(3

夜声 2024-10-22 21:06:57

ASMX Web 服务将属于 .NET 框架生命周期。 .NET Framework 4.0 和 4.5 支持 ASMX Web 服务。 Microsoft 建议不要使用 ASMX 创建新代码,如前面的答案中指出的那样。

ASMX Web Services would fall under the .NET framework lifecycle. The .NET framework 4.0 and 4.5 support ASMX web services. Microsoft recomends that no new code be created using ASMX as pointed in the earlier answers.

方觉久 2024-10-22 21:06:57

引用微软

本主题特定于旧技术。现在应使用 Windows Communication Foundation 创建 XML Web 服务和 XML Web 服务客户端。< /strong>


你自己决定这对你意味着什么。

WCF 完全取代了 ASMX Web 服务。那些抱怨 WCF 复杂性的人并没有注意到这一点。创建一个新的 WCF 服务并查看模板创建的“hello world”服务中的实际代码。这只是比 ASMX 模板创建的内容更复杂,因为它包含两个操作,而不仅仅是一个。

不过,请不要误会华尔街英语。它已经过时了。尽快停止使用它,并且不要使用 WSE 开发任何新代码。

不要让任何人让你相信什么都没有改变。确实如此。 ASMX 已被更好、更强大、更灵活的东西所取代。

To quote Microsoft:

This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.

Decide on your own what that means to you.

WCF completely replaces ASMX web services. People who complain about the complexity of WCF aren't paying attention. Go create a new WCF service and look at the actual code in the "hello world" service that the template creates. That's only more complicated than what the ASMX template created because it includes two operations not just one.

Make no mistake about WSE, however. It's simply obsolete. Stop using it as soon as possible, and do not develop any new code using WSE.

Don't let anybody convince you that nothing has changed. It has. ASMX has been replaced by something much better, much more powerful, and much more flexible.

陪我终i 2024-10-22 21:06:56

是的,您也可以在 .NET 4.0 中使用 ASMX。


Quoting Dave Ward from his reply to a comment on his post at Encosia named ASMX and JSON – Common mistakes and misconceptions

我认为 WCF 在某些情况下很棒
在那里你可以利用它的优势
优势,比如当你可以使用
tcp绑定模式。然而,WCF 的
复杂性让人很难认真对待
考虑简单的 AJAX 回调
功能更有针对性,
更成熟的解决方案已经存在。

ASMX 绝不是被弃用或
已过时,即使在 .NET 4 中也是如此。
实际上我的误解之一
将在本系列中介绍。

Yes, you can use ASMX in .NET 4.0 also.


Quoting Dave Ward from his reply to a comment on his post at Encosia named ASMX and JSON – Common mistakes and misconceptions

I think WCF is great in situations
where you can take advantage of its
strengths, like when you can use the
tcpBinding mode. However, WCF’s
complexity makes it hard to seriously
consider for simple AJAX callback
functionality where a better targeted,
more mature solution already exists.

ASMX is by no means deprecated or
obsolete, even in .NET 4. That’s
actually one of the misconceptions I’m
going to cover in this series.

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