[Mono-bugs] [Bug 670945] New: XML Serialization output differs from Microsoft .NET Runtime (or CLR)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 10 08:14:17 EST 2011



           Summary: XML Serialization output differs from Microsoft .NET
                    Runtime (or CLR)
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.8.x
          Platform: i686
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: charles.nepveu at verint.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7


I'm using a generated ServiceModel.ClientBase<> implementation, generated by
ONVIF WSDL documents (e.g.: DdviceManagement.wsdl) found on onvif.org (though
web references).

I found out that when serializing an array of enum values, the output differs
when using the Mono 2.8.2 runtime compared to the Microsoft .NET runtime.

Because of this difference, the remote web service doesn't understand the
request and responds with a "400 - Bad Request" message.

However, when I do a manual serialization of instances of the problematic class
(using an XmlSerializer and StringWriter), the serialized XML output is the
same whether I use the Mono 2.8.2 or Microsoft .NET runtimes. So it seems that
the problem deep within the ServiceModel web services client classes that
perform XML serialization under the hood.

The problem is related to the serialization of an array of enum values. See the
actual and expected results.

Reproducible: Always

Steps to Reproduce:
1. Create a console app project, and add the following Web Reference to your
project: http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
2. Instantiate a DeviceClient object, with an HTTP basic binding, and an
3. Invoke the 'GetCapabilities(CapabilityCategory[]) method.
4. Check the XML request message that is output.
Actual Results:  
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <GetCapabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Expected Results:  
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      <GetCapabilities xmlns="http://www.onvif.org/ver10/device/wsdl">

The difference (apart from the XML header) is that the CapabilityCategory
element should not be there in the actual result.

The CapabilityCategory name is in fact the name of the enumeration from which
'All' is from. See the declarations:

public partial class GetCapabilitiesRequest
  public CapabilityCategory[] Category;

public enum CapabilityCategory

Configure bugmail: https://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