Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I made a self-hosted web service in c# and everything works fine.

I work on this base Object class (DevExpress XPO):

C#
[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:
C#
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..
C#
[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?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900