Flylib.com

Books Software

 
 
 

Native HTTP SOAP Access


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



XML Enhancements for Analysis Server

While the majority of the XML enhancements in SQL Server 2005 have been implemented for the relational database engine, Analysis Services has also received several important new XML- related features, the most important of which is the new XML for Analysis Services also known as XMLA. In this section you’ll learn more about the new XML for Analysis Services feature.

XML for Analysis Services

XML for Analysis Services is an API that provides data access to Analysis Services data sources that reside on the web. XML for Analysis Services is modeled after OLE DB in that it is intended to provide a universal data access model for any multidimensional data source. However, unlike COM-based OLE DB, XML for Analysis Services is built on the XML-based SOAP protocol. Also unlike OLE DB, which was built with the client/server model in mind, XML for Analysis Services is optimized for use on the web.

XML for Analysis Services provides two publicly accessible methods : the Discover method and the Execute method. As its name implies, the Discover method gets information about a data source. The Discover method can list information about the available data sources, the data source providers, and the metadata that is available. The Execute method enables an application to run commands against XML for Analysis Services data sources.



System XML Catalog Views

SQL Server 2005 stores information about the XML that’s used in the server in a number of new system views. Table 7-1 briefly describes the new system XML views.

Table 7-1: SQL Server 2005 XML Catalog Views

XML Catalog View

Description

sys.xml_attributes

This view provides a row for each stored XML attribute.

sys.xml_components

This view provides a row for each component of an XML schema.

sys.xml_component_placements

This view provides a row for each placement of an XML component.

sys.xml_elements

This view provides a row for each XML component that is an XML element.

sys.xml_facets

This view provides a row for each facet (restriction) of an XML type.

sys.xml_model_groups

This view provides a list of all the XML component that are part of a Model- Group .

sys.xml_namespaces

This view provides a row for each XSD-defined namespace.

sys.xml_types

This view provides a row for each XML component that is an XML type.

sys.xml_wildcards

This view provides a row for each XML attribute or element wildcard.

sys.xml_wildcard_namespaces

This view provides a row for each XML wildcard namespace.