W
Whoever
Here's what I have
A custom collection:
public class aUser {
public string UserName { get {...} set {...}
}
public class UserList : System.Collection.CollectionBase {
public void Add(aUser user) {...}
public aUser this[int Index] {...}
}
A web service:
[WebMethod]
[return: XmlElement("UserList", typeof(UserList))]
public UserList getUserList(string search) {
UserList ul = new UserList();
return ul;
}
On the client side, when adding a reference to the webservice, it can only
see aUser object, but not UserList object. So I have to do
localhost.PhoneSvc svc = new WebApplication1.localhost.PhoneSvc();
localhost.aUser[] a = svc.getContact("test");
Is there a way to expose the collection object, so that you can do something
like this?
UserList ul = svc.getUserList("tester");
I know there are several articles out there that create wrapper class so
that it can be bounded to datagrid, etc. But none of them seems to be able
to expose the collection object directly.
Any ideas? Thanks.
A custom collection:
public class aUser {
public string UserName { get {...} set {...}
}
public class UserList : System.Collection.CollectionBase {
public void Add(aUser user) {...}
public aUser this[int Index] {...}
}
A web service:
[WebMethod]
[return: XmlElement("UserList", typeof(UserList))]
public UserList getUserList(string search) {
UserList ul = new UserList();
return ul;
}
On the client side, when adding a reference to the webservice, it can only
see aUser object, but not UserList object. So I have to do
localhost.PhoneSvc svc = new WebApplication1.localhost.PhoneSvc();
localhost.aUser[] a = svc.getContact("test");
Is there a way to expose the collection object, so that you can do something
like this?
UserList ul = svc.getUserList("tester");
I know there are several articles out there that create wrapper class so
that it can be bounded to datagrid, etc. But none of them seems to be able
to expose the collection object directly.
Any ideas? Thanks.