Change webservice url at run time dynamically c#

3 Jul

In this post we will learn how to Change web service url at run time dynamically. Consider an example as  Magento merchant web service in which each merchant  has a service that is hosted on thier own domains.

Merchant 1 service url :

Merchant 2 service url :

Now consider we are trying to use the above web services which we will modify the service url at runtime dynamically.

First we added the WSDL reference fro Merchant 1 now we want to consume the webservice for merchant 2.

The following is the code


Merchant 1.WebService1 mservice = new Merchant 1.WebService1();

mservice.Url = "";

One thought on “Change webservice url at run time dynamically c#

Leave a Reply

Your email address will not be published. Required fields are marked *