2
<Template originator = "Jusin Dearing"
4
lastModified = "06/09/2006">
6
<!-- Template Header -->
7
<TemplateConfiguration>
8
<Name>${res:Templates.Project.WebService.Name}</Name>
9
<Category>C#</Category>
10
<Subcategory>ASP.NET</Subcategory>
11
<Icon>C#.Project.Form</Icon>
12
<Description>${res:Templates.Project.WebService.Description}</Description>
13
</TemplateConfiguration>
17
<Open filename = "Default.asmx" />
18
<Open filename = "Soap.cs" />
21
<Project language = "C#">
23
<Reference Include="System" />
24
<Reference Include="System.Data" />
25
<Reference Include="System.Drawing" />
26
<Reference Include="System.Web" />
27
<Reference Include="System.Web.Services" />
28
<Reference Include="System.Xml" />
31
<PropertyGroup escapeValue="False">
32
<OutputType>Library</OutputType>
33
<AppDesignerFolder>Properties</AppDesignerFolder>
34
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
37
<PropertyGroup configuration="Debug">
38
<OutputPath>bin\</OutputPath>
41
<PropertyGroup configuration="Release">
42
<OutputPath>bin\</OutputPath>
46
<File name="Soap.cs" DependentUpon="Default.asmx"><![CDATA[${StandardHeader.C#}
50
using System.Web.Services;
51
using System.Web.Services.Protocols;
53
namespace ${StandardNamespace}
56
public class Soap : System.Web.Services.WebService
59
/// Logs into the web service
61
/// <param name="userName">The User Name to login in as</param>
62
/// <param name="password">User's password</param>
63
/// <returns>True on successful login.</returns>
64
[WebMethod(EnableSession=true)]
65
public bool Login(string userName, string password)
67
//NOTE: There are better ways of doing authentication. This is just illustrates Session usage.
73
/// Logs out of the Session.
75
[WebMethod(EnableSession=true)]
78
Context.Session.Abandon();
82
/// UserName of the logged in user.
84
private string UserName {
85
get {return (string)Context.Session["User"];}
86
set {Context.Session["User"] = value;}
91
<File name="Default.asmx" language="XML"><![CDATA[<%@ WebService Language="C#" Class="${StandardNamespace}.Soap" %>]]></File>
92
<!--*************************************************************************-->
93
<File name="Web.config" language="XML"><![CDATA[<?xml version="1.0"?>
99
Set compilation debug="true" to insert debugging
100
symbols into the compiled page. Because this
101
affects performance, set this value to true only
104
<compilation debug="true"/>
106
The <authentication> section enables configuration
107
of the security authentication mode used by
108
ASP.NET to identify an incoming user.
110
<authentication mode="Windows"/>
112
The <customErrors> section enables configuration
113
of what to do if/when an unhandled error occurs
114
during the execution of a request. Specifically,
115
it enables developers to configure html error pages
116
to be displayed in place of a error stack trace.
118
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm ">
119
<error statusCode="403" redirect="NoAccess.htm" />
120
<error statusCode="404" redirect="FileNotFound.htm" />
124
</configuration>]]></File>
125
<File name="Properties\AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" />