public IAsyncResult BeginProcessRequest(
SecureChannelContext context,
IServiceRequest request)
{
m_context = context;
m_request = request;
try
{
// find service.
m_service = m_endpoint.FindService(m_request.TypeId);
if (m_service == null)
{
throw ServiceResultException.Create(StatusCodes.BadServiceUnsupported, "'{0}' is an unrecognized service type.", m_request.TypeId);
}
// queue request.
m_endpoint.ServerForContext.ScheduleIncomingRequest(this);
}
catch (Exception e)
{
m_error = e;
m_response = SaveExceptionAsResponse(e);
// operation completed.
OperationCompleted();
}
return this;
}