SOAP and WSDL

In the last chapter, you learned about web services and how they work toward enabling disparate systems to communicate. Of course, if everyone just chose their own formats in which to send messages back and forth, that wouldn't do much good in the interoperability area, so a standard format is a must. XML-RPC is good for remote procedure calls, but otherwise limited. SOAP overcomes that problem by enabling rich XML documents to be transferred easily between systems, even allowing for the...

H Elx

lt h1 gt element, 564, 693, 752, 843, 913, 914 lt h2 gt element, 696, 752 lt h3 gt element, 696 HamSearchPort portType interface, 907 handleAddToCartResponse method, 627 handleClick function, 785 handleKeyDown method, 669 handleKeyUp function, 667 handleReadyState function, 588 handleReadyStateChange function, 589, 651, 657-658, 685 handler.feed.items instance, 544 handlers helpers, 552-555 XML markup, 548-552 hasAttributes method, Node object, 461 hasChildNodes method, Node object, 461 hash...

The Currency Converter Proxy

This example shows how to take advantage of a currency conversion service, one of several free services found at www.xmethods.net ve2 index.po. The basic signature of the service is as follows float rate getRate string countryFrom, string countryTo It accepts the ISO standard country abbreviation as found in a URL for two countries, and returns the conversion rate between their currencies. For example, calling getRate with us and uk might return 0.57. There are three steps to this example 1....

Anatomy of a DTD

Now that you have seen a DTD, let's look at each of the DTD declarations in more detail. Generally, DTDs consist of three basic parts The current name example needs to be expanded to explore the more complex aspects of DTDs. In this section, you will create an XML vocabulary for listing contacts all of your friends and family. Note, however, that there are many existing vocabularies for contacts on the Internet. Using a simplified format will enable you to quickly create your own vocabulary.

Every StartTag Must Have an EndTag

One of the problems with parsing HTML documents is that not every element requires a start-tag and an end-tag. Take the following example lt p gt Here is some text in an HTML paragraph. lt br gt Here is some more text in the same paragraph. lt P gt And here is some text in another HTML paragraph. lt p gt Notice that the first lt p gt tag has no closing lt p gt tag. This is allowed in HTML, because most web browsers can figure out where the end of the paragraph should be. In fact, years ago,...

Info Kve 1

setParameter DOMString name, DOMUserData value DOMUserData getParameter DOMString name Returns the value of the parameter, if known boolean canSetParameter DOMString name, DOMUserData value Returns true if the DOM implementation is able to set the given parameter to the given value

Adobe LiveCycle

The Adobe LiveCycle product family uses Adobe Acrobat Reader to view and fill forms designed with Adobe LiveCycle Designer, server-side-powered by Adobe LiveCycle Designer, and managed by Adobe LiveCycle Designer. Like InfoPath, Adobe LiveCycle uses a proprietary file format that bundles several files necessary for the functioning of the Acrobat form. It resembles InfoPath in that respect because InfoPath uses a cabinet file with an .xsn extension to hold its XML files. Also like InfoPath,...

Info Ejx

Up until now, this section actually hasn't described anything related to SOAP. You've defined messages and put them together into operations, but you haven't learned anything about the protocol you use to send them. The binding element sets up the first part of this process. In this case, you bind the operations to SOAP as follows lt binding name TemperatureBinding lt soap binding style rpc lt operation name GetTemperature gt lt soap operation gt lt input gt lt soap body use encoded gt lt soap...

XHTML Wrapper

SVG files can be viewed directly in capable browsers or they can form part of a regular XHTML page. The first file is standard XHTML, using the Transitional DOCTYPE. You will probably recognize most of its elements they were all tags in legacy HTML, though the lt iframe gt element deserves some additional explanation lt title gt Tangram Puzzle lt title gt lt head gt lt body gt lt h1 gt Tangram Puzzle lt h1 gt lt p gt Click lt em gt Scramble lt em gt , then put the pieces back in the box. lt p...

Info Bxf

xsl apply-imports, xsl apply-templates, xsl attribute, xsl call-template,xsl choose, xsl comment, xsl copy, xsl copy-of, xsl element,xsl fallback,xsl for-each, xsl if, xsl message, xsl number, xsl processing-instruction, xsl text, xsl value-of, xsl variable xsl attribute, xsl comment, xsl copy, xsl element, xsl fallback, xsl for-each, xsl if, xsl message, xsl oth-erwise, xsl param, xsl processing-instruction, xsl stylesheet, xsl template, xsl transform, xsl variable, xsl when

Solution Qbo

One solution starts with the puzzle pieces ready-transformed to their positions in the cat shape. The coordinates listed in the points attributes are exactly as in the original. The transform attribute contains an initial translation and rotation to place them as required. Pressing the Reset button still zeroes all these values, placing the pieces in the square box lt polygon points 0,0 0,100 100,0 rotate 292.5,33. lt polygon points 100,0, 50,50 150,50 200,0 transform translate 495,45 rotate...

Info Utl

The CSS rule associated with this element should look something like this ch17_eg16.css background-image url wrox_logo.gif margin 5px The benefit of this technique is that it works with IE 5 , Firefox, and Opera. The problem is that the source XML document must include a separate element for each image you want in the resulting document until attribute selectors are better supported in browsers you'll learn about attribute selectors later in the chapter . You must also have a rule in your CSS...

Question Fuv

Break the contacts19.rnc schema file into two schemas. In contacts-main.rnc, place the main schema elements. In contacts-names.rnc, place the name pattern definitions. At the top level, place an include directive in contacts-main.rnc to include contacts-names.rnc. You first need to create contacts_names.rnc. You could do this by copying the name declarations from contacts15.rnc. The resulting file should look as follows name element name nameContents nameContents title , first , middle , last

Exercise Questions Nfo

Suggested solutions to these questions can be found in Appendix A. Break the contacts15.rnc schema file into two schemas. In contacts-main.rnc, place the main schema elements. In contacts-names.rnc, place the name pattern definitions. At the top level, place an include directive in contacts-main.rnc to include contacts-names.rnc. Add a wildcard extension to the descriptionContents pattern so that the users can extend the contacts schema by adding any elements they desire to the lt description...

Info Pqs

Typical usage is something like this XMLReader r new MySAXDriver true catch SAXException e System.err.println Cannot activate feature. r.setErrorHandler new MyErrorHandler catch IOException e System.err.println I O exception reading XML catch SAXException e System.err.println XML error in document. Implementers are free and encouraged to invent their own features, using names built on their own URIs.

Info Rbr

Suppose the context node is the node that represents the Chapter element node for the second chapter. We can use the position and last functions, described in more detail later in this chapter, to show the position of the context node and the context size, as demonstrated in the following example. The examples in this chapter rely on XSLT, as XPath does not exist in isolation, but always acts as a helper for another technology such as XSLT or XQuery. For a fuller explanation see Chapter 8, but...

Cardinality

An element's cardinality defines how many times it will appear within a content model. Each element within a content model can have an indicator following the element name that tells the parser how many times it will appear. DTDs allow four indicators for cardinality, as shown in the following table As you have seen in all of the content models thus far, when no cardinality indicator is used, it indicates that the element must appear once and only once. This is the default behavior for elements...

Info Sdr

Returns a Node, where the nodeName is the same as the name specified, or NULL if no such node exists The arg parameter is a Node object, which is added to the list. The nodeName property is used for the name of the node in this map. If a node with the same name already exists, it is replaced. If a Node is replaced, it is returned otherwise, NULL is returned. Node removeNamedItem DOMString name Removes the Node specified by name and returns it Returns the Node at the specified index. If index is...

How It Works Rlt

This example not only takes an attribute value and displays it onscreen, but also writes some additional text beforehand. Recall the restriction that you can only write attribute values before or after the element that carries them. Therefore, this example used the after pseudo-element to display the value of the lt author gt attribute after the lt title gt element. The pseudo-element is used in the selector, like so The content property writes the attribute value to the screen as follows...

XML Functionality in SQL Server

SQL Server 2000 was the first version of SQL Server to have any XML functionality. Microsoft describes SQL Server 2000 as an XML-enabled database. When you are introduced a little later to the XML functionality in SQL Server 2005, you will see that, in comparison, SQL Server 2000 is a partly XML-enabled database. The functionality in SQL Server 2000 that makes it an XML-enabled database includes the following Support for XDR schemas later upgraded to XSD schemas HTTP access to SQL Server 2000...

XQuery Tools

Despite the fact that XQuery is still relatively new, a large number of software companies and independent developers have developed partial or more complete implementations of XQuery. The proliferation of XQuery tools indicates that many software vendors see XQuery as an important XML standard with significant commercial potential. On an ongoing basis, the W3C updates a web page where links to XQuery implementations and other sources of useful XQuery information are included. Visit www.w3.org...

Info Rzx

This SOAP message contains three header entries one for authentication and two for logging purposes. For the lt authentication gt header entry, you specified a value of true for mustUnderstand. In SOAP 1.1, you would have specified it as 1. This means that the SOAP server must process the header block. If the SOAP server doesn't understand this header entry, it rejects the entire SOAP message the server is not allowed to process the entries in the SOAP body. This forces the server to use proper...

Info Gel

Notice that between the first pair of items in the sequence in the for statement and the last pair of items in the sequence an XPath expression has been inserted. For each value in i, whether it is a value or a text node selected by the XPath expression, the value of i is inserted between the start-tag and end-tag of an item element. The output document, ForIn2Out.xml, is shown here lt xml version 1.0 encoding UTF-8 gt lt items gt lt item gt 1 lt item gt lt item gt 2 lt item gt lt item gt...

Info Pml

Here is a more useful function that calculates the factorial of a number, something not available in the standard library The factorial of a number, written as x , is the product of that number with all smaller integers greater than one. So 4 4x3x2 24. declare namespace math declare variable n as xs integer external declare function math factorial integer as xs integer as xs double if integer gt 1 then integer math factorial integer - 1 else 1 This time a recursive function is used. If the...

Installing the Saxon XSLT Processor

Saxon now comes with installs for Java and .NET. The installation of the Java version is covered first. To run the Saxon XSLT processor, you need a Java Virtual Machine JVM installed. To check whether you have a JVM correctly installed, open a command window and type the following If Java is installed, then you will see a message similar to the following java version 1.5.1 Java TM 2 Runtime Environment, Standard Edition build 1.5.1-b65 Java HotSpot TM Client VM build 1.5.1-b65, mixed mode If...

How the XML DOM Is Used in InfoPath

InfoPath 2007 is an enterprise XML-based forms tool from Microsoft that is designed to produce XML data from forms without requiring the end-user to have any understanding or awareness of XML. At the heart of InfoPath 2007 are several XML technologies, including the Microsoft implementation of the XML DOM in MSXML 6. A free trial of InfoPath is available as part of Office 2007. Go to http office.microsoft.com en-us infopath default.aspx and click Download a free trial. The data of an InfoPath...

The Element Fmk

In the People.xslt stylesheet, there is one xsl apply-templates element inside the template that matches the root node lt xsl apply-templates select People Person gt The xsl apply-templates element causes the XSLT processor to look for matching nodes in the source tree. In this case, the nodes to be looked for are specified by the XPath location path People Person, which specifies Person element nodes that are child nodes of a People element node, which is, in turn, a child node of the root...

Info Skh

Whenever computers are involved, things can go wrong, and there may be times when a SOAP server is unable to process a SOAP message, for whatever reason. Perhaps a resource needed to perform the operation isn't available, or invalid parameters were passed, or the server doesn't understand the SOAP request in the first place. In these cases, the server returns fault codes to the client to indicate errors. Fault codes are sent using the same format as other SOAP messages. However, in this case,...

Preparing the Ground

You need a program that can validate an XML document against a DTD. Throughout this chapter and the next two, the examples utilize the Codeplot editor at http codeplot.com. The Codeplot editor enables you to create XML documents, DTDs, and other files in a virtual folder. It also enables you to check a document's well-formedness and validity. Simply sign up on the Codeplot home page and you can begin creating XML documents and DTDs. Of course, you can also use a text editor or XML-specific...

XML and Compact Syntaxes

In the last chapter, you learned that XML Schemas use an XML syntax. Because the syntax is entirely in XML, you can use generic XML tools even those that have no understanding of the rules specific to XML Schema documents. RELAX NG also uses XML syntax, enabling you to work with schemas using eXtensible Stylesheet Language Transformations XSLT or other XML tools. As shown in the last chapter, XML Schemas can be very long. In some cases, the DTDs for your documents were much simpler to read than...