Listing 1: CREATE ENDPOINT

CREATE ENDPOINT EmployeeWebService
STATE = STARTED
AS HTTP (
  PATH = '/Employee'
  ,AUTHENTICATION = (INTEGRATED)
  ,PORTS = (CLEAR)
  ,CLEAR_PORT = 8080
  ,SITE = '*'
  ,COMPRESSION = ENABLED)
FOR SOAP (
  WEBMETHOD 'GetEmployeeManagers' (
    NAME = 'AdventureWorks.dbo.uspGetEmployeeManagers'
    ,SCHEMA = STANDARD
    ,FORMAT = ROWSETS_ONLY)
  ,WEBMETHOD 'GetManagerEmployees' (
    NAME = 'AdventureWorks.dbo.uspGetManagerEmployees'
    ,SCHEMA = STANDARD
    ,FORMAT = ROWSETS_ONLY)
  ,BATCHES = ENABLED
  ,WSDL = DEFAULT
  ,DATABASE = 'AdventureWorks'
  ,NAMESPACE = 'http://mynamespace.org')


Listing 2: Test Client Code

Private Sub btnEmployeeManagers_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) _
        Handles btnEmployeeManagers.Click

  Dim proxy As EmployeeWebService = _
            New EmployeeWebService

  proxy.Credentials = _
    CredentialCache.DefaultCredentials

  Dim Result As System.Data.DataSet
  Result = proxy.GetEmployeeManagers(1)
  DataGridView1.DataSource = _
    Result.Tables(0)

End Sub

Private Sub btnManagerEmployees_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) _
        Handles btnManagerEmployees.Click

  Dim proxy As EmployeeWebService = _
            New EmployeeWebService

  proxy.Credentials = _
    CredentialCache.DefaultCredentials

  Dim Result As System.Data.DataSet
  Result = proxy.GetManagerEmployees(148)
  DataGridView1.DataSource = _
    Result.Tables(0)
End Sub

Private Sub btnSQLBatch_Click( _
        ByVal sender As System.Object, _
        ByVal e As System.EventArgs) _
        Handles btnSQLBatch.Click

  Dim proxy As EmployeeWebService = _
            New EmployeeWebService

  proxy.Credentials = _
    CredentialCache.DefaultCredentials

  Dim SQL AS String
  SQL = "SELECT * " & _
        "FROM HumanResources.Department"

  Dim Result As System.Data.DataSet
  Result = proxy.sqlbatch _
          (SQL, Nothing)(0)

  DataGridView1.DataSource = _
    Result.Tables(0)

End Sub