Hi Daniel,
If what you want to do is just change the client WCF proxy's endpoint
address(in case you need to redirect to new server programmtically?), you
can use the following options:
1. You can pass a new Endpoint address instance(with the new url) in your
WCF client proxy's constructor, e.g.
<<<<<<<<<<<<<<<<<<<<
static void RunProxy()
{
HelloWorld.HelloWorldClient hello =
new
HelloWorld.HelloWorldClient("BasicHttpBinding_IHel loWorld",
new
EndpointAddress("http://localhost:8888/BasicHost/HelloWorld"));
string ret = hello.SayHello("WCF");
Console.WriteLine(ret);
}
>>>>>>>>>>>>>>>>
2. Or you can also create the WCF proxy first and change the
endpointAddress member after that. e.g.
>>>>>>>>>>>>>>>>
HelloWorld.HelloWorldClient client = new
WCFHelloWorldClient.HelloWorld.HelloWorldClient();
//change the endpointAddress here
client.Endpoint.Address = new
EndpointAddress("http://localhost:8899/BasicHost/HelloWorld");
Console.WriteLine(client.SayHello("steven"));
<<<<<<<<<<<<<<
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.