public static bool IsSoapActionValidForMethodBase(string soapAction, MethodBase mb)
{
bool flag;
RuntimeModule runtimeModule;
if (mb == null)
{
throw new ArgumentNullException("mb");
}
if ((soapAction[0] == '"') && (soapAction[soapAction.Length - 1] == '"'))
{
soapAction = soapAction.Substring(1, soapAction.Length - 2);
}
SoapMethodAttribute cachedSoapAttribute = (SoapMethodAttribute)InternalRemotingServices.GetCachedSoapAttribute(mb);
if (string.CompareOrdinal(cachedSoapAttribute.SoapAction, soapAction) == 0)
{
return(true);
}
string strA = (string)_methodBaseToSoapAction[mb];
if ((strA != null) && (string.CompareOrdinal(strA, soapAction) == 0))
{
return(true);
}
string[] strArray = soapAction.Split(new char[] { '#' });
if (strArray.Length != 2)
{
return(false);
}
string typeNameForSoapActionNamespace = XmlNamespaceEncoder.GetTypeNameForSoapActionNamespace(strArray[0], out flag);
if (typeNameForSoapActionNamespace == null)
{
return(false);
}
string str3 = strArray[1];
RuntimeMethodInfo info = mb as RuntimeMethodInfo;
RuntimeConstructorInfo info2 = mb as RuntimeConstructorInfo;
if (info != null)
{
runtimeModule = info.GetRuntimeModule();
}
else
{
if (info2 == null)
{
throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));
}
runtimeModule = info2.GetRuntimeModule();
}
string fullName = mb.DeclaringType.FullName;
if (flag)
{
fullName = fullName + ", " + runtimeModule.GetRuntimeAssembly().GetSimpleName();
}
return(fullName.Equals(typeNameForSoapActionNamespace) && mb.Name.Equals(str3));
}