public static void PreLoad(Type type) { foreach (MethodBase method in type.GetMethods()) { SoapServices.RegisterSoapActionForMethodBase(method); } SoapTypeAttribute cachedSoapAttribute1 = (SoapTypeAttribute)InternalRemotingServices.GetCachedSoapAttribute((object)type); if (cachedSoapAttribute1.IsInteropXmlElement()) { SoapServices.RegisterInteropXmlElement(cachedSoapAttribute1.XmlElementName, cachedSoapAttribute1.XmlNamespace, type); } if (cachedSoapAttribute1.IsInteropXmlType()) { SoapServices.RegisterInteropXmlType(cachedSoapAttribute1.XmlTypeName, cachedSoapAttribute1.XmlTypeNamespace, type); } int num = 0; SoapServices.XmlToFieldTypeMap xmlToFieldTypeMap = new SoapServices.XmlToFieldTypeMap(); foreach (FieldInfo field in type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { SoapFieldAttribute cachedSoapAttribute2 = (SoapFieldAttribute)InternalRemotingServices.GetCachedSoapAttribute((object)field); if (cachedSoapAttribute2.IsInteropXmlElement()) { string xmlElementName = cachedSoapAttribute2.XmlElementName; string xmlNamespace = cachedSoapAttribute2.XmlNamespace; if (cachedSoapAttribute2.UseAttribute) { xmlToFieldTypeMap.AddXmlAttribute(field.FieldType, field.Name, xmlElementName, xmlNamespace); } else { xmlToFieldTypeMap.AddXmlElement(field.FieldType, field.Name, xmlElementName, xmlNamespace); } ++num; } } if (num <= 0) { return; } SoapServices._xmlToFieldTypeMap[(object)type] = (object)xmlToFieldTypeMap; }
public static bool GetXmlElementForInteropType( Type type, out string xmlElement, out string xmlNamespace) { SoapServices.XmlEntry xmlEntry = (SoapServices.XmlEntry)SoapServices._interopTypeToXmlElement[(object)type]; if (xmlEntry != null) { xmlElement = xmlEntry.Name; xmlNamespace = xmlEntry.Namespace; return(true); } SoapTypeAttribute cachedSoapAttribute = (SoapTypeAttribute)InternalRemotingServices.GetCachedSoapAttribute((object)type); if (cachedSoapAttribute.IsInteropXmlElement()) { xmlElement = cachedSoapAttribute.XmlElementName; xmlNamespace = cachedSoapAttribute.XmlNamespace; return(true); } xmlElement = (string)null; xmlNamespace = (string)null; return(false); }