public DynamicProxy CreateProxy(ServiceEndpoint endpoint) { Type contractType = GetContractType(endpoint.Contract.Name, endpoint.Contract.Namespace); Type proxyType = GetProxyType(contractType); DynamicProxy obj = new DynamicProxy(proxyType, endpoint.Binding, endpoint.Address); ((ServiceEndpoint)obj.Proxy.GetType().GetProperty("Endpoint").GetValue(obj.Proxy, null)).Address = new EndpointAddress(this.wsdlUri); return(obj); }
public DynamicProxy CreateProxy(ServiceEndpoint endpoint) { Type contractType = GetContractType(endpoint.Contract.Name, endpoint.Contract.Namespace); Type proxyType = GetProxyType(contractType); DynamicProxy obj = new DynamicProxy(proxyType, endpoint.Binding, endpoint.Address); ((ServiceEndpoint)obj.Proxy.GetType().GetProperty("Endpoint").GetValue(obj.Proxy, null)).Address = new EndpointAddress(this.wsdlUri); return obj; }