... the day was “Do
you have aWeb site?” A well-designed Web site was a
new and exciting marketing medium that businesses and
users alike saw as a novel, nice-to-have tool. Fast-forward a
decade and ... for a cheap and amateur-
ish site will devalue your business
and can do more harm to your
professional image and reputa-
tion than not having aWeb site
at all. Remember: Building a
Web site ... support
PHP
Perl
ASP
.NET
Database Support
MS-Access
MS-SQL
MySQL
Oracle
DB2
PostgreSQL
continued
To avoid the administration hassles of having to deal with a separate Web site host and domain name registrar,
register...
... type a directory name or file name in a dialog box or
at a command prompt.
ALL CAPITALS
Indicate the names of keys, key sequences, and key
combinations — for example, ALT+SPACEBAR.
monospace ... Implementing a Nonstandard WebService
Overview 1
HTML Screen Scraping Web Services 2
Aggregating Web Services 13
Lab 9: Implementing an Aggregated WebService 17
Review 28
Developing XML Web ... trade-offs and issues involved in designing a real-world Web
Service.
"
Implement nonstandard Web Services such as Hypertext Markup Language
(HTML) screen scraping and aggregating Web Services....
... method to return a DataSet with a DataTable
containing all the rows from the Customers table (see Figure 17.6
). Notice that the space
characters in the whereClause parameter value have been converted ... returns a DataSet with a DataTable containing the one
row from the Customers table with a CustomerID of ALFKI, as shown in Figure 17.5
.
Notice that the equals (=) and single quote (') characters ... 'ALFKI'
As you can see from Figure 17.5
, the DataSet is returned as an XML document. You can
use this XML in your client programs that use the Web service. You'll see how to write a
client...
... SqlCommand mySqlCommand = mySqlConnection.CreateCommand();
mySqlCommand.CommandText = selectString;
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter();
mySqlDataAdapter.SelectCommand = ... null;
Creating aWebService
In this section, you'll create aWebservice that contains a method that returns a DataSet
containing rows from the Customers table.
Start VS .NET and select ... Customers class is derived from the System .Web. Services.WebService
class, which indicates that the Customers class forms part of aWeb service.
Near the end of Listing 1.1
, you'll notice a method...
... your email address, name, and phone number
Read the Terms Of Use page and click Accept if you want to continue.
If you create a really useful Webservice that you believe other organizations ... people's Web services in
your system. You can even register Web services for your own organization's intranet
and build an internal system made up of Web services written internally. ... in using a Microsoft Passport account
Note If you don't have a Passport account, click the Get One Now link and sign up for a
Passport account.
Enter your email address, name, and phone...
... TestKingProductsDataset.Copy
C. Dim NewDataSet as New DataSet ( )
newDataSet.Tables.Add (“TestKingProductsDataset”)
D. Dim newDataSet as New Dataset ( )
newDataSet.Tables.Add (TestKingProductsDataset.Tables ... don’t want exceptions.
Line 2: TKDataAdapter.Update (CategoriesDataSet, “Categories”)
We update the database. All updated rows in the Dataset are updated in the database as well.
Line 3: If categoriesDataSet.Tables ... are developinga order-processing application that retrieves data from a Microsoft SQL Server
database contains a table named TestKCustomers and a table named Orders.
Customer has a primary...
... Building and Consuming aWebService That Uses ADO.NET
Lesson: Building and Consuming aWebService That
Returns Data
!
What Is aWeb Service?
!
How to Build aWebService That Returns Database ... class.
!
What are some other ways that you could fill the local DataSet with data
other than by using a DataAdapter?
!
What is the purpose of creating an empty, local instance of a DataSet?
! ... Consuming aWebService That Uses ADO.NET
How to Build aWebService That Returns Database Information
!
Web services that return database information
typically:
"
Establish a connection...
... the same
architecture as all Windows services regardless of the language they are built in.
Table 2-1 enumerates the three parts of all service architectures.
What makes the Windows service fairly ... process
<MTAThread()> _
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
' More than one NT Service may run within the same process. To add
' another service ... what type of startup you wish to have. The options are:
■
Automatic The service will be started as part of the operating system’s boot
sequence.
■
Manual The service is enabled and will be started...
... c:\jakarta-tomcat\classes;c:\jakarta-
tomcat\lib\ant.jar;c:\jakarta-tomcat\lib\jaxp.jar;c:\jakarta-
➥
tomcat\lib\servlet.jar;c:\jakarta-tomcat\lib\parser.jar;c:\jakarta-tomcat\lib\we
➥
bserver.jar;c:\jakarta-tomcat\lib\jasper.jar;c:\jakarta-
➥
tomcat\lib\xalanservlet.jar;c:\jakarta-tomcat\lib\xerces.jar;c:\jakarta-
➥
tomcat\lib\xalanj1compat.jar;c:\jakarta-tomcat\lib\aaxalan.jar;c:\jdk1.3\lib\too
➥
ls.jar
2001-05-23 ... c:\jakarta-tomcat\classes;c:\jakarta-
tomcat\lib\ant.jar;c:\jakarta-tomcat\lib\jaxp.jar;c:\jakarta-
➥
tomcat\lib\servlet.jar;c:\jakarta-tomcat\lib\parser.jar;c:\jakarta-tomcat\lib\we
➥
bserver.jar;c:\jakarta-tomcat\lib\jasper.jar;c:\jakarta-
➥
tomcat\lib\xalanservlet.jar;c:\jakarta-tomcat\lib\xerces.jar;c:\jakarta-
➥
tomcat\lib\xalanj1compat.jar;c:\jakarta-tomcat\lib\aaxalan.jar;c:\jdk1.3\lib\too
➥
ls.jar
2001-05-23 ... CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;c:\xalan-j_1_2_2\xerces.jar
set CLASSPATH=%CLASSPATH%;c:\xalan-j_1_2_2\xalan.jar
This will cause some extra work when you want to access Xalan...
... discussed and heralded in particular as a great benefit in connecting
legacy applications to modern Web- based applications.
Within aWeb application, passing even one parameter that contains XML data ... database management system
because handling chat data is an obvious job.We decided against that for several rea-
sons. One is that we did not want to assume that all our readers are familiar ...
value=“&lt;tree&gt;&lt;topic&gt;Chess Players
Chat&lt;/topic&gt;&lt;moderator&gt;Harvey
Wilkinson&lt;/moderator&gt;&lt;/tree&gt;”>
Notice that...
...
bonForumXML
(a
ForestHashtable
) as a string.
Now we decided to make it the input XML stream for the Xalan XSLT processor as
part of our
TransformTag
class.
Displaying the available chats would mean ... for a bonForum user to become a host by starting a chat and
then re-enter the same chat as a guest.The problem is that that user then loses the
capability to again be a host of that chat. Having ... problem was
that for a user to join a chat as a guest, its thread had to first find the chat.The chat
was not attached to the session of the would-be guest. Rather, the chat was attached
to the...
... logic, by
making one more variable available to each JSP-produced page of a bonForum
instance.
The incoming request parameters are validated and made available to the Web
application in whatever ... the applet parameters right on
the _robot page? Using the same target parameter as we did in the last section as an
example, that would mean doing this:
<jsp:param name=”target” value=”display”/>
The ... destination in the Web app.The
bonCommand
originates on
a JSP-generated form and is available to the
service( )
method as a request
parameter.
08 1089-9 CH08 6/26/01 7:33 AM Page 197
Please purchase...
... remove this watermark.
279
8.2 The BonForumStore Class
object.That means that all the pathnames are available again but are sorted alphabeti-
cally.The code on a JSP document likes it that way.
The ... database (now a
ForestHashtable
)
n
Initializes the XML database for use as a chat Web app
n
Loads XML files into a database using its methods
n
Dumps the content of the database as XML in a string
n
Provides ... there are two such XSLT classes, one for Xalan-Java 1 and one for Xalan-
Java 2.
Simplifying greatly, here are the statements called by the
TransformTag
class to get
its XML database in a string:
private...
... will assume as it translates the tag that
these variables are available as page attributes. Later, when we look at the translated
Java code for a Tag Handler instance, you can see where the value ... bean from Tag Handler classes, and there are different ways to manage that.
A bean can even be made into a tag handler itself, simply by implementing the
Tag
interface.We make our bean available ...
TagExtraInfo
.That means that the JSP container will be capa-
ble of using this class at translation or compilation time to get information about vari-
ables that are used in the Web application....