internal bool CanCastToXmlType(String xmlTypeName, String xmlTypeNamespace)
{
Type castType = SoapServices.GetInteropTypeFromXmlType(xmlTypeName, xmlTypeNamespace);
if (castType == null)
{
String typeNamespace;
String assemblyName;
if (!SoapServices.DecodeXmlNamespaceForClrTypeNamespace(xmlTypeNamespace,
out typeNamespace, out assemblyName))
return false;
String typeName;
if ((typeNamespace != null) && (typeNamespace.Length > 0))
typeName = typeNamespace + "." + xmlTypeName;
else
typeName = xmlTypeName;
try
{
Assembly asm = Assembly.Load(assemblyName);
castType = asm.GetType(typeName, false, false);
}
catch
{
return false;
}
}
if (castType != null)
return castType.IsAssignableFrom(this.GetType());
return false;
} // CanCastToXmlType