Monday, October 8, 2007

Implicit vs. Explicit http namespace reservation

Implicit namespace is reserved when you run the CREATE HTTP ENDPOINT statement. You must have the local Windows administrator privileges for the HTTP endpoint registration to succeed. However, this namespace can be taken by other applications if the instance of SQL Server is not running.

When you explicitly reserve a namespace, the namespace is reserved specifically for SQL Server, and all HTTP requests to this endpoint are forwarded to the instance of SQL Server. This namespace cannot be taken by other applications if the instance of SQL server is not running. You must have the local Windows Administrator privileges to run the explicit reservation stored procedure: sp_reserve_http_namespace.

For example, you can connect to an instance of SQL Server 2005 by using Windows authentication, a login that has administrator privileges, and execute the following:

sp_reserve_http_namespace N'http://MyServer:80/sql'
GO


A user without any computer administrator privileges can execute the endpoint DDL statement.
CREATE ENDPOINT sql_endpoint
STATE = STARTED
AS HTTP(
PATH = '/sql/AdvWorks',
AUTHENTICATION = (INTEGRATED ),
PORTS = ( CLEAR ),
SITE = 'MyServer'
)
FOR SOAP (
...
)
GO