Thanks for that, works great. The MethodResponse class was the hole in
my knowledge. But there's a wrinkle...
In order to send back the out parameters, I need to check which of the
args are out or ref. How do I do that?
Cheers
> Thanks for that, works great. The MethodResponse class was the hole in
> my knowledge. But there's a wrinkle...
>
> In order to send back the out parameters, I need to check which of the
> args are out or ref. How do I do that?
public override IMessage Invoke (IMessage myMessage)
{
...
MethodBase mb = RemotingServices.GetMethodBaseFromMethodMessage (
(IMethodMessage)myMessage);
ArrayList outParams = new ArrayList ();
foreach (ParamaterInfo p in mb.GetParameters ())
{
if (p.IsOut) outParams.Add(someFakedOutValue);
}
Header[] headers;
if (outParams.Count > 0)
{
headers = new Header[2];
headers[0] = new Header("__Return", someFakedReturnValue)};
headers[1] = new Header("__OutArgs", outParams.ToArray ());
}
else {
headers = new Header[1];
headers[0] = new Header("__Return", someFakedReturnValue)};
}
MethodResponse resp = new MethodResponse (headers, myMessage);
return resp;
}
Rob