<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>How to Create a Web Service in C#</Title>
      <Shortcut>HowtoCreateaWebServiceinC#</Shortcut>
      <Description>How to Create a Web Service in C# [C#]</Description>
      <Author>Robert Wagner</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=31201003-da6d-4683-8fd7-701c1e17e1f3</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[//BusinessLogicMethod() is not exposed to the public to use
//(because it is not declared as a Web method), 
//but WebServiceMethod() is.
//All you have to do is extend the WebService class and identify which methods are Web service //methods using the WebMethod attribute
//using System.Web.Services;
public class AWebService : WebService
{
  public AWebService 
  {
    // constructor code 
  }
  public void BusinessLogicMethod() {
    // code here
  }
  [WebMethod(Description="A Web Method", EnableSession=false)]
  public int WebServiceMethod() 
  {
    // code here
  }
}
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>