Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the endpoint address programmatically in the client site?

Tags:

wcf

How can I change the endpoint address programmatically in the client site?

like image 235
hovkar Avatar asked Dec 30 '09 07:12

hovkar


People also ask

What is endpoint in web config?

Endpoints provide the configuration required for the communication and create the complete WCF service application. WCF provides communication for client applications using Endpoints. Endpoints provide the configuration required for the communication and create the complete WCF service application.

What is endpoint Configuration name in WCF?

WCF formalizes this relationship in the form of an endpoint. The endpoint is the fusion of the address, contract, and binding (see Figure 1-8). Every endpoint must have all three elements, and the host exposes the endpoint. Logically, the endpoint is the service's interface and is analogous to a CLR or COM interface.

What is the endpoint address?

The endpoint address is represented by the EndpointAddress class, which contains a Uniform Resource Identifier (URI) that represents the address of the service, an Identity, which represents the security identity of the service, and a collection of optional Headers.


1 Answers

proxy.Endpoint.Address = new EndpointAddress("http://newaddress");

where proxy is an instance of the client class generated when importing the WSDL. Or you can specify the address when creating the client proxy:

var endpoint = new EndpointAddress("http://newaddress");
var proxy = new SomeClientProxy("BasicHttpBinding_IHelloWorld", endpoint);
like image 178
Darin Dimitrov Avatar answered Oct 21 '22 08:10

Darin Dimitrov