public static bool GetTypeAndMethodNameFromSoapAction( string soapAction, out string typeName, out string methodName) { if (soapAction[0] == '"' && soapAction[soapAction.Length - 1] == '"') { soapAction = soapAction.Substring(1, soapAction.Length - 2); } ArrayList arrayList = (ArrayList)SoapServices._soapActionToMethodBase[(object)soapAction]; if (arrayList != null) { if (arrayList.Count > 1) { typeName = (string)null; methodName = (string)null; return(false); } MethodBase methodBase = (MethodBase)arrayList[0]; if (methodBase != null) { Type declaringType = methodBase.DeclaringType; typeName = declaringType.FullName + ", " + declaringType.Module.Assembly.nGetSimpleName(); methodName = methodBase.Name; return(true); } } string[] strArray = soapAction.Split('#'); if (strArray.Length == 2) { typeName = XmlNamespaceEncoder.GetTypeNameForSoapActionNamespace(strArray[0], out bool _); if (typeName == null) { methodName = (string)null; return(false); } methodName = strArray[1]; return(true); } typeName = (string)null; methodName = (string)null; return(false); }
public static bool IsSoapActionValidForMethodBase(string soapAction, MethodBase mb) { if (soapAction[0] == '"' && soapAction[soapAction.Length - 1] == '"') { soapAction = soapAction.Substring(1, soapAction.Length - 2); } if (string.CompareOrdinal(((SoapMethodAttribute)InternalRemotingServices.GetCachedSoapAttribute((object)mb)).SoapAction, soapAction) == 0) { return(true); } string strA = (string)SoapServices._methodBaseToSoapAction[(object)mb]; if (strA != null && string.CompareOrdinal(strA, soapAction) == 0) { return(true); } string[] strArray = soapAction.Split('#'); if (strArray.Length != 2) { return(false); } bool assemblyIncluded; string soapActionNamespace = XmlNamespaceEncoder.GetTypeNameForSoapActionNamespace(strArray[0], out assemblyIncluded); if (soapActionNamespace == null) { return(false); } string str1 = strArray[1]; Type declaringType = mb.DeclaringType; string str2 = declaringType.FullName; if (assemblyIncluded) { str2 = str2 + ", " + declaringType.Module.Assembly.nGetSimpleName(); } return(str2.Equals(soapActionNamespace) && mb.Name.Equals(str1)); }