Tutorial of SOAP with Attachments API for Java

随着web 服务、SOA 概念的兴起,和诸多 SOA 应用的实践,Java 阵营也审时度势,趁势推出相应的 API 以应对这一变化。SOAP 是 Java web 服务栈中很基础的一项技术,web 服务间以 SOAP 消息来互相通信。
SOAP with Attachments API for Java(简称 SAAJ) 就是 Java 阵营为访问 web 服务所提供的基础设施,它简化了对 SOAP 的处理。
SAAJ 包含 2 部分 APIs,其一用于创建消息,添加消息内容,其二则用于建立连接,发送 SOAP 消息。

By javafuns on October 21, 2009 at 15:42 · Views: 105 · Permalink · Leave a comment
Categorized in: SOA · Tagged with: , , ,

XML 中的 schemaLocation 属性究竟是什么意思?

在 XML 实例文档中有时会发现有 schemaLocation 属性。很多人对此非常疑惑,搞不清这个属性究竟是什么意思,究竟该如何使用。
schemaLocation 属性用来引用(schema)模式文档,解析器可以在需要的情况下使用这个文档对 XML 实例文档进行校验。它的值(URI)是成对出现的,第一个值表示命名空间,第二个值则表示描述该命名空间的模式文档的具体位置,两个值之间以空格分隔。当然,在必要情况下,可以为 schemaLocation 属性指派多个这样的值对。
<p:Person
xmlns:p=”http://contoso.com/People”
xmlns:v=”http://contoso.com /Vehicles”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=
“http://contoso.com/People

http://contoso.com/schemas/people.xsd

http://contoso.com/schemas/Vehicles

http://contoso.com/schemas/vehicles.xsd

http://contoso.com/schemas/People

http://contoso.com/schemas/people.xsd”>
<name>John</name>
<age>28</age>
<height>59</height>
<v:Vehicle>
<color>Red</color>
<wheels>4</wheels>
<seats>2</seats>
</v:Vehicle>
</p:Person>
如果为没有目标命名空间的模式文档指定位置,需用 noNamespaceSchemaLocation 属性.

By javafuns on July 23, 2009 at 13:43 · Views: 596 · Permalink · Leave a comment
Categorized in: SOA · Tagged with: ,

SMTP Transport Binding for SOAP

SOAP 除了可以 bind 到 HTTP 上外, 也可以 bind 到 SMTP 上. 其实个人感觉, SOAP bind 到 SMTP 上的场景很少会使用到, 通常限于 one-way operation (比如通知等不需要响应). 如果需要实现 request/response, 那么是需要多做一些工作的(下文会有叙述).
soap:binding element 的 transport 属性需指定一个 http://xxx(例如:http://schemas.xmlsoap.org/soap/smtp) URL 来表明所要 binding 的 protocol. 似乎这个 URL 是任意形式, 只要能让调用方知道要使用什么协议即可. 在 soap:address 要给定 mailto:xxxx@xxx.xxx 这样形式的 URI.
<service name=”StockQuoteServiceBinding_service”>
[...]

By javafuns on July 19, 2009 at 23:37 · Views: 232 · Permalink · Leave a comment
Categorized in: SOA · Tagged with: , , , ,

Which style of WSDL should I use? (reship)

A Web Services Description Language (WSDL) binding style can be RPC or document. The use can be encoded or literal. How do you determine which combination of style and use to use? The author describes the WSDL and SOAP messages for each combination to help you decide.

By javafuns on July 7, 2009 at 16:40 · Views: 581 · Permalink · Leave a comment
Categorized in: SOA · Tagged with: , , , , ,

关于 XML standalone 的解释

XML standalone 定义了外部定义的 DTD 文件的存在性. standalone element 有效值是 yes 和 no. 如下是一个例子:
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
<!DOCTYPE s1 PUBLIC “http://www.ibm.com/example.dtd” “example.dtd”>
<s1>………</s1>
值 no 表示这个 XML 文档不是独立的而是依赖于外部所定义的一个 DTD.  值 yes 表示这个 XML 文档是自包含的(self-contained).

By javafuns on March 2, 2009 at 21:09 · Views: 1,706 · Permalink · Leave a comment
Categorized in: Java, SOA · Tagged with: ,

Java 程序中如何对 XML 文档进行验证?

Table Of Content
Introduction
Validation when parsing
Validation against preparsed schema
Validate a DOMSource or SAXSource against preparsed schema
Introduction
XML 作为一种数据存储和描述语言,这些年得到了广泛运用,尤其以web服务为代表。XML之所以广受欢迎,原因之一是它具有丰富的数据描述手段,你甚至可以对要存储的数据做出各种限制: 字符串长度,数字大小,等等。
最早的XML使用DTD(Document Type Definition)进行定义,后来人们又发明了XML Schema。XML Schema本质上也是一种XML,这相比DTD大大减少了学习曲线,而且XML Schema提供了更丰富的校验机制。
参看《XML Schema 与 XML DTD 的技术比较与分析》,有更详细的比较。

By javafuns on March 1, 2009 at 21:39 · Views: 416 · Permalink · Leave a comment
Categorized in: Java, SOA · Tagged with: , ,

XML Schema 中 dateTime 类型的解释

dateTime 类型的形式为:’-’? yyyy ‘-’ mm ‘-’ dd ‘T’ hh ‘:’ mm ‘:’ ss (‘.’ s+)? (zzzzzz)?,其中:

‘-’? yyyy 是一个4位或者更多位数的可使用负号的数字,表示年份;如果多于4位数字,则打头数字不能是0, ‘0000′ 也是禁止的;同样需要注意的是+号也不允许使用;
剩下的 ‘-’ 是时间中各部分的分隔符;
第一个 mm 是一个2位数字,表示月份;
dd 是一个2位数字,表示日期;
‘T’ 是一个分隔符,指明后面是日期中的时间;
hh 是一个2位数字,表示小时;如果分钟和秒是 0,那么使用 ‘24′ 是允许的, 这个如此表示的 dateTime 值马上转为下一天的值(the dateTime value so represented is the first instant of the following day);
‘:’ 是一个时间中各部分的分隔符;
第二个 mm 是一个2位数的数字,表示分钟数;
ss 是一个2位整数数字,表示完整的秒数;
‘.’ s+ (如果有) 表示秒数的小数部分;
zzzzzz (如果有) 表示时区 (如下面所描述的).

例如,2002-10-10T12:00:00-05:00 [...]

By javafuns on August 18, 2008 at 16:05 · Views: 502 · Permalink · Leave a comment
Categorized in: SOA · Tagged with: 

What’s New in WSDL 2.0

原文:http://www.xml.com/pub/a/ws/2004/05/19/wsdl2.html?page=1
by Arulazi Dhesiaseelan
May 20, 2004

// < ![CDATA[
var CN_AD = new Object();
CN_AD.AD_SZ = "300wx250h";
CN_AD.PTYPE = "publisher";
cnetGetAd(CN_AD);
// ]]>
W3C 的 Web Services Description Working Group, Web Services Activity 的一个子组织, 已经为描述 web service [...]

By javafuns on July 29, 2008 at 22:28 · Views: 1,762 · Permalink · Leave a comment
Categorized in: SOA · Tagged with: , , ,
  • Highest Rated

  • My PicasaPhotos

    IMG_0611.JPG

    6bcb1dc8fa0154047f3e6ff9.jpg

    IMG_0603.JPG

  • RSS My del.icio.us

  • My RSS