2 using System
.Collections
.Generic
;
3 using System
.ServiceModel
;
4 using System
.ServiceModel
.Channels
;
5 using System
.ServiceModel
.Security
;
6 using System
.ServiceModel
.Security
.Tokens
;
8 using System
.ServiceModel
.MonoInternal
;
10 namespace System
.ServiceModel
.Dispatcher
12 internal class InputOrReplyRequestProcessor
: BaseRequestProcessor
14 DispatchRuntime dispatch_runtime
;
15 IChannel reply_or_input
;
17 public InputOrReplyRequestProcessor (DispatchRuntime runtime
, IChannel replyOrInput
)
19 Init (runtime
, replyOrInput
);
22 InitializeChain
.AddHandler (new InitializingHandler ());
25 ProcessingChain
.AddHandler (new PostReceiveRequestHandler ()).
26 AddHandler(new SecurityHandler ()).
27 AddHandler(new OperationInvokerHandler (replyOrInput
));
30 ErrorChain
.AddHandler (new ErrorProcessingHandler (replyOrInput
));
33 FinalizationChain
.AddHandler (new FinalizeProcessingHandler ());
36 void Init (DispatchRuntime runtime
, IChannel replyOrInput
)
38 dispatch_runtime
= runtime
;
39 reply_or_input
= replyOrInput
;
42 public void ProcessInput (Message message
)
44 OperationContext opcx
= CreateOperationContext (message
);
45 ProcessRequest (new MessageProcessingContext (opcx
));
48 public void ProcessReply (RequestContext rc
)
50 OperationContext opcx
= CreateOperationContext (rc
.RequestMessage
);
51 opcx
.RequestContext
= rc
;
52 ProcessRequest (new MessageProcessingContext (opcx
));
55 OperationContext
CreateOperationContext (Message incoming
)
57 ServiceRuntimeChannel contextChannel
;
58 if (dispatch_runtime
.HasCallbackRuntime
) {
59 var type
= ServiceProxyGenerator
.CreateCallbackProxyType (dispatch_runtime
.Type
, dispatch_runtime
.CallbackClientRuntime
.CallbackClientType
);
60 contextChannel
= (ServiceRuntimeChannel
) Activator
.CreateInstance (type
, new object [] {reply_or_input, dispatch_runtime}
);
63 contextChannel
= new ServiceRuntimeChannel (reply_or_input
, dispatch_runtime
);
64 OperationContext opCtx
= new OperationContext (contextChannel
);
65 opCtx
.IncomingMessage
= incoming
;
66 opCtx
.EndpointDispatcher
= dispatch_runtime
.EndpointDispatcher
;