Commit Graph
27 Commits
Author SHA1 Message Date
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
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
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
Rodrigo Kumpera a0d28b2587 Kill the MOONLIGHT define in System.ServiceModel. 2013-02-11 13:01:11 -05: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
Miguel de Icaza 2852ed0b59 Update copyrights 2011-09-13 18:26:13 -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 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 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
Peter Gerbrandt fe6910a0a8 Apply DataContractSerializerOperationBehavior. 2011-03-14 12:16:25 +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
Atsushi Eno eed5cddbae 2010-06-04 Atsushi Enomoto <[email protected]>
* 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
2010-06-04 08:40:36 +00:00
Atsushi Eno 4e1c23bf2b 2010-04-05 Atsushi Enomoto <[email protected]>
* 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
2010-04-05 07:45:21 +00:00
Atsushi Eno 9f2af8d5a1 2010-03-11 Atsushi Enomoto <[email protected]>
* BaseMessagesFormatter.cs : add internal OperationFormatter type
	  for moonlight/silverlight-sdk compatibility. It mostly wraps
	  the existing the return value by BaseMessagesFormatter.Create().
	* DispatchOperation.cs, ClientOperation.cs, EndpointDispatcher.cs:
	  use above new type.


svn path=/trunk/mcs/; revision=153493
2010-03-12 07:27:23 +00:00
Atsushi Eno 47765e1338 2009-09-11 Atsushi Enomoto <[email protected]>
* BaseMessagesFormatter.cs, DefaultOperationInvoker.cs:
	  Fix the crash that ref parameter in contract methods caused.


svn path=/trunk/mcs/; revision=141731
2009-09-11 09:02:11 +00:00
Atsushi Eno b98bb73fa6 2009-09-02 Atsushi Enomoto <[email protected]>
* BaseMessagesFormatter.cs :
	  implement XmlBodyWriter.OnCreateBufferedCopy().

	* XmlReaderBodyWriter.cs : implement OnCreateBufferedCopy()
	  for XmlReader input.


svn path=/trunk/mcs/; revision=141111
2009-09-02 10:18:38 +00:00
Atsushi Eno 95ce234785 2009-08-11 Atsushi Enomoto <[email protected]>
* IOperationInvoker.cs : fix interface.
	* DefaultOperationInvoker.cs : refresh implementation of the above.
	* BaseMessagesFormatter.cs, OperationInvokerHandler.cs :
	  dependent changes for above.

	* ServiceHostBase.cs : use new IOperationInvoker implementation.

	* System.ServiceModel.dll.sources: add DefaultOperationInvoker.cs.


svn path=/trunk/mcs/; revision=139695
2009-08-11 08:14:30 +00:00
Atsushi Eno 55791e96b7 2009-02-04 Atsushi Enomoto <[email protected]>
* BaseMessagesFormatter.cs : do not use non-2.1 CreateInstance().


svn path=/trunk/mcs/; revision=125653
2009-02-04 06:31:05 +00:00
Jb Evain 031fa07cc1 2008-09-12 Astushi Enomoto <[email protected]>
Jb Evain  <[email protected]>

	* Makefile: support net_2_1_raw compilation profile.
	* net_2_1_raw_System.ServiceModel.dll.sources

	* *.cs: SL2 compilation support.


svn path=/trunk/mcs/; revision=112857
2008-09-12 11:21:41 +00:00
Jb Evain bdd0809c70 move to from olive to mcs
svn path=/trunk/mcs/; revision=111187
2008-08-20 21:24:37 +00:00