Normally i would instantiate a SoapClient like this:
public static TestWSSoapClient Test()
{
string endpoint = "endpoint";
var soapClient = new TestWSSoapClient(endpoint);
return soapClient;
}
But i'd like to use a more generic approach:
public static ICommunicationObject SoapClient<TSoap>()
{
string endpoint = "endpoint";
var soapClient = new TSoap(endpoint);
return soapClient;
}
But obviously you cannot create an instance like that from a generic type. How can i create this instance and still pass the endpoint
string to it?