// this is in the interface
[OperationContract]
TBsampleTableCollection getSampleTableData(List<Where> whereCollection);
// this is in the implementation
public TBsampleTableCollection getSampleTableData(List<Where> whereCollection)
{
Query myquery = new Query(TBsampleTable);
foreach (Where whereitem in whereCollection)
myquery.AddWhere(whereitem);
IDataReader myReader = myquery.ExecuteReader();
TBsampleTableCollection mycollection= new TBsampleTableCollection ();
mycollection= .LoadAndCloseReader(myReader);
return mycollection;
}
Using the default subsonic template. everything works fine except for nullable fields.
XMLserialier and the default serialier cannot handle nullable types for attributes.This could be the problem you are facing with the DataContractSerializer.
You must modiy the CS templates. and change the
[XmlAttribute("<%=propName%>")]
to
[XmlElement("<%=propName%>")]
OR you can change the template to use
[DatacontractCollection] [DataContract] [DataMember]
instead of the [Serializable] [XmlAttribute("<%=propName%>")]
You also need to add
using System.Runtime.Serialization; to CS_GeneratedScaffoledCodeBehind.aspx // i think.
The Subsonic objets definitions that you are returning should be included in the ServiceProxy. no need to add subsonic to the consumer.
Ofcourse you need to configure the Service correctly.
But bottom line. It is possible to pass Subsonic Classes through WCF. .. that is what I believe.