TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
contactashwinj
NA
1
0
Returning Arraylistof userdefined objects From Webservice
Jan 4 2005 6:50 AM
HI, I M CREATING AN WEBSERVICE... IN THAT I M CREATING A WEBMETHOD WHICH RETURNS AN ARRAYLIST.. public ArrayList GetArrPeriods() { sm = new SarsImplement(); return sm.GetPeriods(); //sm is a class.. //sm.getperiods() is a function which returns an arraylist... } public override ArrayList GetPeriods() { ArrayList arr = new ArrayList(); reader = SqlHelper.ExecuteReader(this.conn_string,"GetLowerPeriod",20); while(reader.Read()) { Period period = new Period(); period.PeriodID = reader.GetInt32(reader.GetOrdinal("PeriodId")); period.PeriodDescription = reader.GetString(reader.GetOrdinal("PeriodDesc")); period.StartDate = reader.GetDateTime((reader.GetOrdinal("StartDate"))); period.EndDate = reader.GetDateTime((reader.GetOrdinal("EndDate"))); period.ParentPeriod = reader.GetInt32(reader.GetOrdinal("ParentPeriod")); arr.Add(period); } reader.Close(); return arr; } BUT WHEN I EXECUTE THE WEBSERVICE AND CALL IT IT GIVES ME FOLLOWING ERROR... System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type SarsTrial.DataObjects.Period was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. PLS MAIL ME OR TELL ME THE SOLUTION,. CONTACT DETAILS :
[email protected]
,
[email protected]
Reply
Answers (
0
)
How copies files across from a UNC drive to my local drive in C# using .windows service
Can I download a word file on a server using webservice?