~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to data/templates/project/CSharp/WebService.xpt

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<Template originator   = "Jusin Dearing"
 
3
                  created      = "06/09/2006"
 
4
                  lastModified = "06/09/2006">
 
5
 
 
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>
 
14
 
 
15
        <!-- Actions -->
 
16
        <Actions>
 
17
                <Open filename = "Default.asmx" />
 
18
                <Open filename = "Soap.cs" />
 
19
        </Actions>
 
20
 
 
21
        <Project language = "C#">
 
22
                <ProjectItems>
 
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" />
 
29
                </ProjectItems>
 
30
                
 
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>
 
35
                </PropertyGroup>
 
36
                
 
37
                <PropertyGroup configuration="Debug">
 
38
                        <OutputPath>bin\</OutputPath>
 
39
                </PropertyGroup>
 
40
                
 
41
                <PropertyGroup configuration="Release">
 
42
                        <OutputPath>bin\</OutputPath>
 
43
                </PropertyGroup>
 
44
 
 
45
        <Files>
 
46
                <File name="Soap.cs" DependentUpon="Default.asmx"><![CDATA[${StandardHeader.C#}
 
47
using System;
 
48
using System.Data;
 
49
using System.Web;
 
50
using System.Web.Services;
 
51
using System.Web.Services.Protocols;
 
52
 
 
53
namespace ${StandardNamespace}
 
54
{
 
55
        [WebService]
 
56
        public class Soap : System.Web.Services.WebService
 
57
        {
 
58
                /// <summary>
 
59
                /// Logs into the web service
 
60
                /// </summary>
 
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)
 
66
                {
 
67
                        //NOTE: There are better ways of doing authentication. This is just illustrates Session usage.
 
68
                        UserName = userName;
 
69
                        return true;
 
70
                }
 
71
                
 
72
                /// <summary>
 
73
                /// Logs out of the Session.
 
74
                /// </summary>
 
75
                [WebMethod(EnableSession=true)]
 
76
                public void Logout()
 
77
                {    
 
78
                        Context.Session.Abandon();
 
79
                }
 
80
                
 
81
                /// <summary>
 
82
                /// UserName of the logged in user.
 
83
                /// </summary>
 
84
                private string UserName {
 
85
                        get {return (string)Context.Session["User"];}
 
86
                        set {Context.Session["User"] = value;}
 
87
                }
 
88
        }
 
89
}
 
90
]]></File>
 
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"?>
 
94
<configuration>
 
95
        <appSettings/>
 
96
        <connectionStrings/>
 
97
        <system.web>
 
98
                <!--
 
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
 
102
                        during development.
 
103
                -->
 
104
                <compilation debug="true"/>
 
105
                <!--
 
106
                        The <authentication> section enables configuration
 
107
                        of the security authentication mode used by
 
108
                        ASP.NET to identify an incoming user.
 
109
                -->
 
110
                <authentication mode="Windows"/>
 
111
                <!--
 
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.
 
117
                
 
118
                <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm ">
 
119
                        <error statusCode="403" redirect="NoAccess.htm" />
 
120
                        <error statusCode="404" redirect="FileNotFound.htm" />
 
121
                </customErrors>
 
122
                -->
 
123
        </system.web>
 
124
</configuration>]]></File>
 
125
                                <File name="Properties\AssemblyInfo.cs" src="DefaultAssemblyInfo.cs" />
 
126
           </Files>
 
127
        </Project>
 
128
</Template>