我有此WCF服务:
http://localhost:56471/WcfPruebaService.svc
而我需要的是:
http://localhost:56471/ServiciosDePrueba/WcfPruebaService.svc
7bsow1i61#
您只需要打开app.config,用新地址替换旧地址。或者,如果要在代码中更改它(以编程方式),则可以使用以下代码:
WSHttpBinding binding = new WSHttpBinding(); EndpointAddress endpoint = new EndpointAddress(new Uri("***")); MyServiceClient client = new MyServiceClient(binding, endpoint);
https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-implement-a-wcf-contract#edit-appconfigHow to programmatically modify WCF app.config endpoint address setting?
1条答案
按热度按时间7bsow1i61#
您只需要打开app.config,用新地址替换旧地址。
或者,如果要在代码中更改它(以编程方式),则可以使用以下代码:
https://learn.microsoft.com/en-us/dotnet/framework/wcf/how-to-implement-a-wcf-contract#edit-appconfig
How to programmatically modify WCF app.config endpoint address setting?