Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 940959 - Last Review: December 3, 2007 - Revision: 1.2
After you apply security update 931212, WSDL is no longer parsed correctly in the .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.
<any namespace="##TargetNamespace" />
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 <any> tag is consumed by the <any /> tag. WSDL throws an exception because it does not think a type that follows the <any> tag is defined. The <any> 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 <any namespace=â€##
TargetNamespace"> 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 "Applies to" section.
MORE INFORMATION
This following code is a sample schema.
<schema xmlns="<http://www.w3.org/2001/XMLSchema>" xmlns:xsd="<http://www.w3.org/2001/XMLSchema>" xmlns:a="<<Domain>/a>" elementFormDefault="qualified" targetNamespace="<<Domain>/a>" >
<element name="A" type="a:A" />
<complexType name="A" >
<sequence >
<element name="a1" type="xsd:string"/>
<element name="a2" type="xsd:string"/>
<any namespace="##<TargetNamespace>" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
</schema>
<schema xmlns="<http://www.w3.org/2001/XMLSchema>" xmlns:xsd="<http://www.w3.org/2001/XMLSchema>" xmlns:a="<<Domain>/a>" xmlns:b="<<Domain>/b>" elementFormDefault="qualified" targetNamespace="<<Domain>/b>" >
<element name="B" type="b:B" />
<complexType name="B" >
<complexContent >
<extension base="a:A" >
<sequence >
<element name="b1" type="xsd:string"/>
<element name="b2" type="xsd:string"/>
<any namespace="##<TargetNamespace>" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</extension>
</complexContent>
</complexType>
</schema>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 <any /> tag.
APPLIES TO
- Microsoft .NET Framework 2.0
| kbtshoot kbcode kbprb KB940959 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please