Chapter 4 XML Processing
139
// Receives the supplier purchase order document from the 
// Web service endpoint (interaction layer) through a JMS queue
public void onMessage(Message msg) {
String document = ((TextMessage) msg).getText();
// Processes the XML purchase order received by the supplier
String invoice = poProcessor.processPO(document);
...
}
}
Code Example 4.5
Receiving an XML Document Through a JMS Queue
There are circumstances when a Web service may internally exchange XML
documents through a JMS queue or topic. When implementing an asynchronous
architecture, the interaction layer of a Web service may send XML documents
asynchronously using JMS to the processing layer. Similarly, when a Web service
implements a workflow, the components implementing the individual stages of
the workflow may exchange XML documents using JMS. From a developer's
point of view, receiving or sending XML documents through a JMS queue or
topic is similar in principle to the case of passing documents as SOAP message
attachments. XML documents can be passed through a JMS queue or topic as text
messages or in a Java serialized form when those documents can be bound to Java
objects.  
4.3.3 Validating XML Documents
Once a document has been received or produced, a developer may and most of the
time must validate the document against the schema to which it is supposed to
conform. Validation, an important step in XML document handling, may be
required to guarantee the reliability of an XML application. An application may
legitimately rely on the parser to do the validation and thus avoid performing such
validation itself. 
However, because of the limited capabilities of some schema languages, a
valid XML document may still be invalid in the application's domain. This might
happen, for example, when a document is validated using DTD, because this
schema language lacks capabilities to express strongly typed data, complex unic 
ity, and cross reference constraints. Other modern schema languages, such as
XSD, more rigorously while still lacking some business constraint expressive 






New Page 1








Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service

java web hosting

 

 

 Our partners: | PHP: Hypertext Preprocessor | Best Web Hosting | Java Web Hosting | Inexpensive Web Hosting |

Jsp Web Hosting | Cheapest Web Hosting | Jsp Hosting | Cheap Hosting

 

Virtualwebstudio. Business web hosting division of Web Design Plus. All rights reserved