| By Jerry Dixon | Article Rating: |
|
| March 14, 2006 10:00 AM EST | Reads: |
20,594 |
Our example endpoint is now complete. When executed, this statement creates a Web Service named EmployeeWebService that has three Web methods: GetEmployeeManagers, GetManagerEmployees, and SQLBatch.
Security
Now that we've defined our endpoint, we need to discuss security. Endpoints are secured separately from the functions and procedures that they invoke. In effect, this means that a user must have rights to invoke both the endpoint and the function or procedure. For example, in order to successfully execute all of the features of our demonstration Web service, a user would need:
- CONNECT permission on the EmployeeWebService endpoint.
- EXECUTE permission on the uspGetEmployeeManagers stored procedure.
- EXECUTE permission on the uspGetManagerEmployees stored procedure.
- Individual permissions on one or more tables in the AdventureWorks database. (This is required because BATCHES are ENABLED, and ad hoc T-SQL statements may be executed. NOTE: this is not a recommended practice and is presented here for illustration purposes only.)
GRANT CONNECT ON ENDPOINT:: EmployeeWebService to Bob
Testing
In order to test the newly created Web service, we need to create a client program. I chose to use a .NET Windows application for this purpose. (You can't test an SQL Server Web service in Internet Explorer as you can with .NET Web services because there are no HTTP interfaces and no forms provided.) The client program needed an appropriate WSDL document in order to create the Web service proxy class. SQL Server provides this document via a special URL parameter, WSDL, as in HTTP://LOCALHOST:8080/Employee?WSDL. I used the Add Web Reference wizard and pointed the browser to that URL. It generated the proxy class for me, and I ran some tests. You can see my test code in Listing 2, and the results in Figure 1, Figure 2, and Figure 3. The test application had no clue that this Web service was provided by SQL Server and not IIS.
Summary
Now that SQL Server 2005 is here, we have an additional option when it comes to the creation of Web services. We can continue to create them with .NET, or we can create them with SQL Server. If we choose SQL Server then we no longer need IIS, and can instead use the HTTP API that is included in the Windows 2003 Servers and in Windows XP Service Pack 2. This gives us additional flexibility when designing a service-oriented system. It also makes SQL Server a more flexible and valuable tool than its predecessors.
Published March 14, 2006 Reads 20,594
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Jerry Dixon
Jerry Dixon is a senior developer and architect for ACH Food Companies in Memphis, Tennessee. Over the past 16 years he has led development projects for a number of enterprise, mid-level, and small business organizations. While he has fulfilled multiple roles as an infrastructure designer, database administrator, and software developer, he specializes in XML, SQL and ASP.NET. He is a co-leader and frequent presenter at the Memphis .NET User Group. Jerry holds the following Microsoft certifications: MCSD (VB 6.0 and .NET), MCDBA (SQL 2000), MCSA (Windows 2000 and 2003), MCSE (Windows 2000), MCAD (.NET), MCT. He resides in Olive Branch, MS with his wife and son.
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Expo and the End of Tech Recession
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Reality Check at the Cloud Computing Expo
- Visual Studio 2010 Is Cloud Friendly
- Fired SCO CEO Fires Back
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications





























