The web service has SoapExtension, which contains an error handler and serializing error in a format xml.
<? Xml version = "1.0" encoding = "utf-8" standalone = "yes"?>
<Exception Type="System.NullReferenceException"> Exception text. </ Exception>
How to make error handler, which call error of “Type”? E.g.:
Type _type = Type.GetType(doc.DocumentElement.Attributes["Type"].Value);
It must to call NullReferenceException.
You need to provide the fully-qualified name, i.e. “System.NullReferenceException”.
In this particular case, that’s enough – because
NullReferenceExceptionis in mscorlib. However, if you need other exceptions – such asConstraintException, which lives in the System.Data assembly – you’d need to provide the full assembly name too.Type.GetType(string)only looks in the currently executing assembly and mscorlib for type names which don’t specify the assembly.EDIT: Here’s a short but complete program which works: