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

Handling SoapException error

P: n/a
I want to catch any soapexception error by these method.
My question is Does creating an instance from assembly name can
retrieve exception errors from UI? I have read documents on handling
soapexception errors but i want to make it general on this. Is this
procedure posible? Because it returns an error message of "HRESULT
has returned from a call to a COM Component."

Sir Joe Mayo, I hope you could help me on this. Any idea would be a
great help! Thanks!

Chris.

===============================================
catch(Exception err)
{
throw (Exception)CreateObjectInstance(err);
}

private object CreateObjectInstance(Exception err)
{
Object obj;
Assembly[] assemblyArray;
string str = err.Message.Substring(err.Message.IndexOf("---> ") +
5,
err.Message.IndexOf(" (") - err.Message.IndexOf("---> ") - 5);

assemblyArray = new
Assembly[AppDomain.CurrentDomain.GetAssemblies().Length];
assemblyArray = AppDomain.CurrentDomain.GetAssemblies();

foreach(Assembly assembly in assemblyArray)
{
Type[] mytypes = assembly.GetTypes();
foreach(Type t in mytypes)
{
if(t.FullName == str)
{
obj = Activator.CreateInstance(t)
return obj;
}
}
}
return null;
}
===============================================
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.