[Mono-bugs] [Bug 616845] New: webHttpBinding element cannot be customized due to a missing converter in WebHttpBindingElement.cs

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jun 23 15:47:09 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=616845

http://bugzilla.novell.com/show_bug.cgi?id=616845#c0


           Summary: webHttpBinding element cannot be customized due to a
                    missing converter in WebHttpBindingElement.cs
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: x86-64
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: WCF
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: clovis.ribeiro at myabcm.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other
           Blocker: No


In any WCF configuration file, if you try to customize webHttpBinding by adding
something like:

<configuration> 
  <system.serviceModel>
       ...
      <webHttpBinding>
         <binding name="abc">
         </binding>
       </webHttpBinding>
        ....
  </system.serviceModel>
</configuration>  

The result is a crash with the following output:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. --->
System.TypeInitializationException: An exception was thrown by the type
initializer for System.ServiceModel.Configuration.WebHttpBindingElement --->
System.Configuration.ConfigurationErrorsException: The default value for
property 'writeEncoding' has a different type than the one of the property
itself: expected System.Text.Encoding but was System.String

This points out to a missing conversion in WebHttpBindingElement.cs in line
231:

        [TypeConverter ()]
        [ConfigurationProperty ("writeEncoding",
             DefaultValue = "utf-8",
             Options = ConfigurationPropertyOptions.None)]
        public Encoding WriteEncoding {
            get { return (Encoding) base [write_encoding]; }
            set { base [write_encoding] = value; }
        }

[TypeConverter()] should probably have a "typeof(EncodingConverter)" as a
parameter to force string to Encoding conversion. Without that, even if you do
not use  writeEncoding, as the default value is a string, the element will
fail.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list