Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1782 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
3 changed files with 140 additions and 0 deletions
@ -0,0 +1,127 @@
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Jusin Dearing" |
||||
created = "06/09/2006" |
||||
lastModified = "06/09/2006"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>${res:Templates.Project.WebService.Name}</Name> |
||||
<Category>C#</Category> |
||||
<Subcategory>ASP.NET</Subcategory> |
||||
<Icon>C#.Project.Form</Icon> |
||||
<LanguageName>C#</LanguageName> |
||||
<Description>${res:Templates.Project.WebService.Description}</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "Default.asmx" /> |
||||
<Open filename = "Soap.cs" /> |
||||
</Actions> |
||||
|
||||
<Combine name = "${ProjectName}" directory = "."> |
||||
<Options> |
||||
<StartupProject>${ProjectName}</StartupProject> |
||||
</Options> |
||||
|
||||
<Project name = "${ProjectName}" directory = "."> |
||||
<Options OutputType = "Library" /> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Web" /> |
||||
<Reference Include="System.Web.Services" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ProjectItems> |
||||
|
||||
<PropertyGroup> |
||||
<OutputPath>bin\</OutputPath> |
||||
</PropertyGroup> |
||||
|
||||
<Files> |
||||
<File name="Soap.cs" dependentUpon="Default.asmx"><![CDATA[${StandardHeader.C#} |
||||
using System; |
||||
using System.Data; |
||||
using System.Web; |
||||
using System.Web.Services; |
||||
using System.Web.Services.Protocols; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
[WebService] |
||||
public class Soap : System.Web.Services.WebService |
||||
{ |
||||
/// <summary> |
||||
/// Logs into the web service |
||||
/// </summary> |
||||
/// <param name="userName">The User Name to login in as</param> |
||||
/// <param name="password">User's password</param> |
||||
/// <returns>True on successful login.</returns> |
||||
[WebMethod(EnableSession=true)] |
||||
public bool Login(string userName, string password) |
||||
{ |
||||
//NOTE: There are better ways of doing authentication. This is just illustrates Session usage. |
||||
UserName = userName; |
||||
return true; |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Logs out of the Session. |
||||
/// </summary> |
||||
[WebMethod(EnableSession=true)] |
||||
public void Logout() |
||||
{ |
||||
Context.Session.Abandon(); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// UserName of the logged in user. |
||||
/// </summary> |
||||
private string UserName { |
||||
get {return (string)Context.Session["User"];} |
||||
set {Context.Session["User"] = value;} |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="Default.asmx" language="XML"><![CDATA[<%@ WebService Language="C#" Class="${StandardNamespace}.Soap,Soap" %>]]></File> |
||||
<!--*************************************************************************--> |
||||
<File name="Web.config" language="XML"><![CDATA[<?xml version="1.0"?> |
||||
<configuration> |
||||
<appSettings/> |
||||
<connectionStrings/> |
||||
<system.web> |
||||
<!-- |
||||
Set compilation debug="true" to insert debugging |
||||
symbols into the compiled page. Because this |
||||
affects performance, set this value to true only |
||||
during development. |
||||
--> |
||||
<compilation debug="true"/> |
||||
<!-- |
||||
The <authentication> section enables configuration |
||||
of the security authentication mode used by |
||||
ASP.NET to identify an incoming user. |
||||
--> |
||||
<authentication mode="Windows"/> |
||||
<!-- |
||||
The <customErrors> section enables configuration |
||||
of what to do if/when an unhandled error occurs |
||||
during the execution of a request. Specifically, |
||||
it enables developers to configure html error pages |
||||
to be displayed in place of a error stack trace. |
||||
|
||||
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm "> |
||||
<error statusCode="403" redirect="NoAccess.htm" /> |
||||
<error statusCode="404" redirect="FileNotFound.htm" /> |
||||
</customErrors> |
||||
--> |
||||
</system.web> |
||||
</configuration>]]></File> |
||||
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" /> |
||||
</Files> |
||||
</Project> |
||||
</Combine> |
||||
</Template> |
Loading…
Reference in new issue