As you know, XML is no longer a simple markup language that programmers use to unclutter data on the Web. Instead, XML has become the basis for standards, such as SOAP and Web services. These standards will soon become the basis for the architecture used to develop the next generation of distributed applications.
To integrate XML with the application that uses SQL Server 2000, you can use SQLXML 3.0. This toolkit allows SQL Server 2000 to provide a more robust and varied support for XML than its built-in tools and commands. We will now discuss the SQLXML 3.0 package and its features in detail.
Introduction to SQLXML 3.0
As discussed earlier, SQLXML 3.0 uses SQL Server 2000 to expose Web services that use the SOAP messaging techniques. SOAP enables your applications to act as a client of the Web services that SQL Server exposes. Web services that are created by using SQLXML 3.0 extend support for the execution of stored procedures, user-defined functions, and templates.
Another key feature of SQLXML 3.0 is the managed classes that are exposed within the .NET Framework. These classes extend the ability to access XML data from Microsoft SQL Server from within the .NET environment.
In this project, you will learn how to expose a stored procedure as a Web service and how to access the Web service. You also will learn how to use the SQMLXML managed classes to execute SQL queries from the .NET applications.
Accessing SQL Server Data Through the Web
Before proceeding to work with the SQLXML 3.0 toolkit, you will need the following software:
In this section, you will learn how to access data in an SQL Server database by using XML and Internet Explorer.
Querying the Database by Using XML Templates
To access the data in a SQL Server database, you first need to create a virtual directory and a few support files. You can do this in two ways, as mentioned in the following list:
Management Console (MMC) snap-in Because the IIS Virtual Directory Management for SQLXML 3.0 is designed for creating virtual directories for hosting XML templates and stored procedure-based Web services, in this section, we will discuss the second way of creating a virtual directory. These utilities install automatically with SQLXML 3.0 from the SQLXML 3.0 program group. To run the MMC snap-in utilities, perform the following steps:
The IIS Virtual Directory Manager.
The New Virtual Directory Properties Window.
The Security Tab.
The Data Source Tab.
The Settings Tab.
The Virtual Names Tab.
The Advanced Tab.
Note:If the ISAPI extension DLL that you plan to use is correctly installed and registered, the path in the dialog box will appear correctly.
After performing the preceding steps, you can access the virtual directory that you created and configured by using the Internet protocols. The next step in accessing the data from an SQL Server database is to create an XML template, which you can access by using a browser.
The content of the template file is shown in the following code:
The preceding code displays the contents of the Employees table in the Northwind database. Save the file as emp.xml in the templates folder.
The next step is to test the SQLXML installation by connecting to the virtual directory that you have created. To do this, you can use the http:// localhost /SqlXmlProj1 /templates /emp.xml URL. The emp.xml file, as shown in Figure is displayed.
Querying Through a Template.
Creating a Web Service
Next, you will create a Web service that accesses data from a database and returns some values. In this case, you will create a Web service that exposes the functionality of a stored procedure called Ten Most Expensive Products from the Northwind sample database. To create a Web service, perform the following steps:
The Soap Virtual Name Configuration Dialog Box.
The SOAP Stored Procedure Mapping dialog box is displayed, as shown in Figure.
The SOAP Stored Procedure Mapping Dialog Box.
Files in the Soap Folder
The following code displays the contents of the .wsdl file for the Web service:
The Web service that the preceding .wsdl file supports contains only a single Web method called Ten_Most_Expensive_Products(). The .wsdl file also specifies the location where you can connect to the Web service.
After looking at the .wsdl file, consider the contents of the .ssc file, as shown in the following code snippet:
Notice that the preceding file connects the Web service method to the stored procedure.
Testing the Web Service
To test a Web service, create a client application that accesses the Web service. In this case, you will create a Visual Basic 6.0 client application that makes use of the SOAP Toolkit to connect to the Web service.
The client application contains a Button control. When you clic on the Button control, the application connects to a Web service and returns the required data. The returned data is in the form of an XML node list. You then need to parse the XML node list, which is displayed in a message box.
To create a client application in Visual Basic 6.0, perform the following steps:
XML Related Interview Questions
|Soap Tool Interview Questions||HTML Interview Questions|
|PHP Interview Questions||ASP.NET Interview Questions|
|PHP5 Interview Questions||Java Interview Questions|
|CSS Interview Questions||XSLT Interview Questions|
|Java XML Interview Questions||XMLHttpRequest (XHR) Interview Questions|
|ebXML Interview Questions||XML DOM Interview Questions|
|XML-RPC Interview Questions||XSD Interview Questions|
|Soap Web Services Interview Questions||XSL Interview Questions|
|Xml Publisher Interview Questions|
Basics Of Xml
Basics Of Web Services
Introduction To Soap
Introduction To Uddi
Introduction To Wsdl
Creating A Web Service Using The Microsoft Soap Toolkit
Building Web Applications On The .net Platform
Creating An Asp.net Web Service
Creating A Web Service From An Interface
Introduction To The Atl Server
Creating A Web Service Using The Atl Server Library
Design And Creation Of The Knowledge Share Web Service
Introduction To Java Xml Technologies
Developing Java Web Services
Design And Creation Of A Web Service Using The Ibm Toolkit
Introduction To Mobile Applications
Creating A Mobile Application That Consumes A Web Service
Web Services Development With Jdeveloper
Creating Web Services Using Perl
Integration Of Xml Web Services With The Office Xp And Sql
Server 2000 Toolkits
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.