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

有些话、适合烂在心里 提交于 2019-12-31 03:40:08

问题


WCF service is running with 'wsHttpBinding' Binding. The application which gonna consume WCF Service is non-wcf compliance or in other words, it is on the top of Framework 2.0 and I can't use ServiceModel in this app (since only 3.5 supports ServiceModel).

Any suggestions, how to consume above WCF Service in application built in 2.0?


回答1:


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.




回答2:


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.




回答3:


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.)



来源:https://stackoverflow.com/questions/2178199/how-to-consume-wcf-wshttpbinding-service-in-application-built-in-2-0

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