Does .net 4.0 still support asmx

混江龙づ霸主 提交于 2020-01-10 03:45:11

问题


  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?

回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/4887813/does-net-4-0-still-support-asmx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!