WS and DesktopApplication
-
Hello, I have a small problem. I built a ASP.NET WebService that retrieves data from a database. I have a function in the webservice that receives a parameter, and the return type is an object created by me. UserInfoCollection is a class created by me that contains an ArrayList with will cotain several UserInfo objects. This is the function in the webservice:
[WebMethod] public UserInfoCollection GetUsersByType(AccountTypes account) { UserInfoCollection collection = new UserInfoCollection(); //fill the collection with data from database return collection; }
To use the methods from the webservice I build a proxy using the WSDL utility. This is how i use this function:WSService ws = new WSService(); UserInfoCollection _uicUsers = ws.GetUsersByType(type);
Using debug mode I saw that the webservice inserts into the collection everything that he has to, but when the webservice returns the collection object, in the application the object has no values inside. After the return statement, the webservice reinitializez the object. My question is that anyone has a suggestion to get past this problem. Thank you.Do your best to be the best
-
Hello, I have a small problem. I built a ASP.NET WebService that retrieves data from a database. I have a function in the webservice that receives a parameter, and the return type is an object created by me. UserInfoCollection is a class created by me that contains an ArrayList with will cotain several UserInfo objects. This is the function in the webservice:
[WebMethod] public UserInfoCollection GetUsersByType(AccountTypes account) { UserInfoCollection collection = new UserInfoCollection(); //fill the collection with data from database return collection; }
To use the methods from the webservice I build a proxy using the WSDL utility. This is how i use this function:WSService ws = new WSService(); UserInfoCollection _uicUsers = ws.GetUsersByType(type);
Using debug mode I saw that the webservice inserts into the collection everything that he has to, but when the webservice returns the collection object, in the application the object has no values inside. After the return statement, the webservice reinitializez the object. My question is that anyone has a suggestion to get past this problem. Thank you.Do your best to be the best
Are your UserInfoCollection and UserInfo classes marked as Serializable?
Deja View - the feeling that you've seen this post before.
-
Hello, I have a small problem. I built a ASP.NET WebService that retrieves data from a database. I have a function in the webservice that receives a parameter, and the return type is an object created by me. UserInfoCollection is a class created by me that contains an ArrayList with will cotain several UserInfo objects. This is the function in the webservice:
[WebMethod] public UserInfoCollection GetUsersByType(AccountTypes account) { UserInfoCollection collection = new UserInfoCollection(); //fill the collection with data from database return collection; }
To use the methods from the webservice I build a proxy using the WSDL utility. This is how i use this function:WSService ws = new WSService(); UserInfoCollection _uicUsers = ws.GetUsersByType(type);
Using debug mode I saw that the webservice inserts into the collection everything that he has to, but when the webservice returns the collection object, in the application the object has no values inside. After the return statement, the webservice reinitializez the object. My question is that anyone has a suggestion to get past this problem. Thank you.Do your best to be the best
The data you want to expose need to be public. Remember webservices only make a wrapper for your class's public data.
**
xacc.ide-0.2.0.74 - now with C# 3.5 support!
**
-
Are your UserInfoCollection and UserInfo classes marked as Serializable?
Deja View - the feeling that you've seen this post before.
Hey, First of all thanks for your reply. The classes are not marked as Serializable, but I also have a function in the WebService that returns a UserInfo object and it works perfect. If I use the UserInfoCollection...problems. I found some way to go around, but this bugs me a lot...because I can't understand why it's doing this.
Do your best to be the best
-
The data you want to expose need to be public. Remember webservices only make a wrapper for your class's public data.
**
xacc.ide-0.2.0.74 - now with C# 3.5 support!
**
Hey, Thanks for your reply. The classes are marked as public and the methods that I need are also public, but in debug mode when the webservice returns the collection object first of all it reinitialize my private objects and then calls the constructor of the class. These classes I talk about are wrapped in a DLL and imported in the WS.
Do your best to be the best