Microsoft KB Archive/907886

= A System.InvalidOperationException exception may occur when you try to use a Visual Studio .NET 2003 client application against a SQL Server 2005 native Web service =

Article ID: 907886

Article Last Modified on 11/3/2005

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition

-





SYMPTOMS
When you try to use a Microsoft Visual Studio .NET 2003 client application against a Microsoft SQL Server 2005 native Web service, a System.InvalidOperationException exception may occur.



CAUSE
This problem occurs because the System.Data.DataSet object that Visual Studio .NET 2003 uses does not support the XML Schema definition language (XSD) schemas that SQL Server 2005 generates.



WORKAROUND
To work around this problem, use the simple Web Services Description Language (WSDL) instead of the default WSDL. For example, use a URL that is similar to the following URL:

http:// / ?wsdlsimple



MORE INFORMATION
When you use the default WSDL to communicate with a SQL Server 2005 native Web service, the response data type is defined as a DataSet object that contains the XML Schemas (XSD) that SQL Server 2005 generates. The DataSet object that Visual Studio .NET 2003 uses cannot parse the XML Schemas (XSD). Therefore, the application throws an exception.

When you use the simple WSDL to generate the stub class to communicate with a SQL Server 2005 native Web service, the response data type is defined as an array of XML that substitutes the XML Schema (XSD) data types for SQL Server 2005 system types. The application does not perform any additional parsing other than parsing the SOAP message into the array of XML.

Keywords: kbtshoot kbprb kbsql2005webdata KB907886

-

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

© Microsoft Corporation. All rights reserved.