public static void RegisterSoapActionForMethodBase(MethodBase mb) { SoapMethodAttribute cachedSoapAttribute = (SoapMethodAttribute)InternalRemotingServices.GetCachedSoapAttribute((object)mb); if (!cachedSoapAttribute.SoapActionExplicitySet) { return; } SoapServices.RegisterSoapActionForMethodBase(mb, cachedSoapAttribute.SoapAction); }
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; }