Analyzing the XQuery

Let's have a closer look at the code that produces this web page. You'll find the handler for the Find Order Details by Customer button on the code-behind page OrderSearch.aspx.es. It looks like this private void Buttonl_Click(object sender, System.EventArgs Executes the XQuery Search on the XQueryNavigatorCollection using an XML Web Server Control if(IstCustomer. Selectedltem null) selectedCustomer IstCustomer.Selectedltem if( selectedCustomer.Value) string strXQueryl < orderdetails> FOR a...

Info

When the button is clicked, the XQuery is compiled and run over the requested navigator collection, and the XML result returned is transformed and displayed using an XSL style sheet. There is also some code added to write the XML result to a file for checking, but this code is commented here - if you want to use it just uncomment those lines. Check if the path is correct and if the account used to run the application has write permission (by default, the ASP.NET account does not have it, and...

Implementations of XQuery

The XML Query Language working group maintains a list of early XQuery implementations, of which the most interesting, stable, and specification-compliant ones are listed below. (To see the complete list, see www.w3c.org XML Queryttproducts.) http ipsi.fhg.de oasys projects ipsi-xq index_e.html http otn.oracle.com tech xml xmldb htdocs querying_xml.html IPSI-XQ features an online demonstration, and a download that you can try out for yourself. It's implemented using Java. Microsoft's XQuery...

The Basket Service

The BasketService provides the functionality to select, edit, and maintain a list of items with methods that are pretty much as you would see in a traditional e-commerce web site although, as we've said previously, in a very simplified manner . The basket details are all held in a single column, BasketDetails, as an XmlDocument, so any actions on an item are all preformed by retrieving this column, moving it to an XmlDocument, manipulating the document, and then storing it back in the table....

Sample Asp Net Project using XQuery

Let's see how XQuery could be used in an ASP.NET project by creating an application to retrieve the current orders of any customer in the SQL Server Northwind sample database, and display the customer's details together with some order details. This project uses SQLXML and SQL Server 2000 to set up a virtual XML database, and then runs XQueries over the selected customer. The results are in XML format, so we'll use XSLT to present them on the user's screen. Note that although XQuery will...

WSSecurity and WSLicense

The purpose of this specification is to provide a set of SOAP extensions that can be used separately or together to build secure Web Services by enabling the passing of security information credentials , the use of XML-Signa'ure to ensure message integrity, and the use of XML-Encryption for message confidentiality. Organizations use credentials to positively identify each other before they start transacting. WS-Security can be used to exchange many different types of credentials, providing a...

The Basket Service Selected Code

Here we'll just be looking at the listBaskets method, where we use document fragments, and the addltem method, as an example of manipulating and storing the basket details as an XmlDocument. Again, the database connection string for the service is placed at the top of the class. In the listBaskets method we make use of document fragments and the very useful InnerXml property to create an XmlDocument with only a name change on DocumentElement. We could have done this via an XSLT stylesheet, but...

Word about Xml LinkedNode

If you refer back to the inheritance hierarchy we presented at the beginning of this chapter, you'll find a number of classes derived from XmlLinkedNode. They include classes for all of the XML constructs other than attributes, entities, and notations. What's significant about XmlLinkedNode classes is that they represent the XML types for which node order is important. In consequence, XmlLinkedNode overloads those properties of XmlNode that are important to ordered traversal, namely NextSibling...

Using SOAP over EMail

As previously mentioned, SOAP is not tied exclusively to HTTP but is designed to work with any transport protocol. One obvious alternative to HTTP is the mail protocol SMTP. Sending our credit check request over SMTP may look something like this although SOAP does not actually specify any bindings, that is what needs to appear in an e-mail header and body, for SMTP From online.application theloancompany.com To creditcheck checkcredit.com Subject Individual Credit Check Date Fri, 1 Dec 2002 10...

Building a SOAP Test Harness

Building a simple SOAP-based application to test our services can easily be done in an Internet Explorer HTML page. In the code download, testHarness2 .htm, gives us a suitable test harness and has the following appearance I WOAP Tetter Microsoft Internet Explorer Rte lt St View Favorites Tods Help ' Address lt xml version 1.0 encoding utf-8 gt lt soap Envelope xmlns xsi http www. w3.org 2001 XMLSchema-instance xmlns xsd http www. w3.org 2001 XMLSchema xmlns soap http schemas. xmlsoap.org soap...

Xml Reader and Xml Writer

Having read through the previous chapter, you're probably eager to start applying some of your XML know-how to XML documents in ASP.NET. In order to do that, you need to understand how to move documents back and forth, how to read them, how to parse them, and how to create them programmatically. In this chapter, we're going to see a series of .NET Framework classes that provide all these abilities, observing the rules of well-formed XML markup as they go. Specifically, this chapter will cover Q...

Creating the XQuery NavigatorCollection Object

Everything's now ready for us to begin writing some C code, starting with the code-behind page, Global. asax. cs. Add the following namespace declarations at the top of the file, just before the namespace XQuerySearchEngine line Then, add the following variable declarations just after the public class Global declaration Declare variables string strUrlXmlTemplateCustomers string strTJrlXmlTemplateOrders string strUrlXmlTemplateOrderDetails string strUrlXmlTemplateProducts string...

Differences between SOAP 11 and SOAP

At the time of writing, SOAP 1.2 is in Working Draft. ASP.NET's Web Service support is 1.1 compliant and WSDL binds to 1.1 but for completeness we will have a look the current major differences between SOAP 1.1 and SOAP 1.2 in addition to the different namespace of course Q SOAP 1.2 does not permit any element after the body. G SOAP 1.2 defines the new lt Misunderstood gt header element for conveying information on a mandatory header block that could not be processed. 3 SOAP 1.2 provides two...

Using Xslt ArgumentList to Add Parameters

We have to return to Visual Studio .NET, and modify our TransformXML.aspx.es code to provide support for parameters. We will use the XsltArgumentList object, which we then pass to the Transform method of the XslTransf orm object. Make the following changes to our Page_Load event handler private void Page_Load object sender, System. Even tArgs Put user code to initialize the page here string XMLPath Request . QueryString xml m string _XSLTPath Request .QueryString xslt string Param Request...