1.SOAP(簡單對象訪問協議的簡稱)定義了一個標準,該標準為通過網絡在應用程序間傳輸XML數據封裝格式.(1.1)
2.WSDL(Web
Services Description Language,
Web服務描述語言)是一個標準,用于描述使用SOAP在兩個系統間交換的XML數據的結構.(1.1)
3.UDDI
雖然WSDL對描述由Web服務使用的SOAP消息的類型提供了很好的格式,但它沒有提供如何存儲WSDL文檔以及如何查找WSDL文檔方面的信息.UDDI(Universal
Description,Discovery,and
Integeration,通用描述,發現和集成)定義了一套標準的Web服務操作(方法),用于存儲,查找有關其他Web服務應用程序方面的信息.(2.0)
Web
Services API
1.JAX-RPC 可以將JAX-RPC看成是位于SOAP之上的Java
RMI(Java遠程方法調用).JAX-RPC分兩個部分,即一套客戶端API和一套服務器端API,它們均稱為端點.(1.1)
2.SAAJ(SOAP
with Attachments API for Java, 由于Java的帶附件API的SOAP)是一個低級SOAP
API,它要于SOAP1.1和帶附件規范的SOAP消息一起編譯.
3.JAXR(Java API for XML
Registries,用于XML注冊的Java API)提供了用于訪問UDDI注冊表的API.
3.JAXP(Java API for XML
Processing,用于XML處理的Java API)為使用DOM2和SAX2以及為用于讀,寫和修改XML文檔的標準Java
API提供了架構.(1.2)
SOAP的主要應用是應用程序與應用程序之間的通信(即A2A),且主要應用于商務對商務(即B2B)的通信以及企業應用集成(EAI).
SOAP消息傳遞模式:
1.Document/Literal消息傳遞模式:
<?xml
version="1.0" encoding="UTF-8"?>
<soap-Envelope
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelop/" ;
xmlns:mi="
http://www.Monson-Haefel.com/jwsbook/message-id" ;
xmlns:proc="
http://http://www.Monson-Haefel.com/jwsbook/processed- ; by">
<soap:Header>
<!--Header
blocks go
here-->
</soap:Header>
<soap:Body>
<po:purchaseOrder
orderDate="2003-09-22"
xmlns:po="
http://www.Monson-Haefel.com/jwsbook/PO" ;>
<po:accountName>Amazon.com</po:accountName>
<po:accountNumber>923</po:accountNumber>
<po:book>
<po:title>J2EE
Web
Services</po:title>
<po:quantity>300</po:quantity>
<po:wholesale-price>24.99</po:wholesale-price>
</po:book>
</po:purchaseOrder>
</soap:Body>
</soap-Envelope>
2.RPC/Literal消息傳遞模式
用一個這樣的方法調用:
package
com.jwsbook.soap;
import java.rmi.RemoteException;
public interface
BookQuote extends java.rmi.Remote {
public float getBookPrice(String ISBN)
throws
RemoteException,
InvalidISBNException;
}
RPC/LiteralSOAP請求消息:
<?xml
version="1.0" encoding="UTF-8"?>
<soap-Envelope
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelop/" ;
xmlns:mh="
http://www.Monson-Haefel.com/jwsbook/BookQuote" ;>
<soap:Body>
<mh:getBookPrice>
<isbn>0321146182</isbn>
</mh:getBookPrice>
</soap:Body>
</soap-Envelope>
RPC/Literal
SOAP響應消息:
<?xml version="1.0"
encoding="UTF-8"?>
<soap-Envelope
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelop/" ;
xmlns:mh="
http://www.Monson-Haefel.com/jwsbook/BookQuote" ;>
<soap:Body>
<mh:getBookPriceResponse>
<result>24.99</result>
</mh:getBookPriceResponse>
</soap:Body>
</soap-Envelope>