Microsoft KB Archive/940959

= After you apply security update 931212, WSDL is no longer parsed correctly in the .NET Framework 2.0 =

Article ID: 940959

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .NET Framework 2.0

-



SYMPTOMS
In the Microsoft .NET Framework 2.0, you can use the schema element of the Web Service Definition Language (WSDL) to define complex types in which one type can extend another type. You can perform the extend operation by including the following tag in each complex type.  This tag enables you to add more elements to a complex type without breaking SOAP clients that were generated based on the original version of WSDL.

However, after you apply security update 931212, WSDL is no longer parsed correctly. Everything that follows the tag is consumed by the tag. WSDL throws an exception because it does not think a type that follows the tag is defined. The tag value contains all the XML elements that follow it.



CAUSE
This problem occurs because of a breaking change in the XmlSerializer object.

After you apply security update 931212, the code generator mistakenly generates the Order= property on the classes. Additionally, the code generator cannot handle multiple  tags in the same scope.



WORKAROUND
To work around this problem, manually change the generated classes. Remove the Order= property from all members of the classes.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
This following code is a sample schema. &quot; xmlns:xsd=&quot;&quot; xmlns:a=&quot;</a>&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;</a>&quot; >     &quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /> </complexType> <schema xmlns=&quot;<http://www.w3.org/2001/XMLSchema>&quot; xmlns:xsd=&quot;<http://www.w3.org/2001/XMLSchema>&quot; xmlns:a=&quot;<<Domain>/a>&quot; xmlns:b=&quot;<<Domain>/b>&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;<<Domain>/b>&quot; > <element name=&quot;B&quot; type=&quot;b:B&quot; /> <complexType name=&quot;B&quot; > <complexContent > <extension base=&quot;a:A&quot; > <element name=&quot;b1&quot; type=&quot;xsd:string&quot;/> <element name=&quot;b2&quot; type=&quot;xsd:string&quot;/> <any namespace=&quot;##<TargetNamespace>&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /> </complexContent> </complexType> This XML code should be parsed as follows. <b:B> <a:a1>value-a1</a:a1> <a:a2>value-a2</a:a2> <a:other>other</a:other> <a:other>other</a:other> <b:b1>value-b1</b:b1> <b:b2>value-b1</b:b2> <b:other>other</b:other> </b:B> After you apply security update 931212, all the XML elements that come after the <a:a2> tag are consumed by the tag.

Keywords: kbtshoot kbprb kbcode kbpubtypekc kbmsccsearch KB940959

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.