...
Code Block | ||
---|---|---|
| ||
<%@ CodeTemplate Language="VB" TargetLanguage="T-SQL" Description="Create an HTTP Endpoint." %> <%@ Property Name="InitialState" Type="StateEnum" Category="Options" Default="STARTED" Description="The initial state of the Web service." %> <%@ Property Name="Authentication" Type="AuthenticationEnum" Category="Options" Default="INTEGRATED" Description="Authentication method." %> <%@ Property Name="Port" Type="PortsEnum" Category="Options" Default="CLEAR" Description="Port to use." %> |
Code Block | ||
---|---|---|
| ||
CREATE PROC dbo.PersonAddressTypeProc AS SELECT AddressTypeID, Name, rowguid, ModifiedDate FROM Person.AddressType GO CREATE ENDPOINT GetAddressType STATE = <%= GetState(InitialState) %> AS HTTP ( PATH = '/AddressType', AUTHENTICATION = (<%= GetAuthentication(Authentication) %>), PORTS = (<%= GetPort(Port) %>), SITE = 'localhost' ) FOR SOAP ( WEBMETHOD 'AddressTypeList' (NAME='AdventureWorks.dbo.PersonAddressTypeProc'), BATCHES = DISABLED, WSDL = DEFAULT, DATABASE = 'AdventureWorks', NAMESPACE = 'http://AdventureWorks/AddressType' ) GO |
Code Block | ||
---|---|---|
| ||
<script runat="template"> Public Enum StateEnum STARTED STOPPED DISABLED End Enum Public Enum AuthenticationEnum BASIC DIGEST NTLM KERBEROS INTEGRATED End Enum Public Enum PortsEnum CLEAR SSL End Enum Public Function GetState (ByVal State As StateEnum) As String Select Case State Case StateEnum.STARTED GetState = "STARTED" Case StateEnum.STOPPED GetState = "STOPPED" Case StateEnum.DISABLED GetState = "DISABLED" End Select End Function Public Function GetAuthentication (ByVal Authentication As AuthenticationEnum) As String Select Case Authentication Case AuthenticationEnum.BASIC GetAuthentication = "BASIC" Case AuthenticationEnum.DIGEST GetAuthentication = "DIGEST" Case AuthenticationEnum.NTLM GetAuthentication = "NTLM" Case AuthenticationEnum.KERBEROS GetAuthentication = "KERBEROS" Case AuthenticationEnum.INTEGRATED GetAuthentication = "INTEGRATED" End Select End Function Public Function GetPort (ByVal Port as PortsEnum) As String Select Case Port Case PortsEnum.CLEAR GetPort = "CLEAR" Case PortsEnum.SSL GetPort = "SSL" End Select End Function </script> |
...