I made a self-hosted web service in c# and everything works fine.
I work on this base Object class (DevExpress XPO):
[Persistent(System.StatusTable)]
public class XPStatusTable : XPBaseObject
{
private short fIDTable;
[Key(true)]
public short IDTable
{
get { return fIDTable; }
set { SetPropertyValue<short>("IDTable", ref fIDTable, value); }
}
private string fDescription;
public string Description
{
get { return fDescription; }
set { SetPropertyValue<string>("Description", ref fDescription, value); }
}
public XPStatusTable() { }
public XPStatusTable(Session session) : base(session) { }
}
I serialize a collection of these objects:
private string GetSerializedData()
{
StringWriter streamWriter = new StringWriter();
using (UnitOfWork uow = new UnitOfWork())
{
XmlSerializer xmlSerializer = new XmlSerializer(typeof(XPCollection<XPStatusTable>));
XPCollection<XPStatusTable> list = new XPCollection<XPStatusTable>(uow);
xmlSerializer.Serialize(streamWriter, list);
return streamWriter.ToString();
}
}
The Service interface has got this function that return a string, but the string is a xml file with XPStatusTable schema..
[OperationContract]
string GetSerializedData();
Is there a way to publish in wsdl descriptor (or I don't know where) that 'GetSerializedData' return a collection of XPSatusTable instead a simple string?