次の方法で共有


MetadataResolver

This won't work:

 var endpoints = MetadataResolver.Resolve(typeof(ICityService), new EndpointAddress("https://xxx/CityService.svc"));


Instead, it should point to the wsdl and better explicitly specify it's using HttpGet

 var endpoints = MetadataResolver.Resolve(typeof(ICityService), new Uri("https://xxx/CityService.svc?wsdl"),  MetadataExchangeClientMode.HttpGet );