By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,854 Members | 869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,854 IT Pros & Developers. It's quick & easy.

Problem with Activator.createinstance method

P: 1
hi ..
i got the following error in activator.createinstance method

'Exception has been thrown by the target of an invocation.' this is the error.

here is my code:

public object getService(String name)
object o = services[name];
if (null != o)
return o;
Type t = Type.GetType(PACKAGE_PREFIX + version + "." + name);
o = Activator.CreateInstance(t);
foreach(String headerName in HEADERS)
FieldInfo f = t.GetField(headerName + "Value");
if ((f != null) && (this.headers[headerName] != null))
f.SetValue(o, this.headers[headerName]);
if (alternateUrl != null)
setUrlPrefix((SoapHttpClientProtocol) o, alternateUrl);
services.Add(name, o);
return o;
Nov 6 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.