Is possible to access WCF Service without adding Service Reference?

后端 未结 5 1701
太阳男子
太阳男子 2020-12-13 14:38

I need to access Wcf service methods without adding Service Reference?how to do this?

Step 1:I create a WCF Service.
Step 2:Add Service Reference to my applicati

5条回答
  •  孤街浪徒
    2020-12-13 15:39

    Risking the markdown lynch mob with this, but...

    If the reason you're not adding the reference is because you need to choose the URL at runtime, you can still add the reference and then change it when you need to with:

    MyProxy.Endpoint.Address = new EndpointAddress(MyUri);
    

    (or do the same thing in the constructor when you instantiate).

提交回复
热议问题