object proxy = Activator.GetObject(resourceType, endPoint);
ICredentials networkCredentials = new NetworkCredential(userName, password, domain);
IDictionary dictionary = ChannelServices.GetChannelSinkProperties(proxy);
dictionary["credentials"] = networkCredentials;