Hi Jan,
hm, AFAIK, it then was just a matter of time (and not thinking enough about
the problem space?) - but I guess they will support public properties in the
Beta. Actually it is just three lines of code they have to change ;-)
Cheers,
--
Christian Weyer
[Microsoft Regional Director, Germany]
[MVP ASP.NET & XML Web Services]
** XML Web Services:
http://www.xmlwebservices.cc/
** Weblog:
http://weblogs.asp.net/cweyer/
"Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
news:#u1knMQwDHA.1596@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi Christian
>
> I saw your tool on your blog some time ago, nice work man! Do you have any
> idea why MS implemented public fields instead of public properties on[/color]
proxy[color=blue]
> classes? I tested this in Whidbey, and there is still the same[/color]
behaviour...[color=blue]
> :-/
>
> --
> Greetz,
> Jan
> __________________________________
> Read my weblog:
http://weblogs.asp.net/jan
> "Christian Weyer" <cw@no.spam_eyesoft_sucks.de> schreef in bericht
> news:OL4Ja3PwDHA.1660@TK2MSFTNGP09.phx.gbl...[color=green]
> > Or more easily just use a tool that automatically can generate the code[/color]
> you[color=green]
> > need:
> >[/color]
>[/color]
http://www.gotdotnet.com/Community/U...f-e001fac664a6[color=blue][color=green]
> > No need for wsdl.exe or Web Reference (only caveat for some users[/color]
> currently[color=green]
> > is that the WSDL has to be present locally).
> >
> > Cheers,
> > --
> > Christian Weyer
> > [Microsoft Regional Director, Germany]
> > [MVP ASP.NET & XML Web Services]
> >
> > ** XML Web Services:
http://www.xmlwebservices.cc/
> > ** Weblog:
http://weblogs.asp.net/cweyer/
> >
> >
> >
> > "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
> > news:uEK4YzMwDHA.3116@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > Hi,
> > >
> > > Actually Luke is right. You can't bind to public fields, only to[/color][/color][/color]
public[color=blue][color=green][color=darkred]
> > > properties. The proxy classes generated by VS.NET have public fields,[/color][/color][/color]
so[color=blue][color=green]
> > you[color=darkred]
> > > can't bind to them. BUT there is a solution for this. I've built a[/color][/color]
> wrapper[color=green][color=darkred]
> > > class the transforms public fields into propeties at runtime. Actually[/color]
> > I've[color=darkred]
> > > written an article about this problem which you can find here:
> > >[/color]
> >[/color]
>[/color]
http://www.microsoft.com/belux/nl/ms...cewrapper.mspx[color=blue][color=green][color=darkred]
> > > The data binding capabilities in .NET are great, you can bind many[/color]
> > controls[color=darkred]
> > > to almost any type of data, but in some scenarios data binding has its
> > > limitations. For example data binding is not possible when using[/color][/color][/color]
custom[color=blue][color=green][color=darkred]
> > > collections, instead of DataSets, coming from a Web Service. This[/color][/color]
> article[color=green][color=darkred]
> > > explains the problem and a possible, easy-to-use, solution: a class[/color][/color][/color]
that[color=blue][color=green][color=darkred]
> > > dynamically builds wrapper classes at run time, which exposes the[/color][/color][/color]
field[color=blue][color=green][color=darkred]
> > > member of the proxy classes as properties.
> > >
> > > --
> > > Greetz,
> > > Jan
> > > __________________________________
> > > Read my weblog:
http://weblogs.asp.net/jan
> > > "Brad" <nospam@co.lane.or.us> schreef in bericht
> > > news:enhdNRFwDHA.3216@TK2MSFTNGP11.phx.gbl...
> > > > I have a web service which returns a collection of class object (see
> > > below).
> > > > I want to consume this service in another web application by binding[/color][/color]
> it[color=green]
> > to[color=darkred]
> > > a
> > > > List control The data returns from the web service, however when[/color][/color][/color]
I[color=blue][color=green]
> > bind[color=darkred]
> > > > the data I get the following error
> > > > ****
> > > > DataBinder.Eval: 'UserServices.User' does not contain a property[/color][/color][/color]
with[color=blue][color=green]
> > the[color=darkred]
> > > > name FirstName.
> > > > ****
> > > > Debugging I see that the list controls data source is a System.Array[/color]
> > with[color=darkred]
> > > > all of my data; each array element does indeed have an object with[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > > correct properties and FirstName is a public property/string. What[/color][/color]
> am[color=green]
> > I[color=darkred]
> > > > missing?
> > > >
> > > > Brad
> > > >
> > > > (cross posted to microsoft.public.dotnet.framework.aspnet
> > > > &
> > > > microsoft.public.dotnet.framework.aspnet.webservic es
> > > > )
> > > >
> > > >
> > > > Code examples
> > > > ==================================
> > > > Web Service (example only...real code is more and pulls data from
> > > database)
> > > > ==================================
> > > > Public Class User
> > > > Public UserID as integer
> > > > Public FirstName as string
> > > > End class
> > > >
> > > > Public Class UserServices
> > > > Inherits System.Web.Services.WebService
> > > > <WebMethod()> _
> > > > Public Function GetUsers(ByVal appName As String) As User()
> > > > Dim myUsers(1) as New User
> > > > Dim userA as New User
> > > > userA.UserID = 1
> > > > userA.FirstName = "Fred"
> > > > myUsers(0) = userA
> > > >
> > > > Dim userB as New User
> > > > userB.UserID = 2
> > > > userB.FirstName = "Barney"
> > > > myUsers(1) = userB
> > > > return myUsers
> > > > End Function
> > > >
> > > >
> > > > ==================================
> > > > Consumer code
> > > > ==================================
> > > >
> > > > Dim svc As New Services.UserServices
> > > > Dim ui() As svc.UserInfo = ps.GetUsers()
> > > > UserList.DataTextField = "FirstName"
> > > > UserList.DataValueField = "UserID"
> > > > UserList.DataSource = ui
> > > > UserList.DataBind()
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]