Native HTTP SOAP Access


Another new XML-related feature found in SQL Server 2005 is native HTTP SOAP support. This new feature enables SQL Server to directly respond to the HTTP/SOAP requests that are issued by web services without requiring an IIS system to act as an intermediary. Using the native HTTP SOAP support, you can create web services that are capable of executing T-SQL batches, stored procedures, and user-defined scalar functions. To ensure a high level of default security, native HTTP access is turned off by default. However, you can enable HTTP support by first creating an HTTP endpoint. You can see an example of the code to create an HTTP endpoint in the following listing:

CREATE ENDPOINT MyHTTPEndpoint STATE = STARTED AS HTTP(    PATH = '/sql',    AUTHENTICATION = (INTEGRATED ),    PORTS = ( CLEAR ),    SITE = 'server'    ) FOR SOAP (    WEBMETHOD 'http://tempUri.org/'.'GetProductName'             (name='AdventureWorks.dbo.GetProductName',              schema=STANDARD ),    BATCHES = ENABLED,    WSDL = DEFAULT,    DATABASE = 'AdventureWorks',    NAMESPACE = 'http://AdventureWorks/Products'    )

This example illustrates creating an HTTP endpoint named MyHTTPEndPoint for the stored procedure named GetProductName in the sample AdventureWorks database. Once the HTTP endpoint is created, it can be accessed via a SOAP request issued by an application. You can use the ALTER ENDPOINT and DROP ENDPOINT DDL statements to manage SQL Server’s HTTP endpoints. The new HTTP endpoints are also able to provide data stream encryption using SSL. More information about SQL Server’s new HTTP support can be found in Chapter 2.

The follow command shows how to list the HTTP endpoints that have been created:

select * from sys.http_endpoints




Microsoft SQL Server 2005 New Features
Microsoft SQL Server 2005 New Features
ISBN: 0072227761
EAN: 2147483647
Year: 2005
Pages: 80
Authors: Michael Otey

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net