IV.5.2. Using Web Services in Conjunction with SQL Server

SQL Server can be used to provide Web services directly. To support Web services in SQL Server, you need to create the following elements:

  • Stored procedure: A stored procedure used in a Web service is the same as any stored procedure created within SQL Server. The only difference is that it will be called from a Web Method.

  • HTTP endpoint: An HTTP endpoint is a designated port that SQL Server listens on for specific traffic. The HTTP endpoint includes a Web method.

  • Web method: A Web method identifies a stored procedure within SQL Server that will be executed when the HTTP endpoint is queried. A Web method would commonly accept parameters, execute a store procedure with the parameters, and then return the results.

IV.5.2.1. Creating HTTP endpoints to support Web services

Within SQL Server, a Web service can be created by creating an HTTP endpoint. The HTTP endpoint identifies the port that SQL Server will use to listen for Web service requests and the Web method that will be executed in response to a valid request.

To better understand how HTTP endpoints work, it helps to understand how IP addresses and ports are used by computers.

When data travels from one computer to another, it finds the destination computer using an IP address. If your long lost uncle wanted to send you an inheritance check from your other long lost uncle, he'd put the check in an envelope, stamp it, and hand it to the post office. An IP address works ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.