There were several issues here:
- The IChannelDispatcherBoundListener was defined twice, in two different namespaces, and it caused code in
ChannelDispatcher.Attach not to set its associated listener's ChannelDispatcher property to the correct value.
This, in turn, caused incorrect HttpListenerManagerTable operation, where it would put the "/js" and "/jsdebug"
dispatchers in separate HttpListenerManagers, instead of in the main (base) service's one.
- After fixing the above, it turned out that SvcHttpHandler selected the manager based on the host's base address,
when it should first try to find one whose URL matches the current request exactly.
The problem is that DispatchRuntime.Type is a service implementation type
that could implement two or more contract interfaces, and it was in random
order how ServiceProxyGenerator picks up the contract type. Now it looks
for correct contract type instead of the service type by exactly looking
for the target contract in the endpoint (dispatcher).
* InputOrReplyProcessor.cs : remove SecurityHandler. WS-Trust must
be handled before endpoint dispatching (it must not pass contract
filter) and doesn't make sense to be here.
* SecurityHandler.cs : move to old-code.
* SecurityReplyChannel.cs : handle WS-Trust message here.
* SecurityRequestContext.cs : so, do not pass those messages here.
* SslSecurityTokenAuthenticator.cs,
AuthenticatorCommunicationObject.cs,
SecureConversationSecurityTokenAuthenticator.cs :
add timeout argument to negotication requests.
* System.ServiceModel.dll.sources: remove SecurityHandler.cs
svn path=/trunk/mcs/; revision=160244
* ChannelDispatcher.cs : do not swallow exception during
RequestContext.get_RequestMessage() and thus return SOAP Fault for
MessageSecurityException to the client.
svn path=/trunk/mcs/; revision=160122
* HttpTransportBindingElement.cs :
Use new HTTP channel listener implementation.
* ChannelDispatcher.cs : enable service throttling again.
This time Http(Listener), ASP.NET and TCP listeners all work.
* System.ServiceModel.dll.sources :
add new HTTP channel listener implementation sources.
Old sources will be kept for a while, won't entirely vanish as
ASP.NET support will live there.
svn path=/trunk/mcs/; revision=159491
* ServiceHostBase.cs : Do not build more than one ChannelDispatcher
for a Binding. Then check duplicate listen URIs, excluding mex ones.
* ChannelDispatcher.cs : add simple bool field to mark for mex channel.
* ServiceMetadataExtension.cs : use simple ChannelDispatcher.IsMex field.
* ServiceHostTest.cs : improved endpoint tests and enabled them.
* ChannelDispatcherTest.cs : had to disable a test that regressed from
validating duplicate listen URI. Possible remedy is described too.
svn path=/trunk/mcs/; revision=159140
* ServiceHostBase.cs : retrieve MessageVersion and raise an error
if there is none. (Check this earlier than building a listener.)
* ChannelDispatcher.cs : MessageVersion check is moved to
ServiceHostBase.
* ServiceMetadataExtension.cs : overwrite MessageVersion to use None.
(The only special case I found for ChannelDispatcher.MessageVersion.)
* CustomBindingTest.cs : add tests for MessageVersion check on Open().
* MetadataExchangeBindingsTest.cs : make sure that special casing of
MessageVersion does not happen at this layer.
svn path=/trunk/mcs/; revision=159061
* OperationInvokerHandler.cs, MessageProcessingContext.cs :
ChannelDispatcher may be null, so check its availability before
using it. Don't use it, when possible.
* DispatchOperation.cs : remove unused member.
svn path=/trunk/mcs/; revision=158871
* OperationDescription.cs : add contract origin flags to identify
which operation should be used for client operations (and dispatch
too in the future).
* MessageDescription.cs : add IsRequest flag to indicate if it is
for request or not.
* ServiceContractGenerator.cs, ContractDescriptionGenerator.cs :
make use of above changes.
* ContractDescription.cs : don't create extraneous ClientOperations
in irrelevant message direction.
* EndpointDispatcher.cs, BaseMessagesFormatter.cs:
Now MessageDescription.Direction is differentiated from "IsRequest"
property, to precisely identify request/reply in callbacks. Also
now we don't have to create extraneous ContractDescription for
callbacks.
* DuplexClientRuntimeChannel.cs : do not create and use extraneous
ContractDescription for callback contract. Non-callback ones now
works fine.
This fixes service part of bug #567672, IsOneWay = true case.
svn path=/trunk/mcs/; revision=158454
* ContractDescriptionGenerator.cs : Now callback contract methods are
also reflected into OperationDescription as well as those from non-
callback contract. Callback methods have reverse MessageDirection,
so adjust them.
* ContractDescription.cs, ServiceEndpoint.cs, TypedMessageConverter.cs :
A bit of renaming / reflect method call changes.
* EndpointDispatcher.cs, DispatchRuntime.cs, ClientRuntime.cs :
now Callback[Dispatch|Client]Runtime properties are always filled
so that users can configure the callback runtimes (not sure such
configured runtimes work fine yet, but it is a required step).
* InputOrReplyRequestProcessor.cs : instead of HasCallbackRuntime
hack, use CallbackClientRuntime.CallbackContractType for checking
callback existence.
* ClientProxyGenerator.cs : CreateProxyType now carefully considers
requested proxy type, contract type and callback contract type.
i.e. now the resulting proxy has implemented methods for callbacks
that are also filled at ContractDescription.
* ClientRuntimeChannel.cs : reflect some method call changes.
svn path=/trunk/mcs/; revision=158412
* ContractDescription.cs : fill ClientOperation.Formatter here.
(It is hacky, see additional comment.)
* ClientRuntimeChannel.cs : replace GetFormatter() with Formatter.
* ClientOperation.cs : do the same for client side too.
svn path=/trunk/mcs/; revision=158083
* DispatchOperation.cs : on callback channels ChannelDispatcher is
not available. Wait for something like ClientRuntime.ChannelFactory.
svn path=/trunk/mcs/; revision=158082
* TcpDuplexSessionChannel.cs, TcpReplyChannel.cs : do not set RelatesTo
here. If the contract is not one-way (IsOneWay = false) and there is
a callback, the callback message sent to the client should *not* be
assigned RelatesTo header here. Just do it in the request-reply
context. Do it in OperationInvokerHandler.
* OperationInvokerHandler.cs : assign RelatesTo header item here.
svn path=/trunk/mcs/; revision=157950
* ChannelDispatcher.cs : disable slottling again :( It still fails
to process concurrent requests if there is service metadata channel
and MaxConcurrentSessions > 1 on non-ASP.NET channels.
svn path=/trunk/mcs/; revision=157670
* ChannelDispatcher.cs : enable throttling again. Though issues
regarding parallel request is not here (multiple dispatchers
can accept a channels for each), and HTTP channels do not accept
more than one channel at a time anyways.
svn path=/trunk/mcs/; revision=157662
* OperationInvokerHandler.cs : workaround NRE issue in AsyncCallTest.
The original code was worse than this workaround.
svn path=/trunk/mcs/; revision=155788
* EndpointAddressMessageFilter.cs : check null arg. Return false for
no To header case and do not result in NRE.f
* EndpointAddressMessageFilterTest.cs :
Add null arg case. Enable working test.
svn path=/trunk/mcs/; revision=154787
* BaseMessagesFormatter.cs : hasParameter check is incorrectly
restrictive to reject some kinds of pairs.
* CustomPeerResolverServiceTest.cs : enabled all disabled tests.
svn path=/trunk/mcs/; revision=154781
* ClientRuntimeChannel.cs :
use DataContractSerializer.IsStartObject() to check if the fault
detail reader is for the fault contract, in addition to Action.
* FaultContractInfo.cs : add serializer property.
svn path=/trunk/mcs/; revision=154712
* EndpointDispatcher.cs : fill FaultContractInfos.
* DispatchOperation.cs : do not fill them dynamically/automatically.
* ErrorProcessingHandler.cs : added some FIXME notes.
svn path=/trunk/mcs/; revision=154690
* ChannelDispatcher.cs : differentiate EndpointNotFound and
ActionNotSupported so that FaultConverter can create appropriate
fault messages. Removed extra filter condition on null To item.
And create fault messages on *any* server side error, do not let
request client infinitely wait for the response until timeout.
(RunDestinationUnreachableTest() is still not working but it works
when it is SOAP 1.2.)
svn path=/trunk/mcs/; revision=154439
* ChannelDispatcher.cs : for faults, use fault namespace, not that of
ReplyAction. Added FIXME comment regarding dispatcher.
svn path=/trunk/mcs/; revision=154427
* ChannelDispatcher.cs : return EndpointDispatcher at initializing
for internal use. Add some locks. Patch by Matt Dargavel.
* ServiceHostBase.cs : if there is an existing ChannelDispatcher
for the same endpoint URI, reuse it. Patch by Matt Dargavel.
svn path=/trunk/mcs/; revision=154114