Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a C# Service Reference SOAP Client with different Endpoint URIs

I have a SOAP Webservice that is available on multiple servers, thus having multiple endpoints. I want to avoid adding multiple Service References (C# SOAP Port Clients) with different names just to talk to this services, since the API is exactly the same.

Is there a way to configure the Endpoint URI at runtime?

like image 681
beberlei Avatar asked Aug 09 '10 11:08

beberlei


People also ask

What is the most efficient way to use air conditioning?

ACEEE estimates that air conditioners use 3% to 5% less energy for every degree you raise the thermostat. To get the best energy savings, leave your thermostat set at 78 degrees or higher while you're out.

Is it better to leave the AC on all day?

Your AC will actually run longer overall if it is left on all day instead of being shut off. If you turn it off for part of the day, it runs less and results in more energy savings for you. In almost all cases, it will save you money to shut off your AC while you are away from home.

Is it better to turn your AC on and off or leave it on?

Leaving your air conditioner on is actually more efficient than frequently turning it on and off. Having your AC on also allows you to better control humidity in your home throughout the day. The lower the humidity in a home, the more comfortable it feels during hot weather.

How do you use AC for the first time?

For most central air systems, the process is simple. Simply move the switch on your thermostat from “Heat” to “Cool”. If your system was off entirely, you may need to move the switch from “Off” to “Cool” instead. Once you turn your system on, be sure to close any open windows to conserve energy.


1 Answers

I use the following which works great:

        ServiceReference1.wsSoapClient ws= new ServiceReference1.wsSoapClient();
        ws.Endpoint.Address = new System.ServiceModel.EndpointAddress("http://xxx/myservice.asmx");
like image 174
Jimbo Avatar answered Oct 13 '22 09:10

Jimbo