I am consuming a SOAP web service from .NET code, by adding a reference to the service. Now the service wsdl endpoint might change in the future, so I want to add it to the config file in order to make my app more dynamic. Now I won't be able to use added reference anymore so I want to call the service from code without using service reference. I cannot create a ChannelFacotry
as I do not have the interface type for the service as it is not WCF. So I cannot use something like this:
BasicHttpBinding binding = new BasicHttpBinding("MyBinding");
EndpointAddress address = new EndpointAddress(baseUrl);
ChannelFactory factory = new ChannelFactory<IService>(binding, address);
Is there any way I can consume SOAP web service without adding a service reference. And if not at all, is there any way for me to update the url of the ServiceReference dynamically from code?