Wang Qian Senior Translator - Simultaneous Interpretation Has done interpretations and translations for heads of states Contact: +86 139 1129 7924 |
Creating XML Messages With BC4J - Translated by Marianne Wang Enterprise messaging is an essential tool for exchanging data between enterprise applications, and XML has become the industry standard for Web-based data exchange. The Business Components for Java (BC4J) framework provides an API for rendering data in XML format, so that it can be passed in the body of a message. This capability, used in conjunction with the JMS API, enables you to exchange data asynchronously between applications. The Business Components for Java (BC4J) framework provides methods on view objects for rendering data as XML, and for reading in data from XML. The BC4J XML Messaging API The writeXML() method outputs the contents of a view object in a standard XML format, for example: <DepartmentsView> <DepartmentsViewRow> <DepartmentId>10</DepartmentId> <DepartmentName>Administration</DepartmentName> <ManagerId>200</ManagerId> <LocationId>1700</LocationId> </DepartmentsViewRow> <DepartmentsView> By setting metadata properties and specifying method parameters you can configure the appearance and content of the resulting XML in several ways: Use different element names The corresponding readXML() method reads data from an XML file into a view object. Similar to writeXML(), you can read in several levels of detail data, and you can use an XSL stylesheet to format the XML before it is read in. Stylesheets are useful when the receiving application and the sending application require the data to be in different formats. Integrating XML into Messaging Applications The Java Message Service API (JMS), one of the J2EE technologies, provides a common way for Java programs to create, send, and receive messages. A JMS provider, such as Oracle Advanced Queuing, implements the JMS API and provides the underlying messaging functionality. The diagram shows an example of two BC4J applications communicating with XML messages. The applications in the diagram use XML, JMS, and Oracle AQ to communicate as follows: 图表中的程序使用XML, JMS, 和 Oracle AQ进行通信:
1.The sending application uses writeXML() to render data as XML and optionally convert the XML format with a stylesheet. |
|
Copyright
© 2002 www.wangqian.com.cn Allrights Reserved
|