How to consume WCF web service through URL at run time?

后端 未结 5 1182
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 10:06

I want to access all the methods exposed in the service through the URL. if suppose the URL will be :

http://localhost/MyService/MyService.svc
5条回答
  •  孤街浪徒
    2020-11-30 10:57

    You can also make use of the WebClient class to call the WCF service without needing a service proxy. Effectively you can send and receive Strings and Binary data and also simulate POSTs.

    I use it extensively for reusable components where the developer may not ever create the required proxy methods. A good comparison of ways to do POST is available here.

提交回复
热议问题