<section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="standardEndpoints" type="System.ServiceModel.Configuration.StandardEndpointsSection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
+ <section name="routing" type="System.ServiceModel.Routing.Configuration.RoutingSection, System.ServiceModel.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</sectionGroup>
<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<bindingExtensions>
<add name="webHttpBinding" type="System.ServiceModel.Configuration.WebHttpBindingCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</bindingExtensions>
+ <endpointExtensions>
+ <add name="dynamicEndpoint" type="System.ServiceModel.Discovery.Configuration.DynamicEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ <add name="discoveryEndpoint" type="System.ServiceModel.Discovery.Configuration.DiscoveryEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ <add name="udpDiscoveryEndpoint" type="System.ServiceModel.Discovery.Configuration.UdpDiscoveryEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ <add name="announcementEndpoint" type="System.ServiceModel.Discovery.Configuration.AnnouncementEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ <add name="udpAnnouncementEndpoint" type="System.ServiceModel.Discovery.Configuration.UdpAnnouncementEndpointCollectionElement, System.ServiceModel.Discovery, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ <add name="webHttpEndpoint" type="System.ServiceModel.Configuration.WebHttpEndpointCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ <add name="webScriptEndpoint" type="System.ServiceModel.Configuration.WebScriptEndpointCollectionElement, System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ </endpointExtensions>
</extensions>
</system.serviceModel>
</configuration>
#endif
{
Encoding write_encoding;
- XmlDictionaryReaderQuotas reader_quotas;
WebContentTypeMapper content_type_mapper;
int max_read_pool_size = 0x10000, max_write_pool_size = 0x10000;
throw new ArgumentNullException ("writeEncoding");
WriteEncoding = writeEncoding;
#if !NET_2_1
- reader_quotas = new XmlDictionaryReaderQuotas ();
+ ReaderQuotas = new XmlDictionaryReaderQuotas ();
#endif
}
}
}
- public XmlDictionaryReaderQuotas ReaderQuotas {
- get { return reader_quotas; }
- }
+ public XmlDictionaryReaderQuotas ReaderQuotas { get; internal set; }
public Encoding WriteEncoding {
get { return write_encoding; }
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.ComponentModel;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Configuration
+{
+ public class WebHttpEndpointCollectionElement : StandardEndpointCollectionElement<WebHttpEndpoint, WebHttpEndpointElement>
+ {
+ }
+
+}
+
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Reflection;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.ServiceModel.Web;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Configuration
+{
+ public class WebHttpEndpointElement : StandardEndpointElement
+ {
+ static ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection ();
+
+ static ConfigurationProperty content_type_mapper, cross_domain_script_access_enabled, host_name_comparison_mode, max_buffer_pool_size, max_buffer_size, max_received_message_size, reader_quotas, security, transfer_mode, write_encoding, automatic_format_selection_enabled, default_outgoing_response_format, fault_exception_enabled, help_enabled;
+
+ static WebHttpEndpointElement ()
+ {
+ content_type_mapper = new ConfigurationProperty ("contentTypeMapper", typeof (string), "", null, null, ConfigurationPropertyOptions.None);
+ cross_domain_script_access_enabled = new ConfigurationProperty ("crossDomainScriptAccessEnabled", typeof (bool), false, null, null, ConfigurationPropertyOptions.None);
+ host_name_comparison_mode = new ConfigurationProperty ("hostNameComparisonMode", typeof (HostNameComparisonMode), HostNameComparisonMode.StrongWildcard, null, null, ConfigurationPropertyOptions.None);
+ max_buffer_pool_size = new ConfigurationProperty ("maxBufferPoolSize", typeof (long), 0x80000, null, null, ConfigurationPropertyOptions.None);
+ max_buffer_size = new ConfigurationProperty ("maxBufferSize", typeof (int), 0x10000, null, null, ConfigurationPropertyOptions.None);
+ max_received_message_size = new ConfigurationProperty ("maxReceivedMessageSize", typeof (long), 0x10000, null, null, ConfigurationPropertyOptions.None);
+ reader_quotas = new ConfigurationProperty ("readerQuotas", typeof (XmlDictionaryReaderQuotas), null, null, null, ConfigurationPropertyOptions.None);
+ security = new ConfigurationProperty ("security", typeof (WebHttpSecurity), null, null, null, ConfigurationPropertyOptions.None);
+ transfer_mode = new ConfigurationProperty ("transferMode", typeof (TransferMode), TransferMode.Buffered, null, null, ConfigurationPropertyOptions.None);
+ write_encoding = new ConfigurationProperty ("writeEncoding", typeof (Encoding), "utf-8", new EncodingConverter (), null, ConfigurationPropertyOptions.None);
+ automatic_format_selection_enabled = new ConfigurationProperty ("automaticFormatSelectionEnabled", typeof (bool), false, null, null, ConfigurationPropertyOptions.None);
+ default_outgoing_response_format = new ConfigurationProperty ("defaultOutgoingResponseFormat", typeof (WebMessageFormat), WebMessageFormat.Xml, null, null, ConfigurationPropertyOptions.None);
+ fault_exception_enabled = new ConfigurationProperty ("faultExceptionEnabled", typeof (bool), false, null, null, ConfigurationPropertyOptions.None);
+ help_enabled = new ConfigurationProperty ("helpEnabled", typeof (bool), false, null, null, ConfigurationPropertyOptions.None);
+
+ foreach (var item in new ConfigurationProperty [] {content_type_mapper, cross_domain_script_access_enabled, host_name_comparison_mode, max_buffer_pool_size, max_buffer_size, max_received_message_size, reader_quotas, security, transfer_mode, write_encoding, automatic_format_selection_enabled, default_outgoing_response_format, fault_exception_enabled, help_enabled})
+ properties.Add (item);
+ }
+
+ protected internal override Type EndpointType {
+ get { return typeof (WebHttpEndpoint); }
+ }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get { return properties; }
+ }
+
+ [ConfigurationProperty ("contentTypeMapper", DefaultValue = "")]
+ [StringValidator (MinLength = 0)]
+ public string ContentTypeMapper {
+ get { return (string) this ["contentTypeMapper"]; }
+ set { this ["contentTypeMapper"] = value; }
+ }
+
+ [ConfigurationProperty ("crossDomainScriptAccessEnabled", DefaultValue = false)]
+ public bool CrossDomainScriptAccessEnabled {
+ get { return (bool) this ["crossDomainScriptAccessEnabled"]; }
+ set { this ["crossDomainScriptAccessEnabled"] = value; }
+ }
+
+ [ConfigurationProperty ("hostNameComparisonMode", DefaultValue = HostNameComparisonMode.StrongWildcard)]
+ public HostNameComparisonMode HostNameComparisonMode {
+ get { return (HostNameComparisonMode) this ["hostNameComparisonMode"]; }
+ set { this ["hostNameComparisonMode"] = value; }
+ }
+
+ [LongValidator (MinValue = 0, MaxValue = long.MaxValue, ExcludeRange = false)]
+ [ConfigurationProperty ("maxBufferPoolSize", DefaultValue = 0x80000,
+ Options = ConfigurationPropertyOptions.None)]
+ public long MaxBufferPoolSize {
+ get { return (long) this ["maxBufferPoolSize"]; }
+ set { this ["maxBufferPoolSize"] = value; }
+ }
+
+ [IntegerValidator ( MinValue = 1,
+ MaxValue = int.MaxValue,
+ ExcludeRange = false)]
+ [ConfigurationProperty ("maxBufferSize", DefaultValue = 0x10000,
+ Options = ConfigurationPropertyOptions.None)]
+ public int MaxBufferSize {
+ get { return (int) this ["maxBufferSize"]; }
+ set { this ["maxBufferSize"] = value; }
+ }
+
+ [LongValidator ( MinValue = 1, MaxValue = long.MaxValue, ExcludeRange = false)]
+ [ConfigurationProperty ("maxReceivedMessageSize", DefaultValue = 0x10000,
+ Options = ConfigurationPropertyOptions.None)]
+ public long MaxReceivedMessageSize {
+ get { return (long) this ["maxReceivedMessageSize"]; }
+ set { this ["maxReceivedMessageSize"] = value; }
+ }
+
+ [ConfigurationProperty ("readerQuotas")]
+ public XmlDictionaryReaderQuotasElement ReaderQuotas {
+ get { return (XmlDictionaryReaderQuotasElement) this ["readerQuotas"]; }
+ }
+
+ [ConfigurationProperty ("security")]
+ public WebHttpSecurityElement Security {
+ get { return (WebHttpSecurityElement) this ["security"]; }
+ }
+
+ [ConfigurationProperty ("transferMode", DefaultValue = TransferMode.Buffered)]
+ public TransferMode TransferMode {
+ get { return (TransferMode) this ["transferMode"]; }
+ set { this ["transferMode"] = value; }
+ }
+
+ [TypeConverter (typeof (EncodingConverter))]
+ [ConfigurationProperty ("writeEncoding", DefaultValue = "utf-8")]
+ public Encoding WriteEncoding {
+ get { return (Encoding) this ["writeEncoding"]; }
+ set { this ["writeEncoding"] = value; }
+ }
+
+
+ [ConfigurationProperty ("automaticFormatSelectionEnabled", DefaultValue = false)]
+ public bool AutomaticFormatSelectionEnabled {
+ get { return (bool) this ["automaticFormatSelectionEnabled"]; }
+ set { this ["automaticFormatSelectionEnabled"] = value; }
+ }
+
+ [ConfigurationProperty ("defaultOutgoingResponseFormat", DefaultValue = WebMessageFormat.Xml)]
+ public WebMessageFormat DefaultOutgoingResponseFormat {
+ get { return (WebMessageFormat) this ["defaultOutgoingResponseFormat"]; }
+ set { this ["defaultOutgoingResponseFormat"] = value; }
+ }
+
+ [ConfigurationProperty ("faultExceptionEnabled", DefaultValue = false)]
+ public bool FaultExceptionEnabled {
+ get { return (bool) this ["faultExceptionEnabled"]; }
+ set { this ["faultExceptionEnabled"] = value; }
+ }
+
+ [ConfigurationProperty ("helpEnabled", DefaultValue = false)]
+ public bool HelpEnabled {
+ get { return (bool) this ["helpEnabled"]; }
+ set { this ["helpEnabled"] = value; }
+ }
+
+
+ protected internal override ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.ComponentModel;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Configuration
+{
+ public class WebScriptEndpointCollectionElement : StandardEndpointCollectionElement<WebScriptEndpoint, WebScriptEndpointElement>
+ {
+ }
+
+}
+
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Reflection;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.ServiceModel.Web;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Configuration
+{
+ public class WebScriptEndpointElement : StandardEndpointElement
+ {
+ static ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection ();
+
+ static ConfigurationProperty content_type_mapper, cross_domain_script_access_enabled, host_name_comparison_mode, max_buffer_pool_size, max_buffer_size, max_received_message_size, reader_quotas, security, transfer_mode, write_encoding;
+
+ static WebScriptEndpointElement ()
+ {
+ content_type_mapper = new ConfigurationProperty ("contentTypeMapper", typeof (string), "", null, null, ConfigurationPropertyOptions.None);
+ cross_domain_script_access_enabled = new ConfigurationProperty ("crossDomainScriptAccessEnabled", typeof (bool), false, null, null, ConfigurationPropertyOptions.None);
+ host_name_comparison_mode = new ConfigurationProperty ("hostNameComparisonMode", typeof (HostNameComparisonMode), HostNameComparisonMode.StrongWildcard, null, null, ConfigurationPropertyOptions.None);
+ max_buffer_pool_size = new ConfigurationProperty ("maxBufferPoolSize", typeof (long), 0x80000, null, null, ConfigurationPropertyOptions.None);
+ max_buffer_size = new ConfigurationProperty ("maxBufferSize", typeof (int), 0x10000, null, null, ConfigurationPropertyOptions.None);
+ max_received_message_size = new ConfigurationProperty ("maxReceivedMessageSize", typeof (long), 0x10000, null, null, ConfigurationPropertyOptions.None);
+ reader_quotas = new ConfigurationProperty ("readerQuotas", typeof (XmlDictionaryReaderQuotas), null, null, null, ConfigurationPropertyOptions.None);
+ security = new ConfigurationProperty ("security", typeof (WebHttpSecurity), null, null, null, ConfigurationPropertyOptions.None);
+ transfer_mode = new ConfigurationProperty ("transferMode", typeof (TransferMode), TransferMode.Buffered, null, null, ConfigurationPropertyOptions.None);
+ write_encoding = new ConfigurationProperty ("writeEncoding", typeof (Encoding), "utf-8", new EncodingConverter (), null, ConfigurationPropertyOptions.None);
+
+ foreach (var item in new ConfigurationProperty [] {content_type_mapper, cross_domain_script_access_enabled, host_name_comparison_mode, max_buffer_pool_size, max_buffer_size, max_received_message_size, reader_quotas, security, transfer_mode, write_encoding})
+ properties.Add (item);
+ }
+
+ protected internal override Type EndpointType {
+ get { return typeof (WebScriptEndpoint); }
+ }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get { return properties; }
+ }
+
+ [ConfigurationProperty ("contentTypeMapper", DefaultValue = "")]
+ [StringValidator (MinLength = 0)]
+ public string ContentTypeMapper {
+ get { return (string) this ["contentTypeMapper"]; }
+ set { this ["contentTypeMapper"] = value; }
+ }
+
+ [ConfigurationProperty ("crossDomainScriptAccessEnabled", DefaultValue = false)]
+ public bool CrossDomainScriptAccessEnabled {
+ get { return (bool) this ["crossDomainScriptAccessEnabled"]; }
+ set { this ["crossDomainScriptAccessEnabled"] = value; }
+ }
+
+ [ConfigurationProperty ("hostNameComparisonMode", DefaultValue = HostNameComparisonMode.StrongWildcard)]
+ public HostNameComparisonMode HostNameComparisonMode {
+ get { return (HostNameComparisonMode) this ["hostNameComparisonMode"]; }
+ set { this ["hostNameComparisonMode"] = value; }
+ }
+
+ [LongValidator (MinValue = 0, MaxValue = long.MaxValue, ExcludeRange = false)]
+ [ConfigurationProperty ("maxBufferPoolSize", DefaultValue = 0x80000,
+ Options = ConfigurationPropertyOptions.None)]
+ public long MaxBufferPoolSize {
+ get { return (long) this ["maxBufferPoolSize"]; }
+ set { this ["maxBufferPoolSize"] = value; }
+ }
+
+ [IntegerValidator ( MinValue = 1,
+ MaxValue = int.MaxValue,
+ ExcludeRange = false)]
+ [ConfigurationProperty ("maxBufferSize", DefaultValue = 0x10000,
+ Options = ConfigurationPropertyOptions.None)]
+ public int MaxBufferSize {
+ get { return (int) this ["maxBufferSize"]; }
+ set { this ["maxBufferSize"] = value; }
+ }
+
+ [LongValidator ( MinValue = 1, MaxValue = long.MaxValue, ExcludeRange = false)]
+ [ConfigurationProperty ("maxReceivedMessageSize", DefaultValue = 0x10000,
+ Options = ConfigurationPropertyOptions.None)]
+ public long MaxReceivedMessageSize {
+ get { return (long) this ["maxReceivedMessageSize"]; }
+ set { this ["maxReceivedMessageSize"] = value; }
+ }
+
+ [ConfigurationProperty ("readerQuotas")]
+ public XmlDictionaryReaderQuotasElement ReaderQuotas {
+ get { return (XmlDictionaryReaderQuotasElement) this ["readerQuotas"]; }
+ }
+
+ [ConfigurationProperty ("security")]
+ public WebHttpSecurityElement Security {
+ get { return (WebHttpSecurityElement) this ["security"]; }
+ }
+
+ [ConfigurationProperty ("transferMode", DefaultValue = TransferMode.Buffered)]
+ public TransferMode TransferMode {
+ get { return (TransferMode) this ["transferMode"]; }
+ set { this ["transferMode"] = value; }
+ }
+
+ [TypeConverter (typeof (EncodingConverter))]
+ [ConfigurationProperty ("writeEncoding", DefaultValue = "utf-8")]
+ public Encoding WriteEncoding {
+ get { return (Encoding) this ["writeEncoding"]; }
+ set { this ["writeEncoding"] = value; }
+ }
+
+ protected internal override ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
DefaultOutgoingResponseFormat = WebMessageFormat.Xml;
}
+#if NET_4_0
+ public virtual bool AutomaticFormatSelectionEnabled { get; set; }
+
+ public virtual bool FaultExceptionEnabled { get; set; }
+
+ public virtual bool HelpEnabled { get; set; }
+#endif
+
public virtual WebMessageBodyStyle DefaultBodyStyle { get; set; }
public virtual WebMessageFormat DefaultOutgoingRequestFormat { get; set; }
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+using System;
+using System.Collections.ObjectModel;
+using System.Runtime.Serialization;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Web;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Description
+{
+ [MonoTODO]
+ public class WebHttpEndpoint : WebServiceEndpoint
+ {
+ public WebHttpEndpoint (ContractDescription contract)
+ : this (contract, null)
+ {
+ }
+
+ public WebHttpEndpoint (ContractDescription contract, EndpointAddress address)
+ : base (contract, address)
+ {
+ }
+
+ WebHttpBehavior wb {
+ get {
+ var b = Behaviors.Find<WebHttpBehavior> ();
+ if (b != null)
+ return b;
+ throw new InvalidOperationException ("The preset WebHttpBehavior was unexpectedly removed.");
+ }
+ }
+
+ public bool AutomaticFormatSelectionEnabled {
+ get { return wb.AutomaticFormatSelectionEnabled; }
+ set { wb.AutomaticFormatSelectionEnabled = value; }
+ }
+
+ public WebMessageFormat DefaultOutgoingResponseFormat {
+ get { return wb.DefaultOutgoingResponseFormat; }
+ set { wb.DefaultOutgoingResponseFormat = value; }
+ }
+
+ public bool FaultExceptionEnabled {
+ get { return wb.FaultExceptionEnabled; }
+ set { wb.FaultExceptionEnabled = value; }
+ }
+
+ public bool HelpEnabled {
+ get { return wb.HelpEnabled; }
+ set { wb.HelpEnabled = value; }
+ }
+
+ protected override Type WebEndpointType {
+ get { throw new NotImplementedException (); }
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+using System;
+using System.Collections.ObjectModel;
+using System.Runtime.Serialization;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+
+namespace System.ServiceModel.Description
+{
+ [MonoTODO]
+ public class WebScriptEndpoint : WebServiceEndpoint
+ {
+ public WebScriptEndpoint (ContractDescription contract)
+ : this (contract, null)
+ {
+ }
+
+ public WebScriptEndpoint (ContractDescription contract, EndpointAddress address)
+ : base (contract, address)
+ {
+ }
+
+ protected override Type WebEndpointType {
+ get { throw new NotImplementedException (); }
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+using System;
+using System.Collections.ObjectModel;
+using System.Runtime.Serialization;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Web;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Description
+{
+ public abstract class WebServiceEndpoint : ServiceEndpoint
+ {
+ internal WebServiceEndpoint (ContractDescription contract, EndpointAddress address)
+ : base (contract, new WebHttpBinding (), address)
+ {
+ Behaviors.Add (new WebHttpBehavior ());
+ }
+
+ protected abstract Type WebEndpointType { get; }
+
+ WebHttpBinding wbind {
+ get {
+ if (Binding is WebHttpBinding)
+ return (WebHttpBinding) Binding;
+ throw new InvalidOperationException ("Binding on this standard endpoint is not supposed to be overwritten.");
+ }
+ }
+
+ public WebContentTypeMapper ContentTypeMapper {
+ get { return wbind.ContentTypeMapper; }
+ set { wbind.ContentTypeMapper = value; }
+ }
+
+ public bool CrossDomainScriptAccessEnabled {
+ get { return wbind.CrossDomainScriptAccessEnabled; }
+ set { wbind.CrossDomainScriptAccessEnabled = value; }
+ }
+
+ public HostNameComparisonMode HostNameComparisonMode {
+ get { return wbind.HostNameComparisonMode; }
+ set { wbind.HostNameComparisonMode = value; }
+ }
+
+ public long MaxBufferPoolSize {
+ get { return wbind.MaxBufferPoolSize; }
+ set { wbind.MaxBufferPoolSize = value; }
+ }
+
+ public int MaxBufferSize {
+ get { return wbind.MaxBufferSize; }
+ set { wbind.MaxBufferSize = value; }
+ }
+
+ public long MaxReceivedMessageSize {
+ get { return wbind.MaxReceivedMessageSize; }
+ set { wbind.MaxReceivedMessageSize = value; }
+ }
+
+ public XmlDictionaryReaderQuotas ReaderQuotas {
+ get { return wbind.ReaderQuotas; }
+ set { wbind.ReaderQuotas = value; }
+ }
+
+ public WebHttpSecurity Security {
+ get { return wbind.Security; }
+ }
+
+ public TransferMode TransferMode {
+ get { return wbind.TransferMode; }
+ set { wbind.TransferMode = value; }
+ }
+
+ public Encoding WriteEncoding {
+ get { return wbind.WriteEncoding; }
+ set { wbind.WriteEncoding = value; }
+ }
+ }
+}
+#endif
System.ServiceModel.Channels/WebMessageEncodingBindingElementTest.cs
System.ServiceModel.Configuration/WebHttpBindingElementTest.cs
System.ServiceModel.Description/WebHttpBehaviorTest.cs
+System.ServiceModel.Description/WebHttpEndpointTest.cs
System.ServiceModel.Description/WebScriptEnablingBehaviorTest.cs
System.ServiceModel.Dispatcher/JsonQueryStringConverterTest.cs
System.ServiceModel.Dispatcher/QueryStringConverterTest.cs
throw new NotImplementedException ();
}
- XmlDictionaryReaderQuotas quotas;
WebHttpSecurity security = new WebHttpSecurity ();
- Encoding write_encoding = Encoding.UTF8;
HttpTransportBindingElement t;
// This can be changed only using <synchronousReceive> configuration element.
bool receive_synchronously;
+ WebMessageEncodingBindingElement msgenc = new WebMessageEncodingBindingElement ();
public EnvelopeVersion EnvelopeVersion {
get { return EnvelopeVersion.None; }
set { t.BypassProxyOnLocal = value; }
}
+#if NET_4_0
+ [MonoTODO]
+ public bool CrossDomainScriptAccessEnabled { get; set; }
+
+ public WebContentTypeMapper ContentTypeMapper {
+ get { return msgenc.ContentTypeMapper; }
+ set { msgenc.ContentTypeMapper = value; }
+ }
+#endif
+
public HostNameComparisonMode HostNameComparisonMode {
get { return t.HostNameComparisonMode; }
set { t.HostNameComparisonMode = value; }
#if !NET_2_1
public XmlDictionaryReaderQuotas ReaderQuotas {
- get { return quotas; }
- set { quotas = value; }
+ get { return msgenc.ReaderQuotas; }
+ set { msgenc.ReaderQuotas = value; }
}
#endif
}
public Encoding WriteEncoding {
- get { return write_encoding; }
+ get { return msgenc.WriteEncoding; }
set {
if (value == null)
throw new ArgumentNullException ("value");
- write_encoding = value;
+ msgenc.WriteEncoding = value;
}
}
public override BindingElementCollection CreateBindingElements ()
{
- WebMessageEncodingBindingElement m = new WebMessageEncodingBindingElement (WriteEncoding);
-#if !NET_2_1
- if (ReaderQuotas != null)
- ReaderQuotas.CopyTo (m.ReaderQuotas);
-#endif
-
- return new BindingElementCollection (new BindingElement [] { m, t.Clone () });
+ return new BindingElementCollection (new BindingElement [] { msgenc, t.Clone () });
}
#if !NET_2_1
--- /dev/null
+#if NET_4_0
+using System;
+using System.IO;
+using System.Runtime.Serialization;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Web;
+using System.Text;
+using NUnit.Framework;
+
+namespace MonoTests.System.ServiceModel.Description
+{
+ [TestFixture]
+ public class WebHttpEndpointTest
+ {
+ [Test]
+ public void ReplaceBinding1 ()
+ {
+ var se = new WebHttpEndpoint (ContractDescription.GetContract (typeof (IMetadataExchange)), null);
+ se.Binding = new NetTcpBinding (); // this does not throw exception yet.
+ }
+
+ [Test]
+ [ExpectedException (typeof (InvalidOperationException))]
+ public void ReplaceBinding2 ()
+ {
+ var se = new WebHttpEndpoint (ContractDescription.GetContract (typeof (IMetadataExchange)), null);
+ se.Binding = new NetTcpBinding ();
+ se.WriteEncoding = Encoding.UTF8;
+ }
+ }
+}
+#endif
maxReceivedMessageSize="16384"
proxyAddress="proxy"
writeEncoding="unicode"
- transferMode="streamed">
+ transferMode="Streamed">
<security mode="TransportCredentialOnly">
<transport
clientCredentialType="Basic"
- proxyCredentialType="NTLM"
+ proxyCredentialType="Ntlm"
realm="realm" />
</security>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
-</configuration>
\ No newline at end of file
+</configuration>
System.ServiceModel.Configuration/WebHttpBindingCollectionElement.cs
System.ServiceModel.Configuration/WebHttpBindingElement.cs
System.ServiceModel.Configuration/WebHttpElement.cs
+System.ServiceModel.Configuration/WebHttpEndpointCollectionElement.cs
+System.ServiceModel.Configuration/WebHttpEndpointElement.cs
System.ServiceModel.Configuration/WebHttpSecurityElement.cs
System.ServiceModel.Configuration/WebMessageEncodingElement.cs
System.ServiceModel.Configuration/WebScriptEnablingElement.cs
+System.ServiceModel.Configuration/WebScriptEndpointCollectionElement.cs
+System.ServiceModel.Configuration/WebScriptEndpointElement.cs
System.ServiceModel.Description/WebHttpBehavior.cs
+System.ServiceModel.Description/WebHttpEndpoint.cs
System.ServiceModel.Description/WebScriptEnablingBehavior.cs
+System.ServiceModel.Description/WebScriptEndpoint.cs
+System.ServiceModel.Description/WebServiceEndpoint.cs
System.ServiceModel.Dispatcher/JsonQueryStringConverter.cs
System.ServiceModel.Dispatcher/QueryStringConverter.cs
System.ServiceModel.Dispatcher/WebHttpDispatchOperationSelector.cs
get { return (ExtensionElementCollection) base ["bindingExtensions"]; }
}
+#if NET_4_0
+ [ConfigurationProperty ("endpointExtensions",
+ Options = ConfigurationPropertyOptions.None)]
+ public ExtensionElementCollection EndpointExtensions {
+ get { return (ExtensionElementCollection) base ["endpointExtensions"]; }
+ }
+#endif
+
protected override ConfigurationPropertyCollection Properties {
get {
if (_properties == null) {
_properties.Add (new ConfigurationProperty ("behaviorExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("bindingElementExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("bindingExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
+#if NET_4_0
+ _properties.Add (new ConfigurationProperty ("endpointExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
+#endif
}
return _properties;
}
InitializeBehaviorExtensionsDefault ();
InitializeBindingElementExtensionsDefault ();
InitializeBindingExtensionsDefault ();
+#if NET_4_0
+ InitializeEndpointExtensionsDefault ();
+#endif
}
void InitializeBindingExtensionsDefault () {
BehaviorExtensions.Add (new ExtensionElement ("transactedBatching", typeof (TransactedBatchingElement).AssemblyQualifiedName));
}
+#if NET_4_0
+ void InitializeEndpointExtensionsDefault () {
+ EndpointExtensions.Add (new ExtensionElement ("mexEndpoint", typeof (ServiceMetadataEndpointCollectionElement).AssemblyQualifiedName));
+ }
+#endif
}
}
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.ComponentModel;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Configuration
+{
+ public class ServiceMetadataEndpointCollectionElement : StandardEndpointCollectionElement<ServiceMetadataEndpoint, ServiceMetadataEndpointElement>
+ {
+ }
+
+}
+
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Net;
+using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Principal;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Configuration
+{
+ public class ServiceMetadataEndpointElement : StandardEndpointElement
+ {
+ static ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection ();
+
+ static ServiceMetadataEndpointElement ()
+ {
+ foreach (var item in new ConfigurationProperty [] {})
+ properties.Add (item);
+ }
+
+ protected internal override Type EndpointType {
+ get { return typeof (ServiceMetadataEndpoint); }
+ }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get { return properties; }
+ }
+
+ protected internal override ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
public ServicesSection Services {
get { return (ServicesSection) Sections ["services"]; }
}
+
+#if NET_4_0
+ public StandardEndpointsSection StandardEndpoints {
+ get { return (StandardEndpointsSection) Sections ["standardEndpoints"]; }
+ }
+#endif
}
}
--- /dev/null
+//
+// BindingsSection.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Net;
+using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Principal;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Configuration
+{
+ public sealed class StandardEndpointsSection : ConfigurationSection
+ {
+ ConfigurationPropertyCollection _properties;
+
+ // Properties
+
+ List<EndpointCollectionElement> endpoint_collections;
+
+ public List<EndpointCollectionElement> EndpointCollections {
+ get {
+ if (endpoint_collections != null)
+ return endpoint_collections;
+ var list = new List<EndpointCollectionElement> ();
+ foreach (ConfigurationProperty cp in Properties)
+ list.Add ((EndpointCollectionElement) this [cp]);
+ endpoint_collections = list;
+ return list;
+ }
+ }
+
+
+ [ConfigurationProperty ("mexEndpoint", Options = ConfigurationPropertyOptions.None)]
+ public ServiceMetadataEndpointCollectionElement MexEndpoint {
+ get { return (ServiceMetadataEndpointCollectionElement) this ["mexEndpoint"]; }
+ }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get {
+ if (_properties == null) {
+ _properties = new ConfigurationPropertyCollection ();
+ ExtensionElementCollection extensions = ((ExtensionsSection) EvaluationContext.GetSection ("system.serviceModel/extensions")).EndpointExtensions;
+ for (int i = 0; i < extensions.Count; i++) {
+ ExtensionElement extension = extensions [i];
+ _properties.Add (new ConfigurationProperty (extension.Name, Type.GetType (extension.Type), null, null, null, ConfigurationPropertyOptions.None));
+ }
+ }
+ return _properties;
+ }
+ }
+
+ public static StandardEndpointsSection GetSection (System.Configuration.Configuration config) {
+ ServiceModelSectionGroup sm = ServiceModelSectionGroup.GetSectionGroup (config);
+ if (sm == null)
+ throw new SystemException ("Could not retrieve configuration section group 'system.serviceModel'");
+ if (sm.StandardEndpoints == null)
+ throw new SystemException ("Could not retrieve configuration sub section group 'standardEndpoints' in 'system.serviceModel'");
+ return sm.StandardEndpoints;
+ }
+
+ public new EndpointCollectionElement this [string name] {
+ get {
+ object element = base [name];
+ if (element is EndpointCollectionElement)
+ return (EndpointCollectionElement) element;
+ throw new ArgumentException (String.Format ("Could not find {0}", name));
+ }
+ }
+
+ }
+
+}
+
+#endif
--- /dev/null
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// 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 NET_4_0
+using System;
+using System.Collections.ObjectModel;
+using System.Runtime.Serialization;
+using System.ServiceModel.Channels;
+
+namespace System.ServiceModel.Description
+{
+ public class ServiceMetadataEndpoint : ServiceEndpoint
+ {
+ public ServiceMetadataEndpoint ()
+ : this (null)
+ {
+ }
+
+ public ServiceMetadataEndpoint (EndpointAddress address)
+ : this (MetadataExchangeBindings.CreateMexHttpBinding (), address)
+ {
+ }
+
+ public ServiceMetadataEndpoint (Binding binding, EndpointAddress address)
+ : base (ContractDescription.GetContract (typeof (IMetadataExchange)), binding, address)
+ {
+ }
+ }
+}
+
+#endif
System.ServiceModel.Configuration/ServiceEndpointElement.cs
System.ServiceModel.Configuration/ServiceEndpointElementCollection.cs
System.ServiceModel.Configuration/ServiceHostingEnvironmentSection.cs
+System.ServiceModel.Configuration/ServiceMetadataEndpointCollectionElement.cs
+System.ServiceModel.Configuration/ServiceMetadataEndpointElement.cs
System.ServiceModel.Configuration/ServiceMetadataPublishingElement.cs
System.ServiceModel.Configuration/ServiceModelConfigurationElementCollection.cs
System.ServiceModel.Configuration/ServiceModelEnhancedConfigurationElementCollection.cs
System.ServiceModel.Configuration/StandardEndpointCollectionElement.cs
System.ServiceModel.Configuration/StandardEndpointElement.cs
System.ServiceModel.Configuration/StandardEndpointElementCollection.cs
+System.ServiceModel.Configuration/StandardEndpointsSection.cs
System.ServiceModel.Configuration/SynchronousReceiveElement.cs
System.ServiceModel.Configuration/TcpConnectionPoolSettingsElement.cs
System.ServiceModel.Configuration/TcpTransportElement.cs
System.ServiceModel.Description/ServiceEndpoint.cs
System.ServiceModel.Description/ServiceEndpointCollection.cs
System.ServiceModel.Description/ServiceMetadataBehavior.cs
+System.ServiceModel.Description/ServiceMetadataEndpoint.cs
System.ServiceModel.Description/ServiceMetadataExtension.cs
System.ServiceModel.Description/ServiceSecurityAuditBehavior.cs
System.ServiceModel.Description/ServiceThrottlingBehavior.cs
System.ServiceModel.Configuration/StandardBindingCollectionElementTest.cs
System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
System.ServiceModel.Configuration/StandardBindingElementTest.cs
+System.ServiceModel.Configuration/StandardEndpointsSectionTest.cs
System.ServiceModel.Configuration/UserBinding.cs
System.ServiceModel.Description/ClientCredentialsTest.cs
System.ServiceModel.Description/ContractDescriptionTest.cs
System.ServiceModel.Description/ServiceDebugBehaviorTest.cs
System.ServiceModel.Description/ServiceEndpointTest.cs
System.ServiceModel.Description/ServiceMetadataBehaviorTest.cs
+System.ServiceModel.Description/ServiceMetadataEndpointTest.cs
System.ServiceModel.Description/ServiceThrottlingBehaviorTest.cs
System.ServiceModel.Description/TypedMessageConverterTest.cs
System.ServiceModel.Description/WsdlExporterTest.cs
--- /dev/null
+//
+// StandardEndpointsSectionTest.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+using System.ServiceModel;
+using System.ServiceModel.Configuration;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Channels;
+
+namespace MonoTests.System.ServiceModel.Configuration
+{
+ [TestFixture]
+ public class StandardEndpointsSectionTest
+ {
+ [Test]
+ public void ServiceMetadataExists ()
+ {
+ var cfg = ConfigurationManager.OpenMachineConfiguration ();
+ Assert.IsNotNull (StandardEndpointsSection.GetSection (cfg).EndpointCollections.FirstOrDefault (e => e is ServiceMetadataEndpointCollectionElement), "#1");
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// ServiceEndpointTest.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2009 Novell, Inc. http://novell.com
+//
+// 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 NET_4_0
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.Channels;
+
+namespace MonoTests.System.ServiceModel.Description
+{
+ [TestFixture]
+ public class ServiceMetadataEndpointTest
+ {
+ [Test]
+ public void DefaultValues ()
+ {
+ var se = new ServiceMetadataEndpoint ();
+ Assert.IsNotNull (se.Contract, "#1");
+ Assert.AreEqual (typeof (IMetadataExchange), se.Contract.ContractType, "#1.2");
+ Assert.IsNotNull (se.Binding, "#2");
+ // FIXME: enable once we get usable WSHttpBinding.
+ // Assert.AreEqual (typeof (WSHttpBinding), se.Binding.GetType (), "#2.2");
+ Assert.IsNull (se.Address, "#3");
+ }
+ }
+}
+#endif
}
[Test]
- [Category ("NotWorking")]
+ [Ignore ("This hangs on .NET")]
// not sure how "good" this test is ... if it fails at
// service side, it just results in timeout error.
// The assertion makes sure that it passes all the tests, but