Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Adding the DataAccess WebReference
 

Adding the DataAccess WebReference

Hope someone can help me configure TaskVisionWS locally so I can access the web service using Pocket TaskVision.

I have TaskVisionWS setup here on a Windows 2000 Server.  The web services (DataAccess and Login) all compile without any errors.  From my WindowsXP development pc, I add the Login Web Reference to PocketVision and compile.  I get zero errors.  But after I add the DataAccess Web Reference, I get 30 errors.  Here are just a few:

C:\Program Files\.NET Compact Framework Samples\Pocket TaskVision Sample\Source\CS\PocketClient\Web References\DataAccess\Reference.cs(170): The type or namespace name 'Serializable' could not be found (are you missing a using directive or an assembly reference?)

C:\Program Files\.NET Compact Framework Samples\Pocket TaskVision Sample\Source\CS\PocketClient\Web References\DataAccess\Reference.cs(1480): The type or namespace name 'DesignerSerializationVisibilityAttribute' does not exist in the class or namespace 'System.ComponentModel' (are you missing an assembly reference?)

And here is a sample of the offending code from Reference.cs:

        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute (System.ComponentModel.DesignerSerializationVisibility.Content)]
        public ProjectHistoryDataTable ProjectHistory 
       {
            get 
            {
                return this.tableProjectHistory;
            }
        }

The development pc where Pocket TaskVision is being compiled is Visual Studio 2003 Ent.  The server where TaskVisionWS is installed is Windows 2000 Server with .Net Framework 1.1.

If I add the DataAccess Web Reference to a Windows Forms project, it compiles fine.  It is only when I add it to a PocketPC app that I get the barrage of errors.

I created a new web service called Test.asmx and slowly began adding code.  After each compile, I tried adding the web reference to PocketVision.  The errors began the moment I added a web method which returned a serializable dataset:

    <WebMethod(Description:="Returns a project DataSet containing exactly one table named 'Projects'.")> _
    Public Function GetProjects(ByVal ticket As String) As DataSetProjects
        If Not IsTicketValid(ticket, False) Then Return Nothing

        Dim ds As New DataSetProjects()
        daProjects.Fill(ds, "Projects")

        Return ds
    End Function


TaskVision is a great example and exactly the technology I need right now.  Hope you can help.
MigrationUser 1  Thursday, July 10, 2003 1:08 PM
I fingered it out.  Has to do with typed datasets coming from the DataAccess web service and the lack of support for such in .Net CF.  This page in particular gives the details:

http://smartdevices.microsoftdev.com/Learn/Articles/637.aspx

an excerpt:

DataSets
The .NET Compact Framework has limited serialization support, so this means that it has trouble working with typed-DataSets. Visual Studio .NET generates proxy classes when a web reference is made to the Web service. The TaskVision Data service contains typed-DataSets and Visual Studio generates a proxy class with a lot of serialization code. This code needs to be commented out before the project will compile. Developers need to be aware of this so they aren't shocked that their project doesn't compile after adding a Web reference that contains typed-DataSets.


Of course, after you comment out all that code, be sure not to update your web refereneces or you'll be handed a new proxy, complete with the serialization code you just spent hours trying to remove.
MigrationUser 1  Thursday, July 10, 2003 3:28 PM

You can use google to search for other answers

Custom Search

More Threads

• why my animal is so easy to die!
• Dependant tasks? Subtasks?
• Local Terrarium as Screensaver
• Questions about connecting to SQL Server & Web Services
• Timer with copy 'job'
• Get the Run time Created controls of ids
• XML Web Services over APACHE ??
• Update Web Refrence Problem (Issue Vision)
• My Form-Designer doesnt work anymore!
• Another question