private string RemoteDispatchHelper(string s, out bool failed) { if (this._denyRemoteDispatch) { throw new UnauthorizedAccessException(Resource.FormatString("ServicedComponentException_SecurityMapping")); } IMessage request = ComponentServices.ConvertToMessage(s, this); this.CheckMethodAccess(request); IMessage reqMsg = RemotingServices.GetRealProxy(this).Invoke(request); IMethodReturnMessage message3 = reqMsg as IMethodReturnMessage; if ((message3 != null) && (message3.Exception != null)) { failed = true; } else { failed = false; } return(ComponentServices.ConvertToString(reqMsg)); }
// helper to implement RemoteDispatch methods private String RemoteDispatchHelper(String s, out bool failed) { if (_denyRemoteDispatch) { throw new UnauthorizedAccessException(Resource.FormatString("ServicedComponentException_SecurityMapping")); } IMessage reqMsg = ComponentServices.ConvertToMessage(s, this); // Check to see if the method is marked as secure on the // server side: If so, we need to kick it back to the caller, // cause they called us incorrectly. Also verify the method // is not private, internal, or static. CheckMethodAccess(reqMsg); RealProxy rp = RemotingServices.GetRealProxy(this); DBG.Assert(rp != null, "Null RP in Invoke helper"); IMessage retMsg = rp.Invoke(reqMsg); // Check for failures: IMethodReturnMessage mrm = retMsg as IMethodReturnMessage; if (mrm != null && mrm.Exception != null) { failed = true; } else { failed = false; } String sret = ComponentServices.ConvertToString(retMsg); return(sret); }