[Mono-bugs] [Bug 691333] New: Query string convesion is unsupported from custom data type.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue May 3 00:40:54 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=691333

https://bugzilla.novell.com/show_bug.cgi?id=691333#c0


           Summary: Query string convesion is unsupported from custom data
                    type.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: WCF
        AssignedTo: atsushi at ximian.com
        ReportedBy: sakno at tncor.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1;
Trident/5.0)

I have a WCF RESTful service(WebHttpBinding) that contains HTTP request handler
in the form of service method:
[DataContract]
[TypeConverter(typeof(ComplexConverter))]
public sealed class Complex
{
  [DataMember]
  public double Image;
  [DataMember]
  public double Real;
}
[ServiceContract]
public interface IArithmeticService
{
  [OperationContract]
  [WebGet("?x={x}&y={y}", RequestFormat = WebMessageFormat.Json,
WebMessageFormat.Json)]
  Complex Add(Complex x, Complex y);
}
ComplexConverter is derived from System.ComponentModel.TypeConverter and
provide conversion from string to an instance of Complex class and vice versa.
This requirement is implemented according with the following article:
http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.querystringconverter.aspx(phrase
"Types that have a TypeConverterAttribute that can convert the type to and from
a string representation").
On Microsoft .NET, operation dispatcher receives query string, and converts
each parameter using ComplexConverter from string to an instance of Complex
class. Mono doesn't support this feature.

Reproducible: Always

Steps to Reproduce:
1. Write custom data type T;
2. Create a new class derived from TypeConverter class and implements
conversion between string and T;
3. Decorate T class with TypeConverterAttribute;
4. Create WCF RESTful service with service method that handles HTTP
parametrized request and accepts argument of T class;
5. Invoke service method from browser or client program;
Actual Results:  
Exception Conversion from the argument parameterType 'Company.Product.Type' is
not supported at
System.ServiceModel.Dispatcher.QueryStringConverter.ConvertStringToValue
(System.String parameter, System.Type parameterType) 

Expected Results:  
WebDispatchMessageFormatter obtains TypeConverterAttribute and instantiates
converter for custom data type, then converts string to an instance of custom
data type and invokes service method successfully.

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


More information about the mono-bugs mailing list