How to consume WCF wsHttpBinding Service in application built in 2.0?

孤者浪人 提交于 2019-12-02 01:09:40

This won't work - typically. .NET 2.0 only support basicHttpBinding, or the new REST-style webHttpBinding.

You could potentially retrofit the WSE (Web Services Enhancements) - but that gets quite messy.

ServiceModel is part of 3.0, not 3.5 - but either way I expect you should be able to use WSE3 to connect, since this offers WS*. Jimmy Ziemowit has some thoughts on this here.

In the past I've had success simply deploying System.ServiceModel.dll etc with the app onto 2.0 machines (back in the early days of 3.0); it may work for you too? A full 3.0 install is preferred, of course.

The wsHttpBinding is not compatible with the ASMX-style web references used in .NET 2.0.

If you do not need message-level security, you can switch to a basicHttpBinding, which will make the service consumable by any client (simply use the standard Add Web Reference dialog). If you must use WS-Security then you will either need to upgrade the client to .NET 3.0, or switch to a customBinding and use WSE 3.0 on the client.

(Note that WSE is no longer a supported technology and its use seems to be frowned upon by the community. Only use this if none fo the other solutions will work for you.)

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