Wang Qian Senior Translator - Simultaneous Interpretation

Has done interpretations and translations for heads of states
Diplomatic Occasions, Press Conferences, Business Negotiations, Company Meetings in fields of IT, Telecom, Economics, Machinery, Chemistry, Medical Sciences, and Literature. Dozens of books translated both into English and into Chinese.
Beijing, China

Contact: +86 139 1129 7924
Email: wq7924@yahoo.com.cn

Creating XML Messages With BC4J - Translated by Marianne Wang
用BC4J创建XML消息

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.
企业级消息接发是企业程序间交换数据的必备工具,而XML已成为网络数据交换的行业标准。以Java(BC4J)框架为基础的商业组件提供了运用XML格式描述数据的API,所以它可以在消息体中传送。在JSM API的协同作用下,这种功能可以使你在程序之间异步交换数据。

The Business Components for Java (BC4J) framework provides methods on view objects for rendering data as XML, and for reading in data from XML.
以Java(BC4J)框架为基础的商业组件提供了可视对象方法,可以把数据描述成XML格式,并从XML格式读取数据。

The BC4J XML Messaging API
BC4J XML 信息传送API

The writeXML() method outputs the contents of a view object in a standard XML format, for example:
writeXML()方法输出标准XML格式的可视对象内容,例如:

<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:
你可以设定元数据属性和特定方法参数,通过以下几种方式配置XML文件的外观和内容:

Use different element names
Write levels of detail data (for example, output the employees in each department)
Write all rows of data or a range of rows
Use an XSL stylesheet to format the XML
使用不同的元素名
书写细目数据的级别(例如,输出每个部门的雇员)
书写数据所有的行或行的范围
使用XSL样式表将XML文件格式化

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.
相应的 readXML()方法从XML文件读取数据,写入一个可视对象。与writeXML()相类似,你可以读入细目数据的级别,在读入之前,可以用XSL样式表将XML文件格式化。如果接收应用程序和发送应用程序所要求的数据格式不同,样式表就能被派上用场。

Integrating XML into Messaging Applications
把XML整合到消息接发程序

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.
Java消息服务API(JMS)是J2EE技术中的一种。它提供了一种创建、发送、接收消息的普遍方法。一个提供JMS的对象,例如Oracle Advanced Queuing,能实现JMS API,并提供基本的消息接发功能。图表显示的是2个BC4J程序使用XML消息通信的范例。

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.
2.The sending application uses JMS methods to create a message with the XML as its content, and add the message to a queue.
3.The receiving application reads the message from the queue.
4.The receiving application parses the message, using readXML() to read data from the XML, optionally using an XSL stylesheet to convert it to a different format.
1. 发送程序使用 writeXML()方法,用XML格式描述数据,可以选择使用样式表转换XML格式。
2. 发送程序使用JMS 方法,用XML格式创建一条消息,并把这条消息添加到队列中。
3. 接收程序从队列读取消息。
4. 接收程序解析消息,使用 readXML()方法从XML中读取数据,可以选择使用XSL样式表把它转换成其它格式。

Home
Copyright © 2002 www.wangqian.com.cn Allrights Reserved