1.SOAP(簡單對象訪問協(xié)議的簡稱)定義了一個標(biāo)準(zhǔn),該標(biāo)準(zhǔn)為通過網(wǎng)絡(luò)在應(yīng)用程序間傳輸XML數(shù)據(jù)封裝格式.(1.1)
2.WSDL(Web
Services Description Language,
Web服務(wù)描述語言)是一個標(biāo)準(zhǔn),用于描述使用SOAP在兩個系統(tǒng)間交換的XML數(shù)據(jù)的結(jié)構(gòu).(1.1)
3.UDDI
雖然WSDL對描述由Web服務(wù)使用的SOAP消息的類型提供了很好的格式,但它沒有提供如何存儲WSDL文檔以及如何查找WSDL文檔方面的信息.UDDI(Universal
Description,Discovery,and
Integeration,通用描述,發(fā)現(xiàn)和集成)定義了一套標(biāo)準(zhǔn)的Web服務(wù)操作(方法),用于存儲,查找有關(guān)其他Web服務(wù)應(yīng)用程序方面的信息.(2.0)
Web
Services API
1.JAX-RPC 可以將JAX-RPC看成是位于SOAP之上的Java
RMI(Java遠(yuǎn)程方法調(diào)用).JAX-RPC分兩個部分,即一套客戶端API和一套服務(wù)器端API,它們均稱為端點.(1.1)
2.SAAJ(SOAP
with Attachments API for Java, 由于Java的帶附件API的SOAP)是一個低級SOAP
API,它要于SOAP1.1和帶附件規(guī)范的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文檔的標(biāo)準(zhǔn)Java
API提供了架構(gòu).(1.2)
SOAP的主要應(yīng)用是應(yīng)用程序與應(yīng)用程序之間的通信(即A2A),且主要應(yīng)用于商務(wù)對商務(wù)(即B2B)的通信以及企業(yè)應(yīng)用集成(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消息傳遞模式
用一個這樣的方法調(diào)用:
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響應(yīng)消息:
<?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>