Thursday, January 29, 2009

Unable to create SQL ENDPOINT

Problem I'm doing a SQL Server CREATE ENDPOINT lab.  I have stopped the IIS Admin service, as recommended in the documentation.  I am connected to SQL Server as a Local Admin user (with full SA rights).  But still the CREATE ENDPOINT statement was failing:

CREATE ENDPOINT GetEngineeringList
STATE = STARTED
AS HTTP (
SITE = 'localhost' ,
  PATH = '/sql/employees' ,
AUTHENTICATION=(INTEGRATED),
PORTS=(CLEAR)
)
FOR SOAP (
WEBMETHOD 'GetEngineeringEmployees'
(
  name = 'AdventureWorks.dbo.GetEngineeringEmployees' ,
  schema =STANDARD
),
WSDL= DEFAULT ,
  DATABASE = 'AdventureWorks' ,
BATCHES=ENABLED
)
Explanation Contrary to logic, the CREATE ENDPOINT statement does not run with the rights of the issuing user.  It runs with the rights of the SQL Server service account.  That account doesn't have rights to the PATH I specified.
Solution Reserve the PATH using this command:

EXECUTE sp_reserve_http_namespace N 'http://localhost:80/sql/employees'

No comments:

Post a Comment