* [System.ServiceMode] Create unit test for #46917
* [System.ServiceModel.Discovery] Fix messages validation
The current validations are not correct and throws an exception calling
GetVideoSources API in an ONVIF media client. This API
is a combination of a first message with an input parameter and
a second message with the reply that is not void.
Removing this checks makes the client work correctly.
Fixes#46917
A test failed on Jenkins today with "address already in use".
Opportunistically replaced a few more hardcoded test ports to avoid failures in the future.
The test sometimes failed on Jenkins with the timeout assert. Running only this single test locally
with `make check TESTNAME=System.ServiceModel.Dispatcher.Bug652331Test.Bug652331_2` however reproduced
this almost every single time.
It seems that WCF takes a bit to initialize until it accepts connections, so putting a little sleep
fixed this for me locally and running it in a loop for half an hour didn't assert even once.
NET_4_0 is always defined now, so the ifdefs are redundant.
I verified the libs are exactly the same after this change, so this is effectively a no-op.
Fixes: http://bugzilla.xamarin.com/show_bug.cgi?id=1164
The breakage reported in #1164 was caused by commit 106fdeb4, which
fixed bxc206. The problem is that in fixing bxc206, response messages
of a type having a MessageContractAttribute custom attribute were
changed to have a `void` return type, according to the
MessageDescription's Body.ReturnValue.Type property.
This fix is correct, in that it's what .NET does, but it broke XML
deserialization which expected the "actual" return type to exist, not
`void`.
Case in point: the added IService1.EndJSMGetDatabases() method will
have a MessageDescription with a Body.ReturnValue.Type=typeof(void).
The problem is that deserializing this message will fail:
System.Runtime.Serialization.SerializationException: Deserializing
type 'System.Void'. Expecting state 'EndElement'. Encountered state
'Text' with name '' with namespace ''.
Obviously this is not good. ;-)
The fix is simple: don't use the MessageDescription's ReturnValue if
it's `typeof(void)`.
There are two added wrinkles:
1. Writing a test case for the above.
2. The test case broke with another error: a NRE within
BaseMessagesFormatter.MessageObjectToParts(). This is because
when ContractDescriptionGenerator.GetMessage() sets the
ReturnValue for a response message, it doesn't set
MessagePartDescription.MemberInfo.
BaseMessagesFormatter.MessageObjectToParts(), meanwhile, was
checking the ReturnValue's MemberInfo...which was null.
Add a null check here so that the actual bug can be tested.
For reasons I currently can't explain, the Service1Client test type
appears to support having only one async operation "in flight" at a
time. As a result of this, calling multiple Async methods on the
Service1Client instance, as was done previously, would result in not
all of the event handlers being invoked, and the test timing out
after 60s instead of exiting quickly because all event handlers had
been raised.
I don't understand enough of WCF & this code to say why Service1Client
can have only one async operation in progress at once, but making this
change so that each async operation operates on a separate instance
speeds up the Bug652331_2Test execution from 60s to 5s.
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).
* ServiceBehaviorAttribute.cs : do not overwrite existing properties
which may have been set by preceding behaviors. Fix WSDL output.
* EnvelopeVersion.cs : fix name and namespace for None property.
* HttpListenerManager.cs : add some comments.
* DispatchRuntimeTest.cs : add another line of assertion.
svn path=/trunk/mcs/; revision=159313
* 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
* 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
* ContractDescriptionGenerator.cs : fill FaultDescription action,
name and namespace as expected.
* FaultDescriptionTest.cs : add new test.
* FaultContractAttributeTest.cs : new test.
* System.ServiceModel_test.dll.sources : add some new fault tests.
svn path=/trunk/mcs/; revision=154698
* NetTcpBindingTest.cs :
I have to disable a lot of connective tests that somehow blocks
test runs. No idea why it started to happen though.
* DispatchRuntimeTest.cs :
I have to disable a lot of connective tests that somehow blocks
test runs. No idea why it started to happen though.
* CustomPeerResolverServiceTest.cs :
I have to disable a lot of connective tests that somehow blocks
test runs. No idea why it started to happen though.
(It internally uses HTTP binding, which is the indirect source of
the problem here.)
svn path=/trunk/mcs/; revision=147398
* ChannelDispatcher.cs, EndpointDispatcher.cs :
when an EndpointDispatcher is added to ChannelDispatcher, its
ChannelDispatcher property is automatically filled. To do this,
create a derived collection type for Endpoints (that's what .NET
does). Remove extra InitializeEndpoint() argument.
* DuplexClientRuntimeChannel.cs : reflecting EndpointDispatcher change.
* ChannelDispatcherTest.cs : add a test to make sure that
EndpointDispatcher.ChannelDispatcher property is filled by Add().
svn path=/trunk/mcs/; revision=142124
* ServiceBehaviorAttribute.cs : fill SingletonInstanceContext on
opening the host.
* ChannelDispatcherTest.cs : add singleton instance context test
(but disabled, for some weird conflict).
svn path=/trunk/mcs/; revision=137315
* ServiceHostBase.cs : remove more TODO.
* DispatchRuntime.cs : do not fill InstanceContextProvider here.
* ChannelDispatcher.cs : do it here instead.
* ChannelDispatcherCollection.cs : remove TODOs.
* ChannelDispatcherTest.cs : make sure that the port to be in use is
available before running the tests. Check attach state.
* DispatchRuntimeTest.cs : make sure that it runs through all the
behavior tests.
svn path=/trunk/mcs/; revision=136695
* DispatchRuntimeTest.cs : add reasonable timeout and close client
appropriately. Objects are disposed in different ways than .NET.
Do not expect things automatically disposed as just time goes by.
svn path=/trunk/mcs/; revision=136221
* ChannelDispatcher.cs, SecurityHandler.cs,
InputOrReplyRequestProcessor.cs, MessageProcessingContext.cs :
remove default communication timeouts from several types. They
bring bogus NRE. Instead, fill timeouts in ChannelDispatcher and
use it when required (it was actually *only* request processor).
* ChannelDispatcherTest.cs : make sure ctor args are nullable.
svn path=/trunk/mcs/; revision=134044
* DispatchRuntime.cs : some comment.
* ChannelDispatcher.cs : ongoing changes to handle listeners and
accepted channels at more precise state. Listeners are opened,
without accepting channels. Some setup code is done at OnOpen(),
while some are done at OnOpened().
* ServiceHost.cs : split dispatcher open from dispatcher loop start.
Use DispatchRuntime.Type to specify service type.
* ChannelDispatcherTest.cs : added a couple of EndpointDispatcher
state tests.
svn path=/trunk/mcs/; revision=132739