X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Runtime.Remoting%2FSystem.Runtime.Remoting.Channels%2FSoapMessageFormatter.cs;h=85c71a1c0264c558a0a260a5e401901f2db11e94;hb=94091b8c6ff19efc6dfeb9d15a70ad99d3911cb2;hp=e958e557cdfcb0e354592ebf1feb2af1072e060c;hpb=e51a9b6ba1a93bc981639a706c93bee413099fd6;p=mono.git diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs index e958e557cdf..85c71a1c026 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs @@ -222,9 +222,18 @@ namespace System.Runtime.Remoting.Channels { headersList.Add(new Header("__Uri", uri)); headersList.Add(new Header("__MethodName", soapMessage.MethodName)); string typeNamespace, assemblyName; - SoapServices.DecodeXmlNamespaceForClrTypeNamespace(soapMessage.XmlNameSpace, out typeNamespace, out assemblyName); - _serverType = RemotingServices.GetServerTypeForUri(uri); + if (!SoapServices.DecodeXmlNamespaceForClrTypeNamespace(soapMessage.XmlNameSpace, out typeNamespace, out assemblyName)) + throw new RemotingException ("Could not decode SoapMessage"); + + // Note that we don't need to validate the type in + // this place because MethodCall will do it anyway. + + if (assemblyName == null) // corlib + _serverType = Type.GetType (typeNamespace, true); + else + _serverType = Type.GetType (typeNamespace + ", " + assemblyName, true); + headersList.Add(new Header("__TypeName", _serverType.FullName, false)); if (soapMessage.Headers != null) { @@ -243,7 +252,10 @@ namespace System.Runtime.Remoting.Channels { if (signature == null) _methodCallInfo = _serverType.GetMethod(soapMessage.MethodName, bflags); else - _methodCallInfo = _serverType.GetMethod(soapMessage.MethodName, bflags, null, signature, null); + _methodCallInfo = _serverType.GetMethod(soapMessage.MethodName, bflags, null, signature, null); + + if (_methodCallInfo == null && (soapMessage.MethodName == "FieldSetter" || soapMessage.MethodName == "FieldGetter")) + _methodCallInfo = typeof(object).GetMethod (soapMessage.MethodName, bflags); // the *out* parameters aren't serialized // have to add them here @@ -377,17 +389,9 @@ namespace System.Runtime.Remoting.Channels { return sf; } - internal void GetInfoFromMethodCallMessage(IMethodCallMessage mcm) { + internal void GetInfoFromMethodCallMessage (IMethodMessage mcm) { _serverType = Type.GetType(mcm.TypeName, true); - - if (mcm.MethodSignature != null) - _methodCallInfo = _serverType.GetMethod(mcm.MethodName, - BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, - null, (Type []) mcm.MethodSignature, null); - else - _methodCallInfo = _serverType.GetMethod(mcm.MethodName, - BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - + _methodCallInfo = RemotingServices.GetMethodBaseFromMethodMessage (mcm) as MethodInfo; _methodCallParameters = _methodCallInfo.GetParameters(); }