Partager via


XML and Serialization Design-Time Breaking Changes

 
Short Description Generating properties not fields will break existing code using regenerated proxy for some languages
Affected APIs Generated code Severity Low Compat Switch Available No

Description

Scenario:

  1. Version 1.1 app written in C++ runs fine.
  2. Customer upgrades to version 2.0.
  3. Customer regenerates proxy for WebService.
  4. Code that called version 1.1 of the proxy assumes fields and the C++ property getters and setters are not the same names.
  5. Code does not compile.

User Scenario Re-generation of proxy after upgrade to version 2.0 without modifying client code

Work Around Change code to use new update proxy correctly.
 

 

 
Short Description Generated Proxy contains XmlNode[] instead of Object[]
Affected APIs System.Xml.Serialization.XmlSchemaImporter.ImportTypeMapping() (all); Severity Very Low Compat Switch Available No

Description This behavior only happens when a WebMethod uses choice construct mixing elements of type XmlElement and XmlNode. Or while importing schemas with type choice construct mixing elements of any type and any type with mixed content.

User Scenario After updating to version 2.0 and refreshing existing WebReference there are some situations when the calling code has to be changed: in the past we generated parameter of type object, but after the fix, it becomes XmlNode. This matters only for input parameters we generate, also even the input paramter was typed as object

Work Around
  1. Change the calling code to use XmlNode instead of object.
  2. Change proxy code to use object instead of XmlNode.
 

 

 
Short Description Regression in code generation for from xsd schema while using choice
Affected APIs None Severity Very Low Compat Switch Available No

Description After updating a web reference user may see the following run-time exception: Value of ItemsElementName mismatches the type of custClass; you need to set it to ItemsChoiceType.@custData1.

User Scenario Running application will not be affected, the situation only arises after updating a web reference. Not all clients are affected: the service description should have a choice with uses element qnames that only differ by a namespace.

Work Around None
 

 

 
Short Description XslTransform throws InvalidOperationException in v2.0, XsltException in v1.1.
Affected APIs None Severity Medium Compat Switch Available No

Description If the user calls Execute on the transform class without loading a stylesheet, we throw an InvalidOperationException in v2.0. We used to throw XsltException in v1.1.

User Scenario The user scenario is user trying to call Execute on the transform class without loading a stylesheet. He will be getting an exception. This is a design time error on the user's part and the exception is seen during design time.In v1.1, this resulted in a XsltException, in v2.0, we throw an InvalidOperationException.

Work Around none
 

 

 
Short Description Generated Proxy contains XmlNode[] instead of Object[]
Affected APIs System.Xml.Serialization.XmlSchemaImporter.ImportTypeMapping() (all); System.Xml.Serialization.XmlSchemaImporter.ImportMembersMapping() (all) Severity Low Compat Switch Available No

Description

After updating a project to V2.0 and refreshing existing WebReference there are some situations when the calling code has to be changed: in the past the framework generated parameters of type object, but after the fix, it becomes XmlNode. This matters only for input parameters the framework generates. Even if the in-out paramter was typed as object, the serializer forced users to use only classes derived from XmlNode.

This behavior only happens when a WebMethod uses choice construct mixing elements of type XmlElement and XmlNode. Or while importing schemas with type choice construct mixing elements of any type and any type with mixed content.


User Scenarioo Updating to V2.0, refreshing existing WebReference, when a WebMethod uses choice construct mixing elements of type XmlElement and XmlNode. Or while importing schemas with type choice construct mixing elements of any type and any type with mixed content

Work Around
  1. Change the calling code to use XmlNode instead of object.
  2. Change proxy code to use object instead of XmlNode.
 

 

 
Short Descriptionn After updating a web reference the user may see an error (CS0029)
Affected APIs N/A Severity Medium Compat Switch Available No

Description After updating a web reference the user may see the following compile error: error CS0029: Cannot implicitly convert type 'myDataSet' to 'System.Xml.XmlElement'

User Scenarioo A running application will not be affected, the situation only arises after re-generating sources using xsd.exe tool with /c switch on schemas that represent typed DataSet structures (or after updating web reference)

Work Around Edit the generated code replace XmlElement with the proper class name
 

 

 
Short Description After updating a web reference user may see the following run-time exception: Value of ItemsElementName mismatches the type of custClass; you need to set it to ItemsChoiceType.@custData1.
Affected APIs N/A Severity Medium Compat Switch Available No

Description

After updating a web reference user may see the following run-time exception:

Value of ItemsElementName mismatches the type of custClass; you need to set it to ItemsChoiceType.@custData1.


User Scenario Running application will not be affected, the situation only arises after updating a web reference. Not all clients are affected: the service description should have a choice with uses element qnames that only differ by a namespace.

Work Around Edit user code to set the choice identifier to the right value, mentioned in the exception message.