Commit Graph
174 Commits
Author SHA1 Message Date
Mads Kruse Johnsen 7f5e358971 [wcf] do not assume that message body is always Wrapped (#11694)
Currently, setting IsWrapped=false on a MessageContract leads to an error in serialization due to an empty element being present where the wrapper element would have been, instead of it being gone entirely.
The serialization then fails because the empty string is not valid localName (which of course is fine).
2018-11-16 12:31:00 +01:00
Egor Bogatov 51935465ae Delete unused files in BCL (#9288)
The following files in `mcs/class/*.cs` are not used anywhere (*.csproj/*.source).
2018-06-25 11:15:20 +02:00
Paul Fertser 62c0db6457 [wcf] Fix memory leak processing requests
This partially reverts commit 1628f04de5 .

Runtime tested and confirmed to fix issue #8970 and allows long-term
operation of RapidSCADA.
2018-06-01 17:38:04 +02:00
Andoni Morales Alastruey 0450dc0785 * [System.ServiceModel.Discovery] Fix messages validation to fix bug #46917 (#3772)
* [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
2018-04-19 13:54:32 +02:00
hgy59 abebff426a [WCF] fix ChannelDispatcher by accepting InstanceProvider (#7909)
* WCF: ChannelDispatcher/ListenerLoopManager.Setup validate InstanceProvider, not InstanceContextProvider
- the creation of endpoints requires an instance provider or a default constructor
- InstanceProvider vs InstanceContextProvider was obviously a typo

* include InstanceContextProvider for validation as before
- two unittests failed due InstanceProvider is null and ed.DispatchRuntime has not type set
- comment for the validation is not useful anyway (It is tested at Open(), but strangely it is not instantiated at this point.)
2018-04-03 14:31:14 +02:00
Paul Fertser dd4dbd8d4b [System.ServiceModel] Prevent crash in Dispatcher.ListenerLoopManager… (#7136)
In certain cases of having concurrent WCF requests
HttpReplyChannel.TryReceiveRequest can return true with the context
being null ("at closing phase").

This patch prevents crashing the whole application with a
NullReferenceException as reported in issue #7134.

Whether this is just covering the issue over or a real fix is yet to be
determined.

Fixes https://github.com/mono/mono/issues/7134
2018-02-20 14:05:05 -05:00
Alexander Köplinger 9e91b6687e [System.ServiceModel] Don't use DateTime.Now for measuring elapsed time
Use Stopwatch or DateTime.UtcNow instead which aren't affected
by things like daylight-saving time
2017-07-02 23:31:34 +02:00
Alexander Köplinger cd57ffcd04 [System.ServiceModel] Rename method parameters to match .NET contract 2017-03-16 13:02:09 +01:00
Alexander Köplinger 2dda624df4 [System.ServiceModel] Make looper thread in ChannelDispatcher a background thread and join instead of abort
This showed up when switching to nunit-lite since it runs all tests in the same AppDomain,
meaning it won't exit when any foreground threads are still running. This was the case
with the thread created by ChannelDispatcher which was still waiting on a connection.

Also try to Join() the thread for a bit so it exits gracefully before trying to abort,
might resolve issues like in https://github.com/mono/mono/pull/3819
2016-10-29 14:09:42 +02:00
Alexander Köplinger c4692001a9 [bcl] Fix method parameter names to match .NET
The names were fixed only for the subset of methods that are included in netstandard,
and in cases where netstandard differs from Desktop .NET we match with .NET.
2016-08-26 17:49:03 +02:00
Ludovic Henry 249daf43de [mcs] Replace NET_2_1 by MOBILE
NET_2_1 is also defined whenever we define MOBILE, so they have the same effect. Silverlight was 2.1 but it's been dead for a while now, and we do not even support it.
2016-08-18 16:34:36 +02:00
Marcos Henrich c1d81649cc Merge pull request #2323 from esdrubal/servicemodel
[System.ServiceModel] Fixes missing xsi xsd attributes
2016-02-15 12:08:21 +00:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Marcos Henrich fdb5cadefb [ServiceModel] Fixes missing xsi xsd attributes
While serializing operations with XmlSerializerFormatAttribute,
attributes xmlns:xsi and xmlns:xsd were not added to the message body.

XmlBodyWriter now adds the missing attributes.

Fixes #34413.
2016-01-04 15:42:26 +00:00
Miguel de Icaza 28f473c41d Merge pull request #1225 from strawd/bug22307
Fix for bug 22307 - Intermittent IndexOutOfRangeException on closing connection
2015-09-23 15:34:55 -04:00
Zoltan Varga e71bf630bc [bcl] Fix test failures in the System.ServiceModel tests after 9ffb681d06. 2015-08-15 22:26:59 -04:00
Chris Hamons b044a27fe0 Create xammac_net_4_5 profile for XM 4.5 Unified to remove references to unshippable assmblies 2015-06-18 13:31:04 -05:00
Miguel de Icaza 5715cdc582 [System.ServiceModel] Prevent server crash when client disconnect
This patch is an updated version of a pull request (377) from Rob
Wilkens to fix #5926
2015-02-16 10:01:22 -05:00
Zoltan Varga c1b4366932 [bcl] Remove NET_4_5 defines from class libs. 2015-01-13 16:34:23 -05:00
Zoltan Varga 032f313d5f [bcl] Remove NET_4_0 defines from class libs. 2015-01-13 16:06:31 -05:00
Martin Baulig 87622fc711 [WCF]: Update to my last fix for bug #22129.
The problem already starts when creating the OperationDescription; we need
to also look at the End* method here to correctly parse the reply parameters.

Then ClientRuntimeChannel.Process needs to distinguish between sync/async
and copy the out/byref parameters when needed.
2014-09-16 21:34:20 +02:00
David Straw 5b6c684d26 Fix for bug 22307 - Intermittent IndexOutOfRangeException on closing connection 2014-08-22 11:50:08 -06:00
Martin Baulig 1ae87e9ee9 [WCF]: Add stubs for some missing .NET 4.0/4.5 APIs. 2013-09-02 21:52:13 +02:00
Rodrigo Kumpera a0d28b2587 Kill the MOONLIGHT define in System.ServiceModel. 2013-02-11 13:01:11 -05:00
Martin Baulig 37b26ae4a0 [#7177][WCF]: Correctly handle derived FaultExceptions. 2012-09-19 06:01:11 +02:00
Rolf Bjarne Kvinge 9ab872cb69 System.ServiceModel: Make FaultContractInfos available (and therefore deserialized correctly) in mobile profiles. Fixes #1437 and 2859. 2012-02-04 03:04:34 +01:00
Jonathan Pryor 00e29089c7 [System.ServiceModel] Don't try to deserialize void messages.
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.
2012-01-20 00:18:54 -05:00
Martin 5aecac0f33 completes commit 4f3d21e46e 2011-12-29 15:38:58 +01:00
QuickJack 4f3d21e46e Fixes CS0168 in System.ServiceModel.dll 2011-12-29 15:28:26 +01:00
Miguel de Icaza 2852ed0b59 Update copyrights 2011-09-13 18:26:13 -04:00
Sebastien Pouliot 7894348cc8 Add null-check on 'partDesc'. Fix bug #612 (WCF regression) 2011-09-07 11:16:23 -04:00
Atsushi Eno bde305b72c When there is void return, the common message formatter should ignore it.
This case occurs when MessageContract is used and there is no member for
the return value.
2011-08-24 12:10:31 -07:00
Atsushi Eno 2be522da83 This filter should ignore port, and should not filter out anonymous URIs. 2011-08-24 12:00:59 -07:00
Atsushi Eno 5fc5f02c46 Merge pull request #145 from ngraziano/99b87f07af0beed3a887
Fix Service Model Xml Serialization and XMLAttributes
2011-08-03 05:54:54 +09:00
Atsushi Eno 0c7d5fcc14 Fill/reflect ReturnValue to and from corresponding message part.
This may have fixed bug #41.
2011-08-02 09:58:28 -07:00
Atsushi Eno 226c2db9ac Implement support for Stream param with WebHttpBinding raw content format. 2011-06-28 20:43:13 +09:00
Atsushi Eno 0045240824 Enable environment-controled output on non-moon profile too. Add error logging. 2011-04-25 15:35:03 +09:00
Atsushi Eno a316b856d0 Get real fix for bug #687902. Revert request processor IDisposable.
and handle session shutdown when creating InstanceContext.
Also add note on DisposeInstance(), which got me stuck.
2011-04-20 19:11:34 +09:00
Atsushi Eno 5c306c5d04 Ongoing service channel closing fix and session management in ChannelDispatcher.
It is part of bugfix 687902.

To get the bug fixed, the new "using" sections in ChannelDispatcher.cs to
explicitly dispose channels. But this causes regression in PerSession-based
tests. So some new session management code is (likely) required as well.

It will also alter "mixed" MaxConcurrentCalls and MaxConcurrentSessions with
correct management code.
2011-04-20 16:52:36 +09:00
Atsushi Eno 549e702365 Add XmlSerializerFormatAttribute support in mobile profiles.
Unlike moonlight, XmlSerializer is in the framework lib (sys.xml), so we don't
have to split them out to Sys.Xml.Serialization.dll.
2011-04-08 15:58:04 +09:00
Atsushi Eno 72f0cd6e5b Split XmlMessagesFormatter out. It is for use in Sys.Xml.Serialization.dll.
XmlMessagesFormatter will be used in Sys.Xml.Serialization.dll and this
type should not be excluded by !NET_2_1 or !MOONLIGHT. It is not doable
if this class is in BaseMessagesFormatter.cs.
2011-04-08 00:19:40 +09:00
Atsushi Eno 852b7fe308 Some XmlSerializerFormatAttribute and XmlSerializerOperationBehavior refactoring. 2011-04-07 19:19:07 +09:00
Rolf Bjarne Kvinge 30443d63dd System.ServiceModel: make it a lot more compatible with Silverlight 2011-03-31 16:01:22 +02:00
Atsushi Eno e60ff5ff90 Add endpoint behavior support in NET_2_1, which involved not a few additions. 2011-03-16 17:20:00 +09:00
Peter Gerbrandt fe6910a0a8 Apply DataContractSerializerOperationBehavior. 2011-03-14 12:16:25 +09:00
Atsushi Eno 1e4407cd84 Replace SRE-based client proxy generator with RealProxy.
Now PE verified workaround should be unnecessary.
2011-03-07 12:29:39 +09:00
Atsushi Eno 1125d54fa3 Another fix to not write null header. Add UniqueId deserialization workaround. 2011-02-24 14:24:44 +09:00
Atsushi Eno 3378ca880c Do not try to serialize null header item. 2011-02-18 16:23:15 +09:00
Atsushi Eno 3aaf87fe84 Message headers are now serialized and deserialized for MessageHeaderDescription. 2011-02-15 23:14:27 +09:00
Atsushi Eno 58a7b75bd8 Support ServiceKnownTypes. Fixed another case on bug #652331. 2011-02-09 15:42:40 +09:00