欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
Web Service基礎(WSDL、SOAP)

Web ServiceMS2000年創(chuàng )造了Web Service這個(gè)詞,它描述的是允許計算機網(wǎng)絡(luò )(互聯(lián)網(wǎng)是典型,但不局限與此)相互通信的一套標準,其核心之一是可擴展標記語(yǔ)言(XML),另一個(gè)則是HTTP。

 

5個(gè)基礎標準(其中有兩個(gè)是早就有了的通用標準,他們被用來(lái)實(shí)現Web Service方法,另外3個(gè)是專(zhuān)門(mén)用于Web Service的):

1.       XML 用來(lái)描述模型,格式和數據類(lèi)型的通用格式,其他大多數標準都是用XML來(lái)表達的標準。

2.       HTTPHTTPS),互聯(lián)網(wǎng)底層協(xié)議。HTTPS)是運用了互聯(lián)網(wǎng)技術(shù),通過(guò)網(wǎng)絡(luò )發(fā)送Web Service的可能的協(xié)議之一。

3.       WSDLWeb Services Description Language:用來(lái)定義服務(wù)接口。描述服務(wù)的兩個(gè)方面:服務(wù)的簽名(名字和參數),以及服務(wù)的綁定和部署細節(協(xié)議和位置)。

4.       SOAPWeb Service交換數據所準尋的協(xié)議。

5.       UDDI,管理Web Service的標準(注冊和找到服務(wù))

 

通常來(lái)說(shuō),使用WSDL標準是Web Service的關(guān)鍵特性,其他都是可選的。例如,不一定非得使用SOAPHTTP萊發(fā)送服務(wù)請求,也可以使用其他協(xié)議而仍然算在使用Web Service。另外,UDDI扮演補充的角色,實(shí)際中也不用。

 

      WSDL

              怎樣向別人介紹你的Web service有什么功能,以及每個(gè)函數調用時(shí)的參數呢?這就是WSDL。 WSDL標準有不同的版本,主要講WSDL1.1WSDL2.0。相比較于1.1,2.0主要有:

  • WSDL2.0 is much more simple and easy to learn, some of the ambiguities of WSDL1.2 have removed.
  • Removal of message constructs. These are specified using the XML schema type system directly.
  • Improved support for HTTP bindings.
  • Unlike WSDL1.1, WSDL2.0 core specification supports for REST. Lawrence Mandel wrote a good article about REST support for WSDL2.0.

 

 

 

WSDL文件自底向上描述服務(wù)。也就是說(shuō),它們從用到的數據類(lèi)型開(kāi)始,道服務(wù)的位置(地址)結束。

 

示例:

<?xml version="1.0" encoding="utf-8" ?>

2 <definitions name="CustomerService"

3 targetNamespace="http://soa-in-practice.com/wsdl"

4 xmlns:tns="http://soa-in-practice.com/wsdl"

5 xmlns:xsd1="http://soa-in-practice.com/xsd"

6 xmlns:xsd="http://www.w3.org/2001/XMLSchema"

7 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

8 xmlns="http://schemas.xmlsoap.org/wsdl/">

9

10 <types>

11 <xsd:schema

12 targetNamespace="http://soa-in-practice.com/xsd"

13 xmlns="http://soa-in-practice.com/xsd">

14

15 <xsd:element name="getCustomerAddress">

16 <xsd:complexType>

17 <xsd:sequence>

18 <xsd:element name="customerID" type="xsd:long"/>

19 </xsd:sequence>

20 </xsd:complexType>

21 </xsd:element>

22

23 <xsd:element name="getCustomerAddressResponse" type="Address"/>

24 <xsd:complexType name="Address">

25 <xsd:sequence>

26 <xsd:element name="street" type="xsd:string"/>

27 <xsd:element name="city" type="xsd:string"/>

28 <xsd:element name="zipCode" type="xsd:string"/>

29 </xsd:sequence>

30 </xsd:complexType>

31

32 </xsd:schema>

33 </types>

34

35 <message name="getCustomerAddressInput">

36 <part name="params" element="xsd1:getCustomerAddress"/>

37 </message>

38 <message name="getCustomerAddressOutput">

39 <part name="params" element="xsd1:getCustomerAddressResponse"/>

40 </message>

41

42 <portType name="CustomerInterface" >

43 <operation name="getCustomerAddress">

44 <input message="tns:getCustomerAddressInput" name=" getCustomerAddressInput"/>

45 <output message="tns:getCustomerAddressOutput" name=" getCustomerAddressOutput "/>

46 </operation>

47 </portType>

48

49 <binding name="CustomerSOAPBinding"

50 type="tns:CustomerInterface" >

51 <soap:binding style="document"

52 transport="http://schemas.xmlsoap.org/soap/http" />

53 <operation name="getCustomerAddress">

54 <soap:operation

55 soapAction="http://soa-in-practice.com/getCustomerAddress" />

56 <input name=" getCustomerAddressInput ">

57 <soap:body use="literal" />

58 </input>

59 <output name=" getCustomerAddressOutput ">

60 <soap:body use="literal" />

61 </output>

62 </operation>

63 </binding>

64

65 <service name="CustomerService" >

66 <port name="CustomerPort"

67 binding="tns:CustomerSOAPBinding">

68 <soap:address

69 location="http://soa-in-practice.com/customer11"/>

70 </port>

71 </service>

72

73 </definitions>

l         最后的service定義了一個(gè)名為CustomerService的服務(wù),該服務(wù)可以從http://soa-in-practice.com/customer11得到,與其一同提供的有被稱(chēng)為CustomerSOAPBinding的綁定。前綴tns是可以找到這個(gè)綁定標示符細節的命名空間,可以在最前面找到。

l         Binding定義了用來(lái)提供服務(wù)的協(xié)議和格式。這里我們可以看到CustomerSOAPBinding的定義。指定用于CustomerInterface的接口類(lèi)型。這個(gè)綁定是基于底層HTTP協(xié)議的SOAP綁定,這里的風(fēng)格為document/ literal

l         portType定義了接口CustomerInterface的接口。它包含一個(gè)叫getCustomerAddress的操作,指明了當操作被調用時(shí)候,服務(wù)總線(xiàn)發(fā)送的消息。它發(fā)送一個(gè)請求,收到一個(gè)應答(牽涉到消息交換格式)。這通過(guò)一個(gè)輸入消息getCustomerAddressInput,以及一個(gè)輸出消息getCustomerAddressOutput來(lái)定義。

l         message定義了各個(gè)消息,使用的是portType節引用的標示符。不管是getCustomerAddressInput還是getCustomerAddressOutput,都是用了在<types>節中定義的數據類(lèi)型。

l         types定義了將會(huì )使用的數據類(lèi)型:輸入參數customerID的類(lèi)型是long,輸出參數address的類(lèi)型是有3個(gè)字符串屬性的結構記錄。所有類(lèi)型在自己的命名空間wsdl中。

 

版本2.0對應的WSDL文件:

 

1 <?xml version="1.0" encoding="utf-8" ?>

2 <description

3 targetNamespace="http://soa-in-practice.com/wsdl"

4 xmlns:tns="http://soa-in-practice.com/wsdl"

5 xmlns:xsd1="http://soa-in-practice.com/xsd"

6 xmlns:xsd="http://www.w3.org/2001/XMLSchema"

7 xmlns:wsoap="http://www.w3.org/2006/01/wsdl/soap"

8 xmlns:wsdlx="http://www.w3.org/2006/01/wsdl-extensions"

9 xmlns="http://www.w3.org/2006/01/wsdl">

10

11 <types>

12 <xsd:schema

13 targetNamespace="http://soa-in-practice.com/xsd"

14 xmlns="http://soa-in-practice.com/xsd">

15

16 <xsd:element name="getCustomerAddress">

17 <xsd:complexType>

18 <xsd:sequence>

19 <xsd:element name="customerID" type="xsd:long"/>

20 </xsd:sequence>

21 </xsd:complexType>

22 </xsd:element>

23

24 <xsd:element name="getCustomerAddressResponse" type="Address"/>

25 <xsd:complexType name="Address">

26 <xsd:sequence>

27 <xsd:element name="street" type="xsd:string"/>

28 <xsd:element name="city" type="xsd:string"/>

29 <xsd:element name="zipCode" type="xsd:string"/>

30 </xsd:sequence>

31 </xsd:complexType>

32

33 </xsd:schema>

34 </types>

35

36 <interface name = "CustomerInterface" >

37

38 <operation name="getCustomerAddress"

39 pattern="http://www.w3.org/2006/01/wsdl/in-out"

40 style="http://www.w3.org/2006/01/wsdl/style/iri"

41 wsdlx:safe = "true">

42 <input messageLabel="In"

43 element="xsd1:getCustomerAddress" />

44 <output messageLabel="Out"

45 element="xsd1:getCustomerAddressResponse" />

46 </operation>

47

48 </interface>

49

50 <binding name="CustomerSOAPBinding"

51 interface="tns:CustomerInterface"

52 type="http://www.w3.org/2006/01/wsdl/soap"

53 wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP">

54

55 <operation ref="tns:getCustomerAddress"

56 wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response"/>

57

58 </binding>

59

60 <service name="CustomerService"

61 interface="tns:CustomerInterface">

62

63 <endpoint name="CustomerEndpoint"

64 binding="tns:CustomerSOAPBinding"

65 address="http://soa-in-practice.com/customer20"/>

66

67 </service>

68

69 </description>

 

主要區別是:

1.       XML跟元素的名字是description

2.       service節是用的是endpoint而非port

3.       binding節內,定義了SOAP1.2

4.       portTypeinterface取代,是用了根具體,定義了底層消息順序的消息交換模式

5.       message節點(diǎn)沒(méi)有了,操作世界引用數據類(lèi)型,定義在types中,發(fā)送那個(gè)消息遵循interface節中指定的類(lèi)型和消息交換模式

6.       用不同的命名空間來(lái)標識WSDL2.0SOAP1.2

 

SOAP

       SOAP最初是“簡(jiǎn)單對象訪(fǎng)問(wèn)協(xié)議”的首字母縮寫(xiě)詞,后來(lái)開(kāi)發(fā)者發(fā)現SOAP既不簡(jiǎn)單,也不處理對象訪(fǎng)問(wèn),從1.2版本開(kāi)始,這個(gè)縮寫(xiě)詞就被當做一個(gè)詞使用,不再代表一種縮寫(xiě)了。

根據上面的例子。其SOAP請求的一個(gè)例子,如下:

<?xml version='1.0' ?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Header>

...

</soap:Header>

<soap:Body>

<getCustomerAddress xmlns="http://soa-in-practice.com/xsd">

<customerID>12345678</customerID>

</getCustomerAddress >

</soap:Body>

</soap:Envelope>

一個(gè)相應的應答消息如下:

<?xml version='1.0' ?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Header>

...

</soap:Header>

<soap:Body>

<getCustomerAddressResponse xmlns="http://soa-in-practice.com/xsd">

<address>

<street>Gaussstr. 29</street>

<city>Braunschweig</city>

<zipCode>D-38106</zipCode>

</address>

</getCustomerAddressResponse>

</soap:Body>

</soap:Envelope>

 

可以看到,SOAP消息格式為XML,包含一個(gè)被稱(chēng)為Envelope的跟元素。跟元素包含一個(gè)可選的Header和必備的Body元素。Body元素包含有效載荷(請求、回復、或者錯誤數據),Header包含額外的,幫助基礎設施處理消息的信息(如路由提示,安全提示等)。

 

UDDI

       “通用描述,發(fā)現和集成UDDI”最初是更寬泛的術(shù)語(yǔ),“通用描述、發(fā)現和集成業(yè)務(wù)注冊中心”。最初的想法是,引入一個(gè)有效的市場(chǎng)包含的全部3個(gè)角色:提供服務(wù)的供應者,需要服務(wù)的消費者,以及通過(guò)廣告和定位服務(wù)的兩方撮合道一起的中間人。這就產(chǎn)生了解釋Web Services通常要展示的著(zhù)名三角形:

 

 

 

 

Web Service其他相關(guān)的標準:

       Web Service的第一個(gè)問(wèn)題是,它不是一個(gè)由單個(gè)組織定義的標準。由超過(guò)50個(gè)不同的Web Service規范,分別由三家不同的標準化組織制定,W3C,OASIS,WS-I。

       即時(shí)對于前面的5個(gè)基礎標準,一直以來(lái),達到互操作性的目標也很困難。即時(shí)選擇了同一版本,規范也太粗糙,太寬泛。于是,在2002年,WS互操作性組織(WS-I)成立。

       WS-I的一樣重要東西就是“配套資料”,它是一套已經(jīng)定義了的標準,每一個(gè)標準都制定了特定的版本。

 

總結:

l         Web ServiceSOA基礎設施(ESB)事實(shí)上的標準

l         基于XMLHTTP這兩個(gè)協(xié)議,最重要的是用于描述Web Service接口的WSDL,以及用于規定Web Service通信協(xié)議格式的SOAP。

l         WSDL文件將不同的層用于服務(wù)接口,綁定和部署細節,因此,通常需要適當的過(guò)程來(lái)處理WSDL文件的生命周期。

l         WSDL并沒(méi)有綁定在SOAP上,可以使用其他綁定,所以接口描述在原則上能和任何技術(shù)一起使用

l         作為一個(gè)標準,WSDL只定義了互操作性的核心特性,沒(méi)有提供按去啊你選哪個(gè)、SLA等附加特性,這些也行可以由其他標準提供。

l         不同的標準化組織規定可許多不同的Web Service標準,各標準也有許多不同的版本,因此,互操作成為一個(gè)問(wèn)題。Web Service互操作性組織(WS-I)試圖解決這個(gè)問(wèn)題,其方法為針對某些標準的集合提供各種配套資料

l         在實(shí)踐中,為了互操作,通常應該使用WS-I基本配套資料和SOAP document/literal wrapped綁定

 

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
深入研究SOAP消息
使用CXF發(fā)布和調用webservice之HelloWorld入門(mén)
用Axis 1.1 for Java進(jìn)行Web Services開(kāi)發(fā)(1)
gSOAP中文文檔
(二)基于PHP——簡(jiǎn)單的WSDL的創(chuàng )建(WSDL篇)
使用Soap消息調用Web Services
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久