Imported Upstream version 5.16.0.100

Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-08-07 15:19:03 +00:00
parent 0a9828183b
commit 7d7f676260
4419 changed files with 170950 additions and 90273 deletions

View File

@@ -9,17 +9,6 @@ using System.Text;
using System.Xml;
using System.Threading;
namespace System.Runtime.CompilerServices
{
// introduced for silverlight sdk compatibility
internal class FriendAccessAllowedAttribute : Attribute
{
public FriendAccessAllowedAttribute ()
{
}
}
}
namespace System.ServiceModel
{
public class EndpointIdentity {}

View File

@@ -6,6 +6,9 @@ RESOURCE_FILES = \
resources/WS-Addressing.schema \
resources/ws-addr.xsd
RESX_RESOURCE_STRING = \
../../../external/corefx/src/System.ServiceModel.Syndication/src/Resources/Strings.resx
LIBRARY = System.ServiceModel.dll
LIB_REFS = System System.Xml System.Core System.Runtime.Serialization System.IdentityModel

View File

@@ -36,7 +36,7 @@ using System.Xml;
namespace System.ServiceModel.Channels
{
internal class TransactionMessageProperty
public class TransactionMessageProperty
{
Transaction tx;
Message msg;

View File

@@ -233,7 +233,9 @@ namespace System.ServiceModel.Description
*/
var inherited = new Collection<ContractDescription> ();
var interfaces = cd.ContractType.GetInterfaces ();
var interfaces = cd.ContractType.GetInterfaces ()
.Where (t => t != givenContractType);
foreach (var it in interfaces ) {
var icd = GetContractInternal (it, givenServiceType, null);
if (icd != null)

View File

@@ -70,17 +70,14 @@ namespace System.ServiceModel.Dispatcher
internal static void Validate (OperationDescription od, bool isRpc, bool isEncoded)
{
bool hasParameter = false, hasVoid = false;
bool hasVoid = false;
foreach (var md in od.Messages) {
if (md.IsTypedMessage || md.IsUntypedMessage) {
if (isRpc && !isEncoded)
throw new InvalidOperationException ("Message with action {0} is either strongly-typed or untyped, but defined as RPC and encoded.");
if (hasParameter && !md.IsVoid)
throw new InvalidOperationException (String.Format ("Operation '{0}' contains a message with parameters. Strongly-typed or untyped message can be paired only with strongly-typed, untyped or void message.", od.Name));
if (isRpc && hasVoid)
throw new InvalidOperationException (String.Format ("This operation '{0}' is defined as RPC and contains a message with void, which is not allowed.", od.Name));
} else {
hasParameter |= !md.IsVoid;
hasVoid |= md.IsVoid;
}
}

View File

@@ -356,9 +356,12 @@ namespace System.ServiceModel.Dispatcher
owner.Listener.Open (openTimeout);
// It is tested at Open(), but strangely it is not instantiated at this point.
foreach (var ed in owner.Endpoints)
if (ed.DispatchRuntime.InstanceContextProvider == null && (ed.DispatchRuntime.Type == null || ed.DispatchRuntime.Type.GetConstructor (Type.EmptyTypes) == null))
foreach (var ed in owner.Endpoints) {
if ((ed.DispatchRuntime.InstanceProvider == null && ed.DispatchRuntime.InstanceContextProvider == null)
&& (ed.DispatchRuntime.Type == null || ed.DispatchRuntime.Type.GetConstructor (Type.EmptyTypes) == null)) {
throw new InvalidOperationException ("There is no default constructor for the service Type in the DispatchRuntime");
}
}
SetupChannelAcceptor ();
}
@@ -623,9 +626,8 @@ namespace System.ServiceModel.Dispatcher
} finally {
if (rc != null)
rc.Close ();
// unless it is closed by session/call manager, move it back to the loop to receive the next message.
if (loop && reply.State != CommunicationState.Closed)
ProcessRequestOrInput (reply);
reply.Close (owner.DefaultCloseTimeout); // close the channel
}
}

View File

@@ -1,6 +1,8 @@
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/SR.cs
../../build/common/MonoTODOAttribute.cs
corefx/SR.cs
Assembly/AssemblyInfo.cs
Mono.CodeGeneration/CodeAdd.cs
Mono.CodeGeneration/CodeAnd.cs
@@ -951,42 +953,9 @@ System.ServiceModel/XmlSerializerFormatAttribute.cs
System.ServiceModel.Channels/IHttpCookieContainer.cs
System.ServiceModel.Channels/HttpCookieContainerBindingElement.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Atom10FeedFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Atom10FeedFormatter_1.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Atom10ItemFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Atom10ItemFormatter_1.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/AtomPub10CategoriesDocumentFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/AtomPub10ServiceDocumentFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/AtomPub10ServiceDocumentFormatter_1.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/CategoriesDocument.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/CategoriesDocumentFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/ISyndicationElement.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/InlineCategoriesDocument.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/ReferencedCategoriesDocument.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/ResourceCollectionInfo.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Rss20FeedFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Rss20FeedFormatter_1.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Rss20ItemFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Rss20ItemFormatter_1.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/ServiceDocument.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/ServiceDocumentFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationCategory.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationContent.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationElementExtension.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationElementExtensionCollection.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationExtensions.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationFeed.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationFeedFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationItem.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationItemFormatter.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationLink.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationPerson.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/SyndicationVersions.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/TextSyndicationContent.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/TextSyndicationContentKind.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/UrlSyndicationContent.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/Workspace.cs
../System.ServiceModel.Web/System.ServiceModel.Syndication/XmlSyndicationContent.cs
../../../external/corefx/src/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/*.cs
../../../external/corefx/src/System.ServiceModel.Syndication/src/System/ServiceModel/Channels/*.cs
../../../external/corefx/src/System.ServiceModel.Syndication/src/System/ServiceModel/*.cs
../System.ServiceModel.Web/System/UriTemplate.cs
../System.ServiceModel.Web/System/UriTemplateEquivalenceComparer.cs
../System.ServiceModel.Web/System/UriTemplateMatch.cs

View File

@@ -129,6 +129,7 @@ System.ServiceModel.Dispatcher/ActionFilterTest.cs
System.ServiceModel.Dispatcher/Bug652331Test.cs
System.ServiceModel.Dispatcher/Bug652331_2Test.cs
System.ServiceModel.Dispatcher/Bug32886Test.cs
System.ServiceModel.Dispatcher/Bug46971Test.cs
System.ServiceModel.Dispatcher/ChannelDispatcherTest.cs
System.ServiceModel.Dispatcher/DispatchOperationTest.cs
System.ServiceModel.Dispatcher/DispatchRuntimeTest.cs

View File

@@ -1087,6 +1087,28 @@ namespace MonoTests.System.ServiceModel.Description
Assert.IsTrue (cd.Name == "IS");
}
[Test]
public void GetContractWithInterface()
{
var contractType = typeof(IDisposableService);
var serviceType = typeof(DisposableService);
var cd = ContractDescription.GetContract (contractType, serviceType);
Assert.IsNotNull(cd);
Assert.IsTrue (cd.Name == "IDisposableService");
}
[ServiceContract]
private interface IDisposableService : IDisposable
{
}
private class DisposableService : IDisposableService
{
public void Dispose()
{
}
}
}
}
#endif

View File

@@ -0,0 +1,122 @@
//
// Author:
// Andoni Morales Alastruey <ylatuya@gmail.com>
//
// Copyright (c) 2017 Andoni Morales Alastruey.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if !MOBILE && !XAMMAC_4_5
using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Threading.Tasks;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Dispatcher
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1590.0")]
[global::System.SerializableAttribute()]
[global::System.Diagnostics.DebuggerStepThroughAttribute()]
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.onvif.org/ver10/schema")]
public partial class VideoSource
{
}
[global::System.Diagnostics.DebuggerStepThroughAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
[global::System.ServiceModel.MessageContractAttribute(WrapperName = "GetVideoSources", WrapperNamespace = "http://www.onvif.org/ver10/media/wsdl", IsWrapped = true)]
public partial class GetVideoSourcesRequest
{
}
[global::System.Diagnostics.DebuggerStepThroughAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
[global::System.ServiceModel.MessageContractAttribute(WrapperName = "GetVideoSourcesResponse", WrapperNamespace = "http://www.onvif.org/ver10/media/wsdl", IsWrapped = true)]
public partial class GetVideoSourcesResponse
{
[global::System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://www.onvif.org/ver10/media/wsdl", Order = 0)]
[global::System.Xml.Serialization.XmlElementAttribute("VideoSources")]
public VideoSource[] VideoSources;
public GetVideoSourcesResponse()
{
}
public GetVideoSourcesResponse(VideoSource[] VideoSources)
{
this.VideoSources = VideoSources;
}
}
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[global::System.ServiceModel.ServiceContractAttribute(Namespace = "http://www.onvif.org/ver10/media/wsdl", ConfigurationName = "Media.Media")]
public interface IMedia
{
// CODEGEN: Parameter 'VideoSources' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlElementAttribute'.
[global::System.ServiceModel.OperationContractAttribute(Action = "http://www.onvif.org/ver10/media/wsdl/GetVideoSources/")]
[global::System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults = true)]
[return: global::System.ServiceModel.MessageParameterAttribute(Name = "VideoSources")]
GetVideoSourcesResponse GetVideoSources(GetVideoSourcesRequest request);
[global::System.ServiceModel.OperationContractAttribute(Action = "http://www.onvif.org/ver10/media/wsdl/GetVideoSources/")]
Task<GetVideoSourcesResponse> GetVideoSourcesAsync(GetVideoSourcesRequest request);
}
public class MediaService : IMedia
{
[return: MessageParameter(Name = "VideoSources")]
public GetVideoSourcesResponse GetVideoSources(GetVideoSourcesRequest request)
{
var response = new GetVideoSourcesResponse();
response.VideoSources = new VideoSource[] { new VideoSource () };
return response;
}
public Task<GetVideoSourcesResponse> GetVideoSourcesAsync(GetVideoSourcesRequest request)
{
return Task.FromResult(GetVideoSources(request));
}
}
[TestFixture]
public class Bug46971
{
[Test]
public void Bug46971_Test ()
{
// Init service
int port = NetworkHelpers.FindFreePort ();
ServiceHost serviceHost = new ServiceHost (typeof (MediaService), new Uri ("http://localhost:" + port + "/Onvif/service_media"));
try {
serviceHost.Open ();
serviceHost.Close ();
} catch (Exception ex) {
Assert.Fail (ex.Message);
}
}
}
}
#endif

View File

@@ -0,0 +1,56 @@
//
// This file was generated by resx2sr tool
//
partial class SR
{
public const string Atom10SpecRequiresTextConstruct = "The Atom10 specification requires '{0}' to have one of these values: \\\"text\\\", \\\"html\\\", \\\"xhtml\\\", however this value is '{1}' in the document being deserialized.";
public const string DocumentFormatterDoesNotHaveDocument = "The document formatter must be configured with a document.";
public const string ErrorInLine = "Error in line {0} position {1}.";
public const string ErrorParsingDateTime = "An error was encountered when parsing a DateTime value in the XML.";
public const string ErrorParsingDocument = "An error was encountered when parsing the document's XML. Refer to the inner exception for more details.";
public const string ErrorParsingFeed = "An error was encountered when parsing the feed's XML. Refer to the inner exception for more details.";
public const string ErrorParsingItem = "An error was encountered when parsing the item's XML. Refer to the inner exception for more details.";
public const string ErrorParsingUri = "An error was encountered when parsing a Uri value in the XML.";
public const string ExtensionNameNotSpecified = "The name of the extension element must be specified.";
public const string FeedAuthorsIgnoredOnWrite = "The feed's authors were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string FeedContributorsIgnoredOnWrite = "The feed's contributors were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string FeedCreatedNullCategory = "The feed created a null category.";
public const string FeedCreatedNullItem = "The feed created a null item.";
public const string FeedCreatedNullPerson = "The feed created a null person.";
public const string FeedFormatterDoesNotHaveFeed = "The syndication feed formatter must be configured with a syndication feed.";
public const string FeedHasNonContiguousItems = "The feed being deserialized has non-contiguous sets of items in it. This is not supported by '{0}'.";
public const string FeedIdIgnoredOnWrite = "The feed's id was not serialized as part of serializing the feed in RSS 2.0 format.";
public const string FeedLinksIgnoredOnWrite = "The feed's links were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string InvalidObjectTypePassed = "The Type of object passed as parameter '{0}' is not derived from {1}. Ensure that the type of object passed is either of type {1} or derived from {1}.";
public const string ItemAuthorsIgnoredOnWrite = "The item's authors were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string ItemContentIgnoredOnWrite = "The item's content was not serialized as part of serializing the feed in RSS 2.0 format.";
public const string ItemContributorsIgnoredOnWrite = "The item's contributors were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string ItemCopyrightIgnoredOnWrite = "The item's copyrights were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string ItemCreatedNullCategory = "The item created a null category.";
public const string ItemCreatedNullPerson = "The item created a null person.";
public const string ItemFormatterDoesNotHaveItem = "The syndication item formatter must be configured with a syndication item.";
public const string ItemLastUpdatedTimeIgnoredOnWrite = "The item's last updated time was not serialized as part of serializing the feed in RSS 2.0 format.";
public const string ItemLinksIgnoredOnWrite = "The item's links were not serialized as part of serializing the feed in RSS 2.0 format.";
public const string OuterElementNameNotSpecified = "The outer element name must be specified.";
public const string OuterNameOfElementExtensionEmpty = "The outer name of the element extension cannot be empty.";
public const string UnbufferedItemsCannotBeCloned = "A feed containing items that are not buffered (i.e. the items are not stored in an IList) cannot clone its items. Buffer the items in the feed before calling Clone on it or pass false to the Clone method.";
public const string UnknownDocumentXml = "The element with name '{0}' and namespace '{1}' is not an allowed document format.";
public const string UnknownFeedXml = "The element with name '{0}' and namespace '{1}' is not an allowed feed format.";
public const string UnknownItemXml = "The element with name '{0}' and namespace '{1}' is not an allowed item format.";
public const string UnsupportedRssVersion = "The Rss20Serializer does not support RSS version '{0}'.";
public const string UriGeneratorSchemeMustNotBeEmpty = "The scheme parameter must not be empty.";
public const string ValueMustBeNonNegative = "The value of this argument must be non-negative.";
public const string XmlBufferInInvalidState = "An internal error has occurred. The XML buffer is not in the correct state to perform the operation.";
public const string XmlFoundCData = "cdata '{0}'";
public const string XmlFoundComment = "comment '{0}'";
public const string XmlFoundElement = "element '{0}' from namespace '{1}'";
public const string XmlFoundEndElement = "end element '{0}' from namespace '{1}'";
public const string XmlFoundEndOfFile = "end of file";
public const string XmlFoundNodeType = "node {0}";
public const string XmlFoundText = "text '{0}'";
public const string XmlLineInfo = "Line {0}, position {1}.";
public const string XmlStartElementExpected = "Start element expected. Found {0}.";
public const string InvalidSkipHourValue = "Cannot parse string `{0}` as skip hour. The value for skip hours must be an integer betwen 0 and 23.";
public const string InvalidTimeToLiveValue = "The value for TimeToLive must be a non-negative whole number of minutes.";
}

View File

@@ -1,5 +1,6 @@
../../build/common/Consts.cs
../../build/common/MonoTODOAttribute.cs
../../build/common/SR.cs
Assembly/AssemblyInfo.cs
Mono.CodeGeneration/CodeAdd.cs
Mono.CodeGeneration/CodeAnd.cs

View File

@@ -1,4 +1,6 @@
#include mobile_System.ServiceModel.dll.sources
../../build/common/SR.cs
corefx/SR.cs
System.ServiceModel.Channels/IChannelListener.cs
System.ServiceModel.Channels/IReplyChannel.cs
System.ServiceModel.Channels/IReplySessionChannel.cs