| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 | using System;using System.Collections.Generic;using System.Runtime.Serialization;using System.ServiceModel;using System.ServiceModel.Activation;using System.ServiceModel.Web;using System.Text;using System.IO;using System.Collections;using System.Net;namespace FastReport.Service{    [ServiceContract]    public interface IFastReportService    {        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/about/")]        string About();        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/reports/{path}")]        List<ReportItem> GetReportsListByPath(string path);        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "/reportsxml/{path}")]        List<ReportItem> GetReportsListByPathXml(string path);        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/reports/")]        List<ReportItem> GetReportsList();        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "/reportsxml/")]        List<ReportItem> GetReportsListXml();        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/gears/")]        List<GearItem> GetGearList();        [OperationContract]        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "/gearsxml/")]        List<GearItem> GetGearListXml();        [OperationContract]        [WebInvoke(Method = "POST",             RequestFormat = WebMessageFormat.Json,             ResponseFormat = WebMessageFormat.Json,             UriTemplate = "/getreport/")]        Stream GetReport(ReportRequest request);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/preparereportbyid/{id}")]        Stream GetPreparedReportByID(string id);        [OperationContract]        [WebInvoke(Method = "POST",            RequestFormat = WebMessageFormat.Xml,            ResponseFormat = WebMessageFormat.Xml,            UriTemplate = "/getreportxml/")]        Stream GetReportXml(ReportRequest request);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/gettest/")]        Stream GetTest(Stream preparedReport);                [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/checkprepared/{uuid}")]        bool CheckPreparedReport(string uuid);        [OperationContract]        [WebInvoke(Method = "POST",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/putprepared/")]        string PutPreparedReport(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/put/")]        string PutReport(Stream report);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getprepared/{uuid}")]        Stream GetPreparedByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            BodyStyle = WebMessageBodyStyle.WrappedRequest,                        ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getlogo/{uuid}/{width}/{height}")]        Stream GetLogoByUUID(string uuid, string width, string height);        [OperationContract]        [WebInvoke(Method = "GET",            BodyStyle = WebMessageBodyStyle.WrappedRequest,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getlogo/{uuid}")]        Stream GetLogoByUUIDFixed(string uuid);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getfpx/")]        Stream GetFPX(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getpdf/")]        Stream GetPDF(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getxlsx/")]        Stream GetXLSX(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getdocx/")]        Stream GetDOCX(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getpptx/")]        Stream GetPPTX(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getods/")]        Stream GetODS(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getodt/")]        Stream GetODT(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getmht/")]        Stream GetMHT(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getcsv/")]        Stream GetCSV(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getdbf/")]        Stream GetDBF(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getxml/")]        Stream GetXML(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/gettxt/")]        Stream GetTXT(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/getrtf/")]        Stream GetRTF(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "POST",            UriTemplate = "/gethtml/")]        Stream GetHTML(Stream preparedReport);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getfpx/{uuid}")]        Stream GetFPXByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getpdf/{uuid}")]        Stream GetPDFByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getxlsx/{uuid}")]        Stream GetXLSXByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getdocx/{uuid}")]        Stream GetDOCXByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getpptx/{uuid}")]        Stream GetPPTXByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getods/{uuid}")]        Stream GetODSByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getodt/{uuid}")]        Stream GetODTByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getmht/{uuid}")]        Stream GetMHTByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getcsv/{uuid}")]        Stream GetCSVByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getdbf/{uuid}")]        Stream GetDBFByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getxml/{uuid}")]        Stream GetXMLByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/gettxt/{uuid}")]        Stream GetTXTByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/getrtf/{uuid}")]        Stream GetRTFByUUID(string uuid);        [OperationContract]        [WebInvoke(Method = "GET",            RequestFormat = WebMessageFormat.Json,            ResponseFormat = WebMessageFormat.Json,            UriTemplate = "/gethtml/{uuid}")]        Stream GetHTMLByUUID(string uuid);    }    [DataContract]    public class ReportRequest    {        [DataMember]        public ReportItem Report { get; set; }        [DataMember]        public GearItem Gear { get; set; }    }    [DataContract]    public class ReportItem    {        private Dictionary<string, string> parameters = new Dictionary<string, string>();        [DataMember]        public string ID { get; set; }        [DataMember]        public string Path { get; set; }        [DataMember]        public string Name { get; set; }        [DataMember]        public string Description { get; set; }        [DataMember]        public Dictionary<string, string> Parameters         {            get            {                return parameters;            }            set            {                parameters = value;            }        }    }    [DataContract]    public class GearItem    {        [DataMember]        public string Name { get; set; }        [DataMember]        public Dictionary<string, string> Properties { get; set; }                [DataMember]        public string Extension { get; set; }        [DataMember]        public string MimeType { get; set; }    }    [DataContract]    public class ErrorHandler    {        [DataMember]        public int ErrorCode { get; set; }        [DataMember]        public string Cause { get; set; }    }}
 |