﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-&lt;b&gt;成都心情&lt;/b&gt;-随笔分类-Java EE 服务器端</title><link>http://www.blogjava.net/rosen/category/2689.html</link><description>本 Blog 是从：http://blog.csdn.net/rosen 搬来。&lt;br/&gt;</description><language>zh-cn</language><lastBuildDate>Sun, 02 Dec 2007 16:13:12 GMT</lastBuildDate><pubDate>Sun, 02 Dec 2007 16:13:12 GMT</pubDate><ttl>60</ttl><item><title>Java 生成 JPG 缩略图</title><link>http://www.blogjava.net/rosen/archive/2007/06/12/9940.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Tue, 12 Jun 2007 07:19:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2007/06/12/9940.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/9940.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2007/06/12/9940.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/9940.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/9940.html</trackback:ping><description><![CDATA[
		<p>    在任何一个综合性网站，我们往往需要上传一些图片资料。但随着高分辨率DC的普及，上传的图片容量会很大，比如300万象素DC出来的文件基本不下600K。为了管理方便，大家可能不愿意每次都用ACDsee修改它，而直接上传到服务器。但是这种做法在客户端看来就没有那么轻松了，对于拨号上网的用户简直是一场恶梦，虽然你可以在图片区域设置wide和high！<br />    <br />    问题的解决之道来了！我们可以在类中处理一张大图，并缩小它。<br />    前提是需要JDK1.4，这样才能进行处理。按以下方法做：<br />    <br />      import java.io.File;<br />      import java.io.FileOutputStream;<br />      import java.awt.Graphics;<br />      import java.awt.Image;<br />      import java.awt.image.BufferedImage;</p>
		<p>      import com.sun.image.codec.jpeg.JPEGCodec;<br />      import com.sun.image.codec.jpeg.JPEGImageEncoder;<br />      <br />      public class JpgTest {<br /> <br /> public void JpgTset() throws Exception{<br />     File _file = new File("/Order005-0001.jpg");                       //读入文件<br />     Image src = javax.imageio.ImageIO.read(_file);                     //构造Image对象<br />     int wideth=src.getWidth(null);                                     //得到源图宽<br />     int height=src.getHeight(null);                                    //得到源图长<br />     BufferedImage tag = new BufferedImage(wideth/2,height/2,BufferedImage.TYPE_INT_RGB);<br />     tag.getGraphics().drawImage(src,0,0,wideth/2,height/2,null);       //绘制缩小后的图<br />     FileOutputStream out=new FileOutputStream("newfile.jpg");          //输出到文件流<br />     JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);       <br />     encoder.encode(tag);                                               //近JPEG编码<br />     //System.out.print(width+"*"+height);                              <br />     out.close();<br /> }<br />      }<br />    <br />    过程很简单，从本地磁盘读取文件Order005-0001.jpg(2032*1524)，变成Image对象src，接着构造目标文件tag，设置tag的长宽为源图的一半，对tag进行编码，输出到文件流out，最后关闭文件流。<br />    <br />    还有一些问题需要说明：<br />    第一，目前只能支持JPG(JPEG)、GIF、PNG三种格式。<font style="BACKGROUND-COLOR: #ffffff" color="#ff0000"><strong>（这里有些问题，在最下面解释）</strong></font><br />    第二，对于源图的容量有限制，最好不要超过1M，否则会抛内存不足的错误，不过我试验过1.8M的源图，可以成功，但是也很容易抛内存不足。<br />    <br />    引用一位前辈的话：图象运算本身是密集型运算，需要大量的内存存放象素值。我用VC试了一下，4M的图象也有问题，而且越是压缩比大的图片在内存中还原成BITMAP时需要的内存越大。解决的方法，可以重写编码类，先开一定的内存，然后一段一段编码写到临时文件中，输出的时候再一段一段读出来。或利用nio的内存映象来操作。JavaMail由于采用了Builder模式，先生成一个邮件的每一个部分，然后合并成一个完整的邮件对象，这样每个构件都要先生成到内存中，你如果发送一个上百兆的附件，那么在构造Part时肯定内存溢出，所以我就改写了BodyPart的构造，让他和一个临时文件关联，然后用临时文件保存Part而不是构造在内存中，这样任义大小的附件(硬盘能放得下为限)都可以发送了。<br />    <br />    最后，如果大家对图像处理有更高的要求，不妨关注一下开源项目。比如JMagick，可以使用JMagick来实现图片的复制、信息获取、斜角、特效、组合、改变大小、加边框、旋转、切片、改变格式、去色等等功能。<br /><br /><font color="#ff0000"><strong>2007-06-20更新</strong></font><br />其实按照上面的做法只能压缩jpg格式，gif是不能压缩的（由于算法版权问题，直到Java 6.0才能压缩gif），前段时间要用gif压缩，在网上找了个类，可以解决问题。请参考：<a href="http://mindprod.com/jgloss/gifencoder.html">http://mindprod.com/jgloss/gifencoder.html</a>。<br />替换以前代码的相应部分：</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">            BufferedImage tag </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> BufferedImage(<br />                    size[</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">], size[</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">], BufferedImage.TYPE_INT_RGB);<br />            tag.getGraphics().drawImage(src, </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">, </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">, size[</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">], size[</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">], </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000">); <br />            out </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> FileOutputStream(path);<br />            GIFEncoder gifEncoder </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> GIFEncoder(tag);<br />            gifEncoder.write(out);</span>
		</div>
		<p>当代码运行完毕，用EditPlus之类的文本编辑器打开之后可以发现文件头已经是gif87格式了。<br /><br /><strong><font color="#ff0000" size="2">请注意！引用、转贴本文应注明原作者：Rosen Jiang 以及出处：</font></strong><a href="/rosen"><font face="宋体" color="#ff0000" size="2"><strong>http://www.blogjava.net/rosen</strong></font></a></p>
<img src ="http://www.blogjava.net/rosen/aggbug/9940.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rosen/" target="_blank">Rosen</a> 2007-06-12 15:19 <a href="http://www.blogjava.net/rosen/archive/2007/06/12/9940.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Apache FileUpload 上传以及 JExcelApi 解析</title><link>http://www.blogjava.net/rosen/archive/2007/01/19/94940.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Fri, 19 Jan 2007 07:19:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2007/01/19/94940.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/94940.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2007/01/19/94940.html#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/94940.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/94940.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 最近遇到点读取 Excel 数据的问题，于是花了点时间找开源工具。要解析 Excel，首当其冲的是上传文件，以前在项目里我们用 SmartUpload 进行上传，不过这个项目似乎已经停止开发了，于是在这里我使用 Apache Commons FileUpload，可以在 http://jakarta.apache.org/commons/fileupload 找到。目前该项目的最新版本是 1.1....&nbsp;&nbsp;<a href='http://www.blogjava.net/rosen/archive/2007/01/19/94940.html'>阅读全文</a><img src ="http://www.blogjava.net/rosen/aggbug/94940.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rosen/" target="_blank">Rosen</a> 2007-01-19 15:19 <a href="http://www.blogjava.net/rosen/archive/2007/01/19/94940.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBI-Java 实现 SOA 的标准途径（翻译）</title><link>http://www.blogjava.net/rosen/archive/2006/05/15/46281.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Mon, 15 May 2006 13:47:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2006/05/15/46281.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/46281.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2006/05/15/46281.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/46281.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/46281.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">业界正在广泛寻求解决</span>
				<span lang="EN-US">B2B </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以及</span>
				<span lang="EN-US">EAI</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（企业应用集成）所存在问题的方案。这些方案不同于基于</span>
				<span lang="EN-US">JMS </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">手段的面向消息中间件技术和</span>
				<span lang="EN-US">Web </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务技术。本文简短地阐述了即将到来的与</span>
				<span lang="EN-US">SOA</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（面向服务体系）规范及</span>
				<span lang="EN-US">ESB</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（企业服务总线）基础架构有关的</span>
				<span lang="EN-US">JBI</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">业务集成）标准。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 15pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">面向服务体系</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 15pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">SOA</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（面向服务体系）是近期推动应用和业务集成领域产生巨大飞跃的新技术之一。</span>
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义了一系列详尽的体系规范、范例和实现应用程序间进行松散耦合交互的最佳准则。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基于定义明确的接口，促进多个应用程序间的松散耦合交互。服务的实现是独立的，且不依赖上下文信息以及其他服务的状态。服务间数据交换主要基于文本类型的格式，使用基于标准的消息模型。服务自身并不知道服务提供者和服务消费者之间传输级的通讯交互。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">尽管不是强制要求，当今大部分流行的基于</span>
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的系统都利用了</span>
				<span lang="EN-US">Web </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务以及近似技术为服务间交互提供必要的管道管理。</span>
				<span lang="EN-US">WSDL</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">Web</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务定义语言）扮演了主要的通讯模型角色；</span>
				<span lang="EN-US">SOAP </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扮演了消息承载协议、</span>
				<span lang="EN-US">HTTP </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扮演了网络传输协议。当然，这并不意味着你必须利用上述技术实现基于</span>
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的系统。另外，有些术语之前就已经存在了，所以很多企业已利用类似的体系实现了系统的松散耦合交互。不管怎样，主要的不同点在于我们现在已经有标准协议、工具集和软件了，使面向服务体系更健全。</span>
				<span lang="EN-US">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">原则与面向对象范式、原则有着显著不同。主要不同在于服务间交互的接口被定义了更多面向数据的行为。一个孤立的服务也许会采用面向对象原则和技术，但是，服务之间的交互很少采用这些手段。相反，这些接口更适合于基于文档的交换。面向对象的行为是绑定数据，而面向服务从行为中分离数据。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 15pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">企业服务总线</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 15pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">ESB</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（企业服务总线）为面向服务体系提供了基础架构。通过设计工具定义服务间交互和规则，</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为部署和发现服务提供了运行时环境。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /?>
						<v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600">
								<v:stroke joinstyle="miter">
								</v:stroke>
								<v:formulas>
										<v:f eqn="if lineDrawn pixelLineWidth 0">
										</v:f>
										<v:f eqn="sum @0 1 0">
										</v:f>
										<v:f eqn="sum 0 0 @1">
										</v:f>
										<v:f eqn="prod @2 1 2">
										</v:f>
										<v:f eqn="prod @3 21600 pixelWidth">
										</v:f>
										<v:f eqn="prod @3 21600 pixelHeight">
										</v:f>
										<v:f eqn="sum @0 0 1">
										</v:f>
										<v:f eqn="prod @6 1 2">
										</v:f>
										<v:f eqn="prod @7 21600 pixelWidth">
										</v:f>
										<v:f eqn="sum @8 21600 0">
										</v:f>
										<v:f eqn="prod @7 21600 pixelHeight">
										</v:f>
										<v:f eqn="sum @10 21600 0">
										</v:f>
								</v:formulas>
								<v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f">
								</v:path>
								<o:lock aspectratio="t" v:ext="edit">
								</o:lock>
						</v:shapetype>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p>
								<img src="http://www.theserverside.com/tt/articles/content/JBIforSOA/clip01.jpg" /> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<br />    在</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的世界中，服务不会直接彼此交互。“</span>
				<span lang="EN-US">ESB</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”作为一个仲裁者在服务间松散的耦合它们。“</span>
				<span lang="EN-US">ESB</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”将实现协议绑定、消息传输、消息处理，等等。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一个服务总线将包括下列关键项：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为服务提供传输绑定</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义和发现已部署服务</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在服务间基于规则的路由和编排消息</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">包括文档传递在内的增值服务等</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">大部分的</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供商基于自己的</span>
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提议来开放标准和技术，包括多种</span>
				<span lang="EN-US">Web </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务标准和协议。他们提供多种调用服务的传输绑定，包括</span>
				<span lang="EN-US">HTTP</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US">FTP</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以及</span>
				<span lang="EN-US">JMS </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等等。大部分</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用户利用</span>
				<span lang="EN-US">WS-BPEL</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">Web</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务的业务流程执行语言）来了解已部署服务之间是如何实现业务流程的。</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供商同时也提供服务质量特性，包括容错、故障转移、负载平衡、消息缓冲等等。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 15pt">Java </span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 15pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">业务集成</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 15pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">业务集成）的提出是基于面向服务体系提倡的方法和原则，为了解决</span>
				<span lang="EN-US">EAI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span>
				<span lang="EN-US">B2B </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">若干问题的</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标准。当前版本（</span>
				<span lang="EN-US">1.0</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）是</span>
				<span lang="EN-US">2005 </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年</span>
				<span lang="EN-US">8 </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">月通过的</span>
				<span lang="EN-US">JSR</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范需求）</span>
				<span lang="EN-US">208 </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定案。商业和开源界都欢迎</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">成为他们</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">产品的集成标准。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基于仲裁者体系</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义了基于插件方式的架构，以便服务能融入“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境。</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供了详细的接口，使服务能与“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境交互。这些服务要为“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境暴露接口，以便“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境为服务路由消息。“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境在部署在</span>
				<span lang="EN-US">SOA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境中的服务间扮演仲裁者的角色。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> <img src="http://www.theserverside.com/tt/articles/content/JBIforSOA/clip02.gif" /></o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
						<br />在同一</span>
				<span lang="EN-US">JVM </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”核心主要包括如下组件：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件框架：组件框架把不同类型的组件部署到“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">   </span>
						<span style="mso-spacerun: yes"> </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">归一化消息路由器：归一化消息路由器利用标准机制实现服务间消息交换。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">   </span>
						<span style="mso-spacerun: yes"> </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">管理框架：管理框架基于</span>
				<span lang="EN-US">JMX </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行部署、管理以及监控“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”中的组件。</span>
				<span lang="EN-US">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件模型</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境中定义了两种组件：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 41.05pt; TEXT-INDENT: -41.05pt; mso-char-indent-count: -3.91">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务引擎组件：该组件负责实现业务逻辑和其他服务。服务引擎组件在其内部可使用多种技术和设计模式。服务引擎组件可提供数据传输和转换这种简单的基础服务，也可实现像</span>
				<span lang="EN-US">WS-BPEL </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实例一样复杂的业务处理。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -63pt; mso-char-indent-count: -6.0">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">绑定组件：绑定组件主要为已部署服务提供传输级绑定。绑定组件有多种类型：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -63pt; mso-char-indent-count: -6.0">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">        </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">利用标准传输协议与外部系统进行远程通讯。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -63pt; mso-char-indent-count: -6.0">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">        </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使已部署服务能在同一个</span>
				<span lang="EN-US">JVM </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">内部相互调用。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -63pt; mso-char-indent-count: -6.0">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">        </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务间可使用标准的</span>
				<span lang="EN-US">WS-I</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</span>
				<span lang="EN-US">Web </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务协同工作组织）规范通讯。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -63pt; mso-char-indent-count: -6.0">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的关键是分离服务引擎和绑定组件，以便业务逻辑不被下面的具体细节所干扰。这种方式促进了体系的灵活性和可扩展性。绑定组件和服务引擎组件在</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">内部都可以是服务提供者和</span>
				<span lang="EN-US">/</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或服务消费者。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">绑定组件和服务引擎组件为“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”提供接口以便从“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”接收消息。同样的，它们也利用</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供的接口来和“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”通讯。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt">消息传输模型</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">利用消息传输模型分离服务提供者和服务消费者之间的耦合。消息传输模型利用了</span>
				<span lang="EN-US">WSDL</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span>
				<span lang="EN-US">WSDL </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用于描述暴露的服务引擎组件和绑定组件的业务处理。另外，</span>
				<span lang="EN-US">WSDL </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也用于定义抽象服务处理的传输级绑定。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构中一个关键组件是</span>
				<span lang="EN-US">NMR</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（归一化消息路由器，也译作“正规消息路由器”）。</span>
				<span lang="EN-US">NMR </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基于</span>
				<span lang="EN-US">WSDL </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供了主要的消息传输中枢，</span>
				<span lang="EN-US">NMR </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为部署在“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”中的服务引擎组件和绑定组件间的消息传递提供松散耦合。服务需要有聚合业务处理的接口，每个业务处理由零个或多个消息组成。而一个接口有一个或多个传输级绑定。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”利用归一化格式描述消息。一个归一化消息由以下部分组成：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">消息属性</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">消息有效载荷</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">消息附件</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">利用</span>
				<span lang="EN-US">NMR</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">规范为服务提供者和消费者的消息交换提供标准接口。</span>
				<span lang="EN-US">NMR </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">支持服务生产者和消费者之间单向模式和服务响应模式的调用。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">管理</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">利用</span>
				<span lang="EN-US">JMX </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实现运行时的服务安装、配置和监控。服务必须实现</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接口集，以便这些服务在</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境中是可管理的。</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境必须提供一套</span>
				<span lang="EN-US">JMX MBeans </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实现“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”的管理。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”环境允许服务引擎组件和绑定组件的相关操作如下：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装组件：使组件接口可使用归一化消息路由器。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -42pt; mso-char-indent-count: -4.0; mso-para-margin-left: 2.0gd">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">安装</span>
				<span lang="EN-US">artefact</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件：这将允许已部署的</span>
				<span lang="EN-US">artefacts</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件获得与已安装组件同样的机能。例如，可以部署一个“连接服务”来提供具体的数据库连接。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">启动、停止服务以及进行相关服务分组。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为组件及</span>
				<span lang="EN-US">artefact</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件定义了标准的部署描述符以及打包模型。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">角色</span>
						<span lang="EN-US">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为基于</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的端到端</span>
				<span lang="EN-US">EAI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">解决方案定义了如下角色：</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes"> </span>
						<span style="mso-spacerun: yes">   </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">引擎开发者：引擎开发者提供遵循</span>
				<span lang="EN-US">NMR </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和管理约束的服务引擎组件。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">绑定开发者：绑定开发者提供遵循</span>
				<span lang="EN-US">NMR </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和管理约束的绑定组件。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -21pt; mso-char-indent-count: -2.0; mso-para-margin-left: 4.0gd">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境提供者：</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境提供者为“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”使用</span>
				<span lang="EN-US">J2EE 1.4 </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</span>
				<span lang="EN-US">J2SE 1.4 </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或更新的平台提供支持。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 63pt; TEXT-INDENT: -21pt; mso-char-indent-count: -2.0; mso-para-margin-left: 4.0gd">
				<span lang="EN-US">J2EE </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台提供者：</span>
				<span lang="EN-US">J2EE </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平台提供者把“</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行时”作为提供应用程序服务的一部分。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 68.25pt; TEXT-INDENT: -26.25pt; mso-char-indent-count: -2.5; mso-para-margin-left: 4.0gd">
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序开发者：</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序开发者利用服务引擎组件、绑定组件以及</span>
				<span lang="EN-US">JBI</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">环境构建</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序。</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 15pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">结论</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 15pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>
				</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当今业界走向越来越开放的标准和规范，</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在使</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">技术利用面向服务体系和</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基础架构实现业务集成方面产生了巨大飞跃。像</span>
				<span lang="EN-US">Oracle </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的商用产品提供商和</span>
				<span lang="EN-US">ServiceMix </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的开源软件都把</span>
				<span lang="EN-US">JBI </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为了他们</span>
				<span lang="EN-US">ESB </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方案的一部分。</span>
				<span lang="EN-US">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span style="FONT-SIZE: 15pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关于作者</span>
				</b>
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 15pt">
								<o:p>
								</o:p>
						</span>
				</b>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US">
						<span style="mso-spacerun: yes">    </span>Meeraj Kinnumpurath </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是位在</span>
				<span lang="EN-US">VOCA </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有限公司（原来叫</span>
				<span lang="EN-US">BACS</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）就职的</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">架构师，这家公司是英国最大的票据交换所。他有</span>
				<span lang="EN-US">8 </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年的</span>
				<span lang="EN-US">Java </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开发经验，主要从事企业应用程序开发。他已出版了一些</span>
				<span lang="EN-US">Java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</span>
				<span lang="EN-US">J2EE </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以及</span>
				<span lang="EN-US">Web </span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务方面的书籍。<br /></span>
				<span lang="EN-US">
						<o:p>
								<br />
								<strong>
										<font size="2">
												<font face="宋体" color="#ff0000">请注意！引用、转贴本文应注明原译者：Rosen Jiang 以及出处：</font>
										</font>
								</strong>
								<a href="/rosen/rosen/rosen/rosen">
										<font face="宋体" color="#ff0000" size="2">
												<strong>http://www.blogjava.net/rosen</strong>
										</font>
								</a>
						</o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/rosen/aggbug/46281.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rosen/" target="_blank">Rosen</a> 2006-05-15 21:47 <a href="http://www.blogjava.net/rosen/archive/2006/05/15/46281.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>与 Axis 1.x 同行</title><link>http://www.blogjava.net/rosen/archive/2006/01/28/29344.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Sat, 28 Jan 2006 12:37:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2006/01/28/29344.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/29344.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2006/01/28/29344.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/29344.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/29344.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp; 很久没写原创文章了。今天奉献给大家的是关于 Web Service 方面的文章。说起来惭愧，关于 Web Service，我从大二的时候就开始关注了，那时在做一套学生管理系统，可能是好奇，可能是图新鲜，可能是被跨平台所吸引，在还没弄得很清楚的情况下就迷恋上了这种技术，抱着李维的《Delphi 6/Kylix 2 SOAP/Web Service程序设计篇》狂啃，到了大三也没作出个像样的东西:(。大四上学期，签到 AUO 实习，并在 AUO 做毕设，毕设选题还是 Web Service 方面，论文洋洋洒洒写了一大篇，结果，到了最后的程序实现时，仅仅是以 XML 格式进行数据库和 Web 页面的交互而已。（再惭愧一次）<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 重新捡起 Web Service 是去年的事情，当时评估了多种开源 SSO 实现，总觉得不是很方便，遂打算自己实现。为了使通用性更高，决定让 Web Service 完成。并很自然的选到了 Axis。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; SOAP、WSDL、UDDI，这些名词相信只要了解过 Web Service 的都不陌生，根据 Apache 的定义，Axis 是一种 W3C SOAP 实现，国内有些介绍还特别注明了：Axis 并不完全是 SOAP 引擎，它还包括独立的 SOAP 服务器、嵌入 Servlet 引擎的服务器、支持 WSDL 并提供转化 WSDL 为 Java 类的工具、例子程序、TCP/IP 数据包监视工具，等等。Axis 部署 Web Serive 有两种方式，最简单的是拷贝 java 源代码文件到 web 文件夹下把扩展名改为 .jws 直接调用，可参考这篇文章：<A href="http://www.cn-java.com/target/news.php?news_id=2958">用Axis 1.1 for Java进行Web Services开发(1)</A>。另一种方式是通过 WSDD（Web Services描述文档）部署，可参考：<A href="http://bjzhanghao.cnblogs.com/archive/2004/10/09/50216.aspx">使用Axis发布简单的Web服务</A>。在我的应用中，使用的是后者，以便 Axis 进行自动序列化/反序列化处理。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 实现一次 SSO 登陆验证，最少要传入用户名、密码。为了达到这种目的，在客户端我们构造 User 对象（本文中 User 对象仅包含用户名和密码），并通过 Axis 自动序列化传递出去；到了 SSO 端，Axis 自动反序列化之后还原成 User 对象；最后返回给客户端说明本次登陆的结果，返回的结果不仅仅包含例如“登陆成功”之类的简单信息，也许还有很多其他信息，看来创建一个叫做 Respond 的对象（本文中 Respond 对象仅包含登陆 ID 和结果描述）很有必要了，把 Respond 传回给客户端说明登陆结果。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 暴露给客户端供登陆验证的服务类是 AuthService。该类代码简单表示如下：<BR><BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;AuthService&nbsp;{<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">/**</SPAN><SPAN style="COLOR: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;验证用户名和密码<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</SPAN><SPAN style="COLOR: #808080">@param</SPAN><SPAN style="COLOR: #008000">&nbsp;String&nbsp;userName&nbsp;&nbsp;&nbsp;&nbsp;用户名<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</SPAN><SPAN style="COLOR: #808080">@param</SPAN><SPAN style="COLOR: #008000">&nbsp;String&nbsp;passWord&nbsp;&nbsp;&nbsp;&nbsp;密码<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</SPAN><SPAN style="COLOR: #808080">@return</SPAN><SPAN style="COLOR: #008000">&nbsp;Respond&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;登陆验证后返回&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;Respond&nbsp;login(User&nbsp;user){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;name&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;user.getName();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;password&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;user.password();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">进行数据库验证<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.blogjava.net/images/dot.gif"><IMG src="http://www.blogjava.net/images/dot.gif">..<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.blogjava.net/images/dot.gif"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Respond&nbsp;respond&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Respond();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;respond.setId(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">123</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;respond.setDesc(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">登陆成功</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;respond;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}</SPAN></DIV><BR>&nbsp;&nbsp;&nbsp; User 和 Respond 以及服务类都写好了。通过命令行方式，我生成了 server-config.wsdd，内容如下：<BR><BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">&lt;?</SPAN><SPAN style="COLOR: #ff00ff">xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"</SPAN><SPAN style="COLOR: #0000ff">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">deployment&nbsp;</SPAN><SPAN style="COLOR: #ff0000">xmlns</SPAN><SPAN style="COLOR: #0000ff">="http://xml.apache.org/axis/wsdd/"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;xmlns:java</SPAN><SPAN style="COLOR: #0000ff">="http://xml.apache.org/axis/wsdd/providers/java"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">globalConfiguration</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="sendMultiRefs"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="disablePrettyXML"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="adminPassword"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="admin"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="attachments.Directory"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="D:\workspace\SSO\web\WEB-INF\attachments"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="dotNetSoapEncFix"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="enableNamespacePrefixOptimization"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="sendXMLDeclaration"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="sendXsiTypes"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="attachments.implementation"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.attachments.AttachmentsImpl"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">requestFlow</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="java:org.apache.axis.handlers.JWSHandler"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="scope"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="session"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">handler</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="java:org.apache.axis.handlers.JWSHandler"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="scope"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="request"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="extension"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">=".jwr"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">handler</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">requestFlow</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">globalConfiguration</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="LocalResponder"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="java:org.apache.axis.transport.local.LocalResponder"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="URLMapper"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="java:org.apache.axis.handlers.http.URLMapper"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="Authenticate"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="java:org.apache.axis.handlers.SimpleAuthenticationHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">service&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="AuthService"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;provider</SPAN><SPAN style="COLOR: #0000ff">="java:RPC"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="allowedMethods"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="*"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="className"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="com.cdmcs.sso.AuthService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">beanMapping&nbsp;</SPAN><SPAN style="COLOR: #ff0000">languageSpecificType</SPAN><SPAN style="COLOR: #0000ff">="java:sso.Respond"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;qname</SPAN><SPAN style="COLOR: #0000ff">="ns:resp"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;xmlns:ns</SPAN><SPAN style="COLOR: #0000ff">="urn:BeanService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">beanMapping&nbsp;</SPAN><SPAN style="COLOR: #ff0000">languageSpecificType</SPAN><SPAN style="COLOR: #0000ff">="java:sso.User"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;qname</SPAN><SPAN style="COLOR: #0000ff">="ns:user"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;xmlns:ns</SPAN><SPAN style="COLOR: #0000ff">="urn:BeanService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">service</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">service&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="AdminService"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;provider</SPAN><SPAN style="COLOR: #0000ff">="java:MSG"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="allowedMethods"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="AdminService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="enableRemoteAdmin"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="false"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="className"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.utils.Admin"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">namespace</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">http://xml.apache.org/axis/wsdd/</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">namespace</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">service</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">service&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="Version"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;provider</SPAN><SPAN style="COLOR: #0000ff">="java:RPC"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="allowedMethods"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="getVersion"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="className"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.Version"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">service</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">transport&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="http"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">requestFlow</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="URLMapper"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="java:org.apache.axis.handlers.http.HTTPAuthHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">requestFlow</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="qs:list"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.transport.http.QSListHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="qs:wsdl"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.transport.http.QSWSDLHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="qs.list"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.transport.http.QSListHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="qs.method"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.transport.http.QSMethodHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="qs:method"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.transport.http.QSMethodHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="qs.wsdl"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="org.apache.axis.transport.http.QSWSDLHandler"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">transport</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">transport&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="local"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">responseFlow</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">handler&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="LocalResponder"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">responseFlow</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">transport</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">deployment</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV><BR>&nbsp;&nbsp;&nbsp; 要说明的是，深究上述配置文件具体含义不是本文的目的，要对其具体了解，请参考 Axis 文档。其中，只有下面的 XML 才是我们感兴趣的：<BR><BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">service&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="AuthService"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;provider</SPAN><SPAN style="COLOR: #0000ff">="java:RPC"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="allowedMethods"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="*"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">parameter&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="className"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="com.cdmcs.sso.AuthService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">beanMapping&nbsp;</SPAN><SPAN style="COLOR: #ff0000">languageSpecificType</SPAN><SPAN style="COLOR: #0000ff">="java:sso.Respond"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;qname</SPAN><SPAN style="COLOR: #0000ff">="ns:resp"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;xmlns:ns</SPAN><SPAN style="COLOR: #0000ff">="urn:BeanService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">beanMapping&nbsp;</SPAN><SPAN style="COLOR: #ff0000">languageSpecificType</SPAN><SPAN style="COLOR: #0000ff">="java:sso.bo.User"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;qname</SPAN><SPAN style="COLOR: #0000ff">="ns:user"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;xmlns:ns</SPAN><SPAN style="COLOR: #0000ff">="urn:BeanService"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">service</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV><BR>&nbsp;&nbsp;&nbsp; 为了完成自动序列化/反序列化，我们使用“beanMapping”元素指定要进行处理的 bean 文件。只有在 WSDD 中定义了这些，才能享受到 Axis 带来的自动序列化/反序列化优势。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 客户端代码：<BR><BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;TestClient&nbsp;{<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;main(String[]&nbsp;args)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;endpoint&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://127.0.0.1:8080/services/AuthService?wsdl</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Service&nbsp;service&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Service();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call&nbsp;call&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(Call)&nbsp;service.createCall();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;QName&nbsp;qn&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;QName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">urn:BeanService</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">resp</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;QName&nbsp;qx&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;QName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">urn:BeanService</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">注册&nbsp;bean</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call.registerTypeMapping(Respond.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">,qn,</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;BeanSerializerFactory(Respond.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">,&nbsp;qn),</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;BeanDeserializerFactory(Respond.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">,&nbsp;qn));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call.registerTypeMapping(User.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">,qx,</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;BeanSerializerFactory(User.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">,&nbsp;qx),</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;BeanDeserializerFactory(User.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">,&nbsp;qx));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call.setTargetEndpointAddress(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;java.net.URL(endpoint));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call.setOperationName(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;QName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://soapinterop.org/</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">login</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;user&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;User();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mul.setName(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">test</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mul.setPassword(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">test</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Respond&nbsp;respond&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(Reopond)&nbsp;call.invoke(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Object[]&nbsp;{user});<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">登陆，返回'</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;respond.getDesc()&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">'。</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(Exception&nbsp;e)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}</SPAN></DIV><BR>&nbsp;&nbsp;&nbsp; 正如我们期望的，打印出“登陆成功”。通过上面的范例，我们发现，Axis 的自动序列化/反序列化机制还是很方便的，除了 bean 以外，其他类型的对象也可以让 Axis 来完成，具体参考 Axis 文档，如果要传递的对象 Axis 未提供自动序列化/反序列化支持，请考虑人工实现，参考：<A href="http://www.itzero.net/Article/J2EE/2005_10/3570.html">深度编程Axis序列化/反序列化器开发指南</A>。<BR><BR><BR><STRONG><FONT color=#ff0000 size=2>请注意！引用、转贴本文应注明原作者：Rosen Jiang 以及出处：</FONT></STRONG><A HREF="/rosen"><FONT face=宋体 color=#ff0000 size=2><STRONG>http://www.blogjava.net/rosen</STRONG></FONT></A> <img src ="http://www.blogjava.net/rosen/aggbug/29344.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rosen/" target="_blank">Rosen</a> 2006-01-28 20:37 <a href="http://www.blogjava.net/rosen/archive/2006/01/28/29344.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>BIRT 总览（翻译）</title><link>http://www.blogjava.net/rosen/archive/2005/12/17/24348.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Sat, 17 Dec 2005 05:37:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2005/12/17/24348.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/24348.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2005/12/17/24348.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/24348.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/24348.html</trackback:ping><description><![CDATA[<P><STRONG><FONT size=4>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<IMG src="http://www.eclipse.org/birt/images/birt_logotype_small.jpg"><BR><BR>报表介绍</FONT></STRONG><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 是为 Web 应用程序开发的基于 Eclipse 的开源报表系统，特别之处在于它是以 Java 和 J2EE 为基础。BIRT 有两个主要组件：基于 Eclipse 的报表设计器，以及部署到应用服务器上的运行时组件。BIRT 也提供了图标引擎让你能为应用增加图标。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 当前发行的版本是 1.0.1。我们鼓励你下载、试用 BIRT，请通过 <A href="http://www.eclipse.org/birt/index.php?page=community.html">newsgroups and Bugzilla</A> 向我们提意见。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 有了 BIRT，你可以为应用程序构建丰富的报表。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>列表</STRONG> － 列表是最简单的报表。当列表变长时，你可以把相关数据增加到同一分组（基于客户的订单分组，基于供应商的产品分组）。如果数据是数字类型的，你可以轻松的添加到“总数”、“平均”、或其他汇总中。<BR>&nbsp;&nbsp;&nbsp; <STRONG>图表</STRONG> － 当需要图表表现时，数字型数据比较好理解。BIRT 也提供饼状、线状以及柱状图标等。<BR>&nbsp;&nbsp;&nbsp; <STRONG>交叉表</STRONG> － 交叉表（也叫做十字表格或矩阵）用两种维度展示数据：sales per quarter or hits per web page。（交叉表在 1.0.1 中没有提供，但计划在将来提供。）<BR>&nbsp;&nbsp;&nbsp; <STRONG>信函和文档</STRONG> － 通知、信件、以及其他文本文档都很容易通过 BIRT 方便建立。文档包括正文、格式、列表、图表等。<BR>&nbsp;&nbsp;&nbsp; <STRONG>混合报表</STRONG> － 很多报表需要联合以上所有的报表构成单一文档。例如，一份客户声明会列出客户所需要的信息，为当前促进(promotions)提供文本，以及提供并行的出帐和入帐列表。一份财政报表将包括声明、图表、表格，所有这些都将进行全方位的格式化，来匹配共有的配色方案。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <FONT size=4><STRONG>剖析一份报表</STRONG></FONT><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 报表包含四个部分：数据、数据转换、业务逻辑、陈述。<BR>&nbsp;&nbsp;&nbsp; 数据 － 数据库、Web 服务、Java 对象，这些都可以作为 BIRT 报表源。1.0.1 版本提供 JDBC 支持，也支持利用编码来获取其他地方的数据。BIRT 的 ODA(Open Data Access) 框架允许任何人构建新的 UI 以及运行时支持任何类型的表格式数据。未来，单一报表可包含从任意多个数据源获取数据。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>数据转换</STRONG> － 报表通过对数据的分类、统计、过滤以及分组来适应用户需求。当然，数据库能实现这些功能，当遇到普通文件和 Java 对象时 BIRT 必须以 "simple" 数据源方式处理。BIRT 允许复杂的操作，比如总合分组、整体共计的百分比，等等。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>业务逻辑</STRONG> － 真实世界的数据很少提供你理想的结构良好的报表。许多报表要求用具体逻辑把原始数据转换成用户的有用信息。如果该逻辑仅仅用于该报表，你可以用 BIRT 的 JavaScript 脚本支持。如果你的程序中已包含这些逻辑，你可以调用已有的 Java 代码。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>表现</STRONG> － 一旦数据准备好了，你可以在很大的范围内选择表现形式。表格、图表、文字等等都可以。单一数据集可以有多种方式表现，而单一报表可以表现多个数据集。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>J2EE 应用中的 BIRT<BR></FONT></STRONG>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 报表引擎以 JAR 文件方式打包，可以方便的添加到你的 J2EE 应用中。报表引擎是一系列的 POJO(Plain Old Java Objects)，便于你可以在 JSP 页面集成报表。&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG height=237 src="http://www.eclipse.org/birt/project/chart1.jpg" width=658><BR>&nbsp;&nbsp;&nbsp; BIRT 与你的应用有四个主要集成点：<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>UI 参数</STRONG> － 多数报表允许用户指定一些输入，这些数据叫做"报表参数"。例如，客户报表要求显示客户数据。你的参数页面可能是静态的：为每个报表进行用户定制设计。或者，可以使用参数元数据提供的动态页面，以便该单一页面为所有的报表提供服务。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>运行报表</STRONG> － 用户提交表单参数时，你的 web 应用通过这些参数向 BIRT 报表引擎说明读取哪个报表设计文件，并读取数据，再产生报表输出。当引擎运行报表时 BIRT 的术语称为"工厂"。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>数据访问</STRONG> － 报表如何从你的应用获得数据已在上面解释了。Java 程序通常利用 Java 对象为 BIRT 工厂提供数据。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>显示</STRONG> － 附加的 JSP 页面，叫做阅读器，允许用户查看报表输出。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 一个报表应用程序包含一个参数页，你可以为每个报表创建自定义的 UI，或者使用 BIRT 带来的参数元数据提供单一报表来处理多种不同报表。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>样品阅读器</FONT></STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp; BIRT 项目提供一个样品 "viewer" 来帮你起步。样品阅读器常被用于在 Eclipse 中预览报表：BIRT 内置一个 Apache Tomcat 服务器，每次预览报表时调用。阅读器也可被用于任何与 JSP 兼容的 J2EE 服务器。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 的 1.0.1 版本提供单一页面的 web 输出。计划在将来的版本中提供多页面输出，而且阅读器 UI 也将提供多页面之间的导航功能。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>报表设计</FONT></STRONG></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; BIRT 应用开发从报表设计开始。基于 Eclipse 插件提供多种快速构建报表工具。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>数据浏览器</STRONG> － 把你的数据源（连接）以及数据集（查询）组织起来。数据集编辑器允许你测试数据集，以确保报表接收数据的正确性。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 布局视图 － 所见即所得编辑器为你的报表提供以拽方式来创建表现内容。包含一个标准报表条目调色板。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG> 属性编辑器</STRONG> － 以便利的格局表现大多数通用的用户属性使编辑更快速和容易。BIRT 也集成了标准 Eclipse 属性视图，为每个条目提供详细的属性列表。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>报表预览</STRONG> － 你可以在任何时间采用真实数据测试你的报表。预览窗口直接内嵌在 Eclipse 中。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>代码编辑器</STRONG> － 在访问数据以及报表生成或浏览时，脚本把业务逻辑添加给报表。在编辑脚本时代码编辑器提供标准的 Eclipse 特性：语法加色、自动完成等等。BIRT 用很简单的脚本来表达，expression builder 能更容易的创建这些表达。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>略图</STRONG> － BIRT 报表被组织为一个树型结构作为整体报表的根，并且为样式、报表内容、数据源、数据集、报表参数等分类。略图视图提供你整个报表结构紧凑的预览。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>Cheat Sheets</STRONG> － 学习新工具永远是种挑战，但是 Eclipse 提供一种创新方案：cheat sheets。它们是一些帮助你完成新任务的文档。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><FONT size=4><STRONG>数据定制</STRONG></FONT><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 正如前面所提到的，报表通常为要表现的数据添加业务逻辑。BIRT 提供多个工具来完成这一操作：<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>栏位计算</STRONG>－数据库为存储组织数据，但这些数据通常为结合表现层而预先整理好。栏位计算让你能定义基于业务逻辑的附加数据集栏位。这种逻辑是一个简单的语法、脚本或调用一个已有的 Java 逻辑。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>输入以及输出参数</STRONG>－许多数据源都支持参数：在查询时传入或传出数据的能力。比如，SQL Select 语句可包含输入参数。存储过程既有传入又有传出参数。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>栏位元数据</STRONG>－当数据源提供的名字是 unintuitive 的，你可以提供栏位别名。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>过滤</STRONG> － 有些数据源，尤其是 SQL，提供良好的内置过滤特性。然而，有些数据源（单纯的文件，应用程序对象）却没有提供过滤特性。另外，过滤器条件是定义在脚本或 Java 代码中的。你可把过滤器定义为报表的一部分，BIRT 引擎会自动调用它们。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>脚本化数据集</STRONG> － 有些报表需要访问专门或不常用的数据。你可以在 Java 或脚本创建访问，利用脚本化数据集可在报表中集成这些逻辑。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>条件格式化<BR></FONT></STRONG>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 有些报表有着固定的格式，其他的却需要条件格式化。例如，某报表列出了交易记录来表现不同的销售与利润之比。或者，一个客户服务报表要按照不同规则进行色彩显示。BIRT 提供多个条件格式化特性：<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>条件可见度</STRONG> － 你可以根据数据隐藏报表元素。在上述的交易报表中，你可以创建销售和交易收入两部分，接着隐藏报表指定记录中不需要的部分。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>值映射</STRONG> － 数据库数据通常使用代码值：M/F 代表男性或女性，1/2 代表销售和收入，等等。值映射让你定义一个从数据库值到显示值的映射。例如，我们可把值“1”对应到“Sale”，把“2”对应到“Return”。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>加强</STRONG> － 简单的标识可让你对特定报表套用样式。例如，在客户服务报表中，我们可以使用绿色表示上一的计划，红色表示下一计划。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>&nbsp;&nbsp;&nbsp; 脚本</FONT></STRONG></P>
<P>&nbsp;&nbsp;&nbsp; BIRT 提供基于 JavaScript（与知名的 ECMAScript 形式上相同）的脚本。JavaScript 经常作为客户端脚本语言，但是它也可以用于用于表达业务逻辑。特别的，JavaScript 能与你的现有 Java 逻辑进行良好集成，能非常轻松地从 BIRT 报表调用业务逻辑。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 提供从 JavaScript 对象访问报表对象模型（Report Object Model）的整套方案：同时表现报表设计和运行时的状况，允许报表的完全控制处理甚至最复杂的报表格式化工作。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>项目管理</FONT></STRONG></P>
<P>&nbsp;&nbsp;&nbsp; BIRT 集成了 Eclipse 项目管理特性来组织相关报表。BIRT 也可以与 Eclipse CVS 协作进行源码管理。BIRT 的 XML 报表设计格式让它能容易的比较两份报表，或者两个不同版本的相同报表，并跟踪变更。<BR>&nbsp;&nbsp;&nbsp; <BR><FONT size=4><STRONG>&nbsp;&nbsp;&nbsp; 样式</STRONG></FONT></P>
<P>&nbsp;&nbsp;&nbsp; 任何设计 web 页面的人都知道有时会反复使用相同的样式。CSS 允许 web 设计者从内容中提取样式信息，并复用样式。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 提供类似的特性。当然，BIRT 样式也是基于 CSS 的，这样使得网页应用开发人员能容易得设计 BIRT 表现形式。BIRT 样式可堆叠，允许你在一个地方设置样式后套用到所有报表或报表的一部分或单一报表中。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>&nbsp;&nbsp;&nbsp; 库</FONT></STRONG></P>
<P>&nbsp;&nbsp;&nbsp; 典型的应用中会包括许多有关联的报表。一个简单的客户应用将包括一个按照字母排序的客户列表、按照地理位置分类的客户群，为客户指定的销售代表，客户身份筛选等等。总之，用户不停的地变化报表以解决具体业务需要。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 这样一来，最终的报表应用将包含多组相关报表。相同的数据源、样式、业务逻辑、报表条目。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 将来的 BIRT 版本将包含组织这些共享资源的支持库。这些库可包含任何报表元素，比如样式、数据源、报表条目、脚本等等。<BR>&nbsp;&nbsp;&nbsp; <BR><STRONG><FONT size=4>国际化</FONT></STRONG></P>
<P>&nbsp;&nbsp;&nbsp; 全世界都可以访问你的 web 应用程序。BIRT 为国际化和本地化提供良好的支持。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>文本本地化</STRONG> － 你可以建立一份把字符串自动变成用户本地语言显示的简单报表。所有的表单和报表文本都能以标准的 Java 本地化规则进行翻译。在运行时，BIRT 使用资源 key 找出文本的正确翻译。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>本地化</STRONG> － BIRT 提供 locale-aware 格式化数据，意味着对于美国用户的日期数据可以以 mm/dd/yy 的格式出现，而欧洲用户则是 dd-mm-yy 格式。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>动态格式化</STRONG> － 中文文本非常紧凑，德文有时又有点冗长，而英文正好是中等大小。BIRT 自动调整报表条目的大小来适合其中的内容，避免每次翻译都要进行报表测试。<BR>&nbsp;&nbsp;&nbsp; <BR><FONT size=4><STRONG>扩展性</STRONG></FONT></P>
<P>&nbsp;&nbsp;&nbsp; 报表应用程序的范围是十分庞大的，BIRT 团队不能为每个应用提供很具体的特性。可利用 BIRT 脚本来扩展 BIRT，另外还可构建 BIRT 扩展插件到 BIRT 中。<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR><STRONG>&nbsp;&nbsp;&nbsp; 数据访问</STRONG><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 提供 ODA(Open Data Access) 框架来支持自定义数据访问方法。数据访问的范围还包括一个获取数据的运行时组件。也包括构建自定义查询的自定义设计时 UI。例如，打包后的应用程序可以让 ODA 构建数据访问 UI 并运行在自己的数据模型中。<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<STRONG> 报表栏目</STRONG><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 为要表现的数据提供一致的报表栏目集。可以在应用程序中自定义附件报表栏目，并像 BIRT 自身的报表栏目一样运行在设计器和引擎中。例如，性能管理应用程序要添加报表栏目来高亮显示停止项、尺度表以及其他用来衡量性能的可视标志。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>图表类型</STRONG><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 图表包提供了很多的图表类型。但是，一些行业需要很特殊的图表样式。开发者可以在 BIRT 图表引擎中创建图表插件来提供这些图表样式。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>输出格式</STRONG><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; BIRT 1.0.1 支持输出到 HTML 和 PDF。当然，也可能需要其他类型输出：Excel、RTF(Rich Text Format)、SVG(Scalable Vector Graphic)、图像、等等。BIRT 在今后会提供其中一些，除开这些的其他格式可能需要的用户就很少了。开发者可利用 BIRT 引擎接口添加转换器以达到目的。<BR><BR><BR><STRONG><FONT face=宋体 color=#ff0000 size=2>请注意！引用、转贴本文应注明原译者：Rosen Jiang 以及出处：</FONT></STRONG><A href="/rosen/rosen/rosen/rosen"><FONT face=宋体 color=#ff0000 size=2><STRONG>http://www.blogjava.net/rosen</STRONG></FONT></A></P><img src ="http://www.blogjava.net/rosen/aggbug/24348.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rosen/" target="_blank">Rosen</a> 2005-12-17 13:37 <a href="http://www.blogjava.net/rosen/archive/2005/12/17/24348.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>XML 的 RUD</title><link>http://www.blogjava.net/rosen/archive/2005/08/12/9952.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Fri, 12 Aug 2005 07:42:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2005/08/12/9952.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/9952.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2005/08/12/9952.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/9952.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/9952.html</trackback:ping><description><![CDATA[<P><FONT size=2>&nbsp;&nbsp;&nbsp; 在工作中使用 XML 已经很长时间了，不过长久以来都是进行的读操作，或者在生成 XML 时完全使用 StringBuffer 来构造。进行完整的读取、添加、删除、修改还是最近的事情。在这里我采用的是 DOM4J，其实呢这些内容都很简单，如果愿意，各位大可直接参考官方的 Cookbook（</FONT><A href="http://www.dom4j.org/cookbook.html"><FONT color=#000080 size=2>http://www.dom4j.org/cookbook.html</FONT></A><FONT size=2>）和 Quick Start（</FONT><A href="http://www.dom4j.org/guide.html"><FONT color=#000080 size=2>http://www.dom4j.org/guide.html</FONT></A><FONT size=2>）。<BR>&nbsp;&nbsp;&nbsp; <BR>对于给定的 XML 文件，其结构如下：</FONT></P>
<P>
<TABLE style="WIDTH: 417px; HEIGHT: 217px" cellSpacing=1 cellPadding=1 width=417 border=1>
<TBODY>
<TR>
<TD><FONT size=2>&nbsp;&lt;?xml version="1.0" encoding="GBK" ?&gt;<BR>&lt;propertysets&gt; </FONT>
<P><FONT size=2>&nbsp;&lt;propertset name="rea_faculty" description="team"&gt;<BR>&nbsp;&nbsp;&lt;field&gt;10290&lt;/field&gt;<BR>&nbsp;&lt;/propertset&gt;<BR>&nbsp;&lt;propertset name="faculty_lea" description="another team"&gt;<BR>&nbsp;&nbsp;&lt;field&gt;10286&lt;/field&gt;<BR>&nbsp;&lt;/propertset&gt;<BR>&nbsp;&lt;propertset name="office" description="teams"&gt;<BR>&nbsp;&nbsp;&lt;field&gt;10287&lt;/field&gt;<BR>&nbsp;&lt;/propertset&gt;<BR>&nbsp;<BR>&lt;/propertysets&gt;</FONT></P></TD></TR></TBODY></TABLE></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;<BR><STRONG><FONT size=2>为以上 XML 文件构造 Propertys 类：</FONT></STRONG></P>
<P>
<TABLE style="WIDTH: 416px; HEIGHT: 483px" cellSpacing=1 cellPadding=1 width=416 border=1>
<TBODY>
<TR>
<TD><FONT size=2>&nbsp;</FONT><FONT size=2>public class Propertys {<BR>&nbsp;<BR>&nbsp;private String name;<BR>&nbsp;private String description;<BR>&nbsp;private String field;</FONT> 
<P><FONT size=2>&nbsp;public String getDescription() {<BR>&nbsp;&nbsp;return description;<BR>&nbsp;}</FONT></P>
<P><FONT size=2>&nbsp;public void setDescription(String description) {<BR>&nbsp;&nbsp;this.description = description;<BR>&nbsp;}</FONT></P>
<P><FONT size=2>&nbsp;public String getField() {<BR>&nbsp;&nbsp;return field;<BR>&nbsp;}</FONT></P>
<P><FONT size=2>&nbsp;public void setField(String field) {<BR>&nbsp;&nbsp;this.field = field;<BR>&nbsp;}</FONT></P>
<P><FONT size=2>&nbsp;public String getName() {<BR>&nbsp;&nbsp;return name;<BR>&nbsp;}</FONT></P>
<P><FONT size=2>&nbsp;public void setName(String name) {<BR>&nbsp;&nbsp;this.name = name;<BR>&nbsp;}<BR>}</FONT></P></TD></TR></TBODY></TABLE></P>
<P><FONT size=2><STRONG>读取方法（返回包含 Propertys 的列表）：</STRONG></FONT><BR>&nbsp;&nbsp;&nbsp; <BR>
<TABLE style="WIDTH: 416px; HEIGHT: 23px" cellSpacing=1 cellPadding=1 width=416 border=1>
<TBODY>
<TR>
<TD><FONT size=2>&nbsp;&nbsp;public List getAll() {<BR>&nbsp;&nbsp;List list = new ArrayList();<BR>&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;InputStream is = getClass().getResourceAsStream("/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;SAXReader reader = new SAXReader();&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp;Document document = reader.read(is);<BR>&nbsp;&nbsp;&nbsp;Element root = document.getRootElement(); <BR>&nbsp;&nbsp;&nbsp;Iterator lv = root.elementIterator("propertset");<BR>&nbsp;&nbsp;&nbsp;Element el = null;<BR>&nbsp;&nbsp;&nbsp;while (lv.hasNext()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;Propertys property=new Propertys();<BR>&nbsp;&nbsp;&nbsp;&nbsp;el = (Element) lv.next();<BR>&nbsp;&nbsp;&nbsp;&nbsp;property.setName(el.attributeValue("name"));<BR>&nbsp;&nbsp;&nbsp;&nbsp;property.setDescription(el.attributeValue("description"));<BR>&nbsp;&nbsp;&nbsp;&nbsp;property.setField(el.elementText("field"));<BR>&nbsp;&nbsp;&nbsp;&nbsp;list.add(property);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;} catch (Exception e) {<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return list;<BR>&nbsp;}</FONT></TD></TR></TBODY></TABLE></P>
<P><FONT size=2><STRONG>添加新节点（成功返回 1 否则 0）：<BR></STRONG></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>
<TABLE style="WIDTH: 417px; HEIGHT: 23px" cellSpacing=1 cellPadding=1 width=417 border=1>
<TBODY>
<TR>
<TD><FONT size=2>&nbsp;&nbsp;public int saveProperty(Propertys property) {<BR>&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;InputStream is = getClass().getResourceAsStream("/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;SAXReader reader = new SAXReader();&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp;Document document = reader.read(is);<BR>&nbsp;&nbsp;&nbsp;Element root = document.getRootElement();<BR>&nbsp;&nbsp;&nbsp;root.addElement("propertset")<BR>&nbsp;&nbsp;&nbsp;&nbsp;.addAttribute("name",property.getName())<BR>&nbsp;&nbsp;&nbsp;&nbsp;.addAttribute("description",property.getDescription())<BR>&nbsp;&nbsp;&nbsp;&nbsp;.addElement("field").addText(property.getField());<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;OutputFormat outformat = OutputFormat.createPrettyPrint();<BR>&nbsp;&nbsp;&nbsp;outformat.setEncoding("GBK");<BR>&nbsp;&nbsp;&nbsp;FileWriter out = new FileWriter(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.getProperty("user.dir")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+"/web/WEB-INF/classes/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;XMLWriter writer=new XMLWriter(out,outformat);<BR>&nbsp;&nbsp;&nbsp;writer.write(document);<BR>&nbsp;&nbsp;&nbsp;writer.close();<BR>&nbsp;&nbsp;&nbsp;return 1;<BR>&nbsp;&nbsp;} catch (Exception e) {<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return 0;<BR>&nbsp;}</FONT></TD></TR></TBODY></TABLE></P>
<P><FONT size=2><STRONG>更新节点（按照 name 属性查找）：<BR></STRONG></FONT>&nbsp;&nbsp;&nbsp; <BR>
<TABLE style="WIDTH: 416px; HEIGHT: 523px" cellSpacing=1 cellPadding=1 width=416 border=1>
<TBODY>
<TR>
<TD><FONT size=2>&nbsp;&nbsp;public int updateProperty(String pro,Propertys property) {<BR>&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;InputStream is = getClass().getResourceAsStream("/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;SAXReader reader = new SAXReader();&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp;Document document = reader.read(is);<BR>&nbsp;&nbsp;&nbsp;Element root = document.getRootElement();<BR>&nbsp;&nbsp;&nbsp;Iterator lv = root.elementIterator("propertset");<BR>&nbsp;&nbsp;&nbsp;Element el = null;<BR>&nbsp;&nbsp;&nbsp;while (lv.hasNext()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;el = (Element) lv.next();<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (el.attributeValue("name").equals(pro)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el.setAttributeValue("name",property.getName());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el.setAttributeValue("description",property.getDescription());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el.element("field").setText(property.getField());<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}</FONT> 
<P><FONT size=2>&nbsp;&nbsp;&nbsp;OutputFormat outformat = OutputFormat.createPrettyPrint();<BR>&nbsp;&nbsp;&nbsp;outformat.setEncoding("GBK");<BR>&nbsp;&nbsp;&nbsp;FileWriter out = new FileWriter(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.getProperty("user.dir")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+"/web/WEB-INF/classes/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;XMLWriter writer=new XMLWriter(out,outformat);<BR>&nbsp;&nbsp;&nbsp;writer.write(document);<BR>&nbsp;&nbsp;&nbsp;writer.close();<BR>&nbsp;&nbsp;&nbsp;return 1;<BR>&nbsp;&nbsp;} catch (Exception e) {<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return 0;<BR>&nbsp;}</FONT></P></TD></TR></TBODY></TABLE></P>
<P><FONT size=2><STRONG>删除节点：</STRONG></FONT><BR>&nbsp;&nbsp;&nbsp; <BR>
<TABLE style="WIDTH: 416px; HEIGHT: 23px" cellSpacing=1 cellPadding=1 width=416 border=1>
<TBODY>
<TR>
<TD><FONT size=2>&nbsp;&nbsp;public int delProperty(String pro) {<BR>&nbsp;&nbsp;try {<BR>&nbsp;&nbsp;&nbsp;InputStream is = getClass().getResourceAsStream("/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;SAXReader reader = new SAXReader();&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;&nbsp;&nbsp;Document document = reader.read(is);<BR>&nbsp;&nbsp;&nbsp;Element root = document.getRootElement();<BR>&nbsp;&nbsp;&nbsp;Iterator lv = root.elementIterator("propertset");<BR>&nbsp;&nbsp;&nbsp;Element el = null;<BR>&nbsp;&nbsp;&nbsp;while (lv.hasNext()) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;el = (Element) lv.next();<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (el.attributeValue("name").equals(pro)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;el.detach();<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}</FONT> 
<P><FONT size=2>&nbsp;&nbsp;&nbsp;OutputFormat outformat = OutputFormat.createPrettyPrint();<BR>&nbsp;&nbsp;&nbsp;outformat.setEncoding("GBK");<BR>&nbsp;&nbsp;&nbsp;FileWriter out = new FileWriter(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.getProperty("user.dir")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+"/web/WEB-INF/classes/navigation.xml");<BR>&nbsp;&nbsp;&nbsp;XMLWriter writer=new XMLWriter(out,outformat);<BR>&nbsp;&nbsp;&nbsp;writer.write(document);<BR>&nbsp;&nbsp;&nbsp;writer.close();<BR>&nbsp;&nbsp;&nbsp;return 1;<BR>&nbsp;&nbsp;} catch (Exception e) {<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return 0;<BR>&nbsp;}</FONT></P></TD></TR></TBODY></TABLE><BR><BR><BR><STRONG><FONT color=#ff0000 size=2>请注意！引用、转贴本文应注明原作者：Rosen Jiang 以及出处：</FONT></STRONG><A href="http://www.blogjava.net/rosen"><FONT face=宋体 color=#ff0000 size=2><STRONG>http://www.blogjava.net/rosen</STRONG></FONT></A></P><img src ="http://www.blogjava.net/rosen/aggbug/9952.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rosen/" target="_blank">Rosen</a> 2005-08-12 15:42 <a href="http://www.blogjava.net/rosen/archive/2005/08/12/9952.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>四种 XML 解析技术之不完全测试</title><link>http://www.blogjava.net/rosen/archive/2005/08/12/9950.html</link><dc:creator>Rosen</dc:creator><author>Rosen</author><pubDate>Fri, 12 Aug 2005 07:40:00 GMT</pubDate><guid>http://www.blogjava.net/rosen/archive/2005/08/12/9950.html</guid><wfw:comment>http://www.blogjava.net/rosen/comments/9950.html</wfw:comment><comments>http://www.blogjava.net/rosen/archive/2005/08/12/9950.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/rosen/comments/commentRss/9950.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rosen/services/trackbacks/9950.html</trackback:ping><description><![CDATA[<P>&nbsp;&nbsp;&nbsp; 在平时工作中，难免会遇到把 XML 作为数据存储格式。面对目前种类繁多的解决方案，哪个最适合我们呢？在这篇文章中，我对这四种主流方案做一个不完全评测，仅仅针对遍历 XML 这块来测试，因为遍历 XML 是工作中使用最多的（至少我认为）。<BR><BR><BR><STRONG><FONT size=4>预 备</FONT></STRONG><BR><BR>&nbsp;&nbsp;&nbsp; <STRONG>测试环境：</STRONG><BR>&nbsp;&nbsp;&nbsp; AMD 毒龙1.4G OC 1.5G、256M DDR333、Windows2000 Server SP4、Sun JDK 1.4.1+Eclipse 2.1+Resin 2.1.8，在 Debug 模式下测试。<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <STRONG>XML 文件格式如下：<BR></STRONG><FONT size=2>&nbsp;&nbsp;&nbsp; &lt;?xml version="1.0" encoding="GB2312"?&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;RESULT&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;VALUE&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp