Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs')
-rw-r--r--mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs28
1 files changed, 11 insertions, 17 deletions
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 2de868c9bee..e0508f1cb82 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,21 +222,21 @@ namespace System.Runtime.Remoting.Channels {
// have to add them here
_methodCallParameters = _methodCallInfo.GetParameters();
object[] args = new object[_methodCallParameters.Length];
- int sn = 0;
- for (int n=0; n<_methodCallParameters.Length; n++)
+
+ foreach(ParameterInfo paramInfo in _methodCallParameters)
{
- ParameterInfo paramInfo = _methodCallParameters [n];
Type paramType = (paramInfo.ParameterType.IsByRef ? paramInfo.ParameterType.GetElementType() : paramInfo.ParameterType);
if (paramInfo.IsOut && paramInfo.ParameterType.IsByRef) {
- args [n] = GetNullValue (paramType);
+ args [paramInfo.Position] = GetNullValue (paramType);
}
else{
- object val = soapMessage.ParamValues[sn++];
- if(val is IConvertible)
- args [n] = Convert.ChangeType (val, paramType);
- else
- args [n] = val;
+ int index = Array.IndexOf(soapMessage.ParamNames, paramInfo.Name);
+ if(soapMessage.ParamValues[index] is IConvertible)
+ soapMessage.ParamValues[index] = Convert.ChangeType(
+ soapMessage.ParamValues[index],
+ paramType);
+ args [paramInfo.Position] = soapMessage.ParamValues[index];
}
}
@@ -267,16 +267,10 @@ namespace System.Runtime.Remoting.Channels {
ArrayList paramValues = new ArrayList();
ArrayList paramTypes = new ArrayList();
soapMessage.MethodName = mrm.MethodName+"Response";
-
- Type retType = ((MethodInfo)mrm.MethodBase).ReturnType;
-
- if(retType != typeof(void)) {
+ if(mrm.ReturnValue != null && mrm.ReturnValue.GetType() != typeof(void)) {
paramNames.Add("return");
paramValues.Add(mrm.ReturnValue);
- if (mrm.ReturnValue != null)
- paramTypes.Add(mrm.ReturnValue.GetType());
- else
- paramTypes.Add(retType);
+ paramTypes.Add(mrm.ReturnValue.GetType());
}
for(int i = 0; i < mrm.OutArgCount; i++){