Thanks Ron. I have tried this approach but it seems to have no effect. The
address still remains the same. Is there anything else I need to do to make
this work?
Daniel
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_IHelloWorld",
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/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Daniel - 23 Aug 2007 04:30 GMT
Thanks Steven, the first approach works.
Daniel
> Hi Daniel,
>
[quoted text clipped - 67 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights