I'm maintaining a web application. I've found I need to create a new webservice. However, I didn't write any of the original webservices, so I've been blundering along. I'm pretty sure I've got the code right, but I've run into a snag...
I'm getting an error and can't figure out how to fix it... The error is: [GPService.DataEntity.MuniAuthList] cannot be serialized because it does not have a parameterless constructor.
So, I go to GPService.DataEntity.MuniAuthList and there IS a parameterless constructor. Code is as follows
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace GPService.DataEntity
{
#region MuniAuth
public sealed class MuniAuth
{
public MuniAuth() { }
[DataMember]
public string Account
{
get;
set;
}
[DataMember]
public string MUNIID
{
get;
set;
}
[DataMember]
public string Muniname
{
get;
set;
}
[DataMember]
public string Assessment_reports
{
get;
set;
}
[DataMember]
public string Owner_info
{
get;
set;
}
[DataMember]
public string Tax_info
{
get;
set;
}
[DataMember]
public string MLS_listing
{
get;
set;
}
[DataMember]
public string Blueprints
{
get;
set;
}
[DataMember]
public string Prop_images
{
get;
set;
}
[DataMember]
public string Fire_plan
{
get;
set;
}
}
[CollectionDataContract]
[KnownType(typeof(MuniAuth))]
public sealed class MuniAuthList : BaseCollection<MuniAuth>
{
public MuniAuthList() {}
[MessageBodyMember]
public IList<MuniAuth> Collection
{
get { return base._list; }
set { base._list = value; }
}
}
#endregion
}
The code for the service is laid out in several files, Service, BusinessLogic, DataAccess and DataEntity. I've based the code for this service on the other services and they work fine. HOWEVER, ther are .svc files and the new one is a .asmx file. It's also possible I'm not building something correctly and I didn't know, but when I've made changes to the existing services, they went through fine, so I kinda doubt that...
If you have any suggestions, I'd appreciate it. I've tried everything I can think of.