Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

How to use uniqueidentifier fields a return dataset from a webserv

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
martinwlarsen@newsgroup.nospam - 01 Mar 2005 20:07 GMT
I have made a web service that returns a typed dataset that includes a
uniqueidentifier field. When I import this web service into visual studio  
using add reference I get the following error: Custom tool error: Failed to
generate dataset. Undefined data type: 'anyType' in the output window.

The  xsd for the dataset looks like this:

<xs:element name="TestWeb">
 <xs:complexType>
   <xs:sequence>
      <xs:element name="ID" type="xs:int" />
      <xs:element name="Text1" type="xs:string" />
      <xs:element name="Text2" type="xs:string" />
      <xs:element minOccurs="0" name="Test3" type="xs:string" />
      <xs:element minOccurs="0" name="Text4" type="xs:string" />
      <xs:element msdata:DataType="System.Guid, mscorlib,        
          Version=2.0.3600.0,      Culture=neutral,  
          PubicKeyToken=b77a5c561934e089" minOccurs="0" name="Testuni"  
          type="xs:anyType" />  
     </xs:sequence>
  </xs:complexType>
</xs:element>

If I remove the uniqueidentifier field from the dataadaptor and re-generate
the dataset everything works. And I can refrence the web service with a
uniqueidentifier field from vs 2005 without any problem. I have also tried to
import the web service to a different mashine with VS2003 and have the same
problem.

Is there a bug fix or a good explanation for this issue?

BRGDS
  Martin W. Larsen
[MSFT] - 02 Mar 2005 02:05 GMT
Hello Martin,

Did you work with SQL Server or other database? I test such a SQL Server
table in VS.NET 2003:

CREATE TABLE [dbo].[Table1] (
    [id] [int] NOT NULL ,
    [name] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [Testuni] [uniqueidentifier] NULL
) ON [PRIMARY]
GO

It generate such DataSet:

<xs:complexType>
           <xs:sequence>
             <xs:element name="id" type="xs:int" />
             <xs:element name="name" type="xs:string" minOccurs="0" />
             <xs:element name="Testuni" msdata:DataType="System.Guid,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
           </xs:sequence>
         </xs:complexType>

And it can be added to other projects. Is the database or table structure
that cause the difference between us?

Luke
martinwlarsen@newsgroup.nospam - 02 Mar 2005 14:41 GMT
Thanks for your answer, which led me to investigate the xsd.

Because I have VS 2005 installed on the machine and IIS uses the newest
asp.net engine as default it breaks the add reference in vs2003. The xsd for
the webservice dataset field will look like this because the asp.net engine
is running version 2:

 <xs:element msdata:DataType="System.Guid, mscorlib, Version=2.0.3600.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" minOccurs="0"
name="Testuni" type="xs:anyType" />

Which can not be used from VS 2003 as it does not know mscorlib,
Version=2.0.3600.0.

I fixed the issue by changing the ASP.NET version for the webservice folder
in IIS to version 1.1.43222.0.

For following article describes how to do the change:
http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/prodd
ocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/pro
ddocs/en-us/aaconconfiguringaspnetapplicationforaspnetversion.asp


The scary part is that it means that if I convert the webservice to
VS2005(Framework 2.0) in the future I will break all of my clients unless
they have already been converted.

BRGDS
   Martin W. Larsen

> Hello Martin,
>
[quoted text clipped - 24 lines]
>
> Luke
[MSFT] - 03 Mar 2005 02:02 GMT
Hi Martin,

I am glad to hear you have found the problem. Now VS.NET 2005 is just beta
version, we may expect this can be changed in release version.

Luke

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.