Hi I am building an ASP.NET MVC client which consumes a WCF web service.
Currently I am in every action method, in all the controllers, writing the code line:
ServiceReference1.SHAServiceClient myWs = new ServiceReference1.SHAServiceClient()
But I would like to avoid this and just instantiate the web service reference in one place for the whole client. In that way I hope to just write "myWS", when I need to call the web servie in the action methods of the controllers.
Can you tell me precisely how to do that?
View Complete Post