Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
GetSchema.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System; using System.IO; using EnterpriseWebLibrary.Configuration; using EnterpriseWebLibrary.EnterpriseWebFramework; // Parameter: string fileName namespace EnterpriseWebLibrary.WebSite { partial class GetSchema: EwfPage { partial class Info { internal string FilePath { get; private set; } protected override void init() { FilePath = EwlStatics.CombinePaths( ConfigurationStatics.FilesFolderPath, FileName + FileExtensions.Xsd ); if( !File.Exists( FilePath ) ) throw new ApplicationException( "File does not exist." ); } protected override ConnectionSecurity ConnectionSecurity => ConnectionSecurity.NonSecure; } protected override EwfSafeRequestHandler requestHandler => new EwfSafeResponseWriter( () => EwfResponse.Create( ContentTypes.Xml, new EwfResponseBodyCreator( () => File.ReadAllText( info.FilePath ) ) ), EwlStatics.EwlBuildDateTime, () => "getSchema" + info.FileName ); } }