posts - 495,comments - 227,trackbacks - 0

          UDDI 數(shù)據(jù)結(jié)構(gòu)

          為了開始將公司添加到 UDDI 注冊(cè)中心,F(xiàn)rancis 定義了要輸入注冊(cè)中心的信息。

          businessEntity

          第一步是將報(bào)社本身的信息輸入注冊(cè)中心。為此,F(xiàn)rancis 創(chuàng)建了一個(gè) businessEntity 對(duì)象。此對(duì)象包含有關(guān)企業(yè)的信息,既用于對(duì)企業(yè)進(jìn)行標(biāo)識(shí),也用于提供與其有關(guān)的信息。例如,businessEntity 對(duì)象可以包含多個(gè)名稱(從而能夠?yàn)楣舅褂玫拿糠N語言創(chuàng)建一個(gè) name 元素),聯(lián)系信息(Francis 被告知將 Pat Mooney 添加為主要聯(lián)系人)、與實(shí)體相關(guān)的服務(wù)(Gene 將稍后添加)和用于對(duì)公司進(jìn)行標(biāo)識(shí)與分類的信息。

          盡管大部分人都不會(huì)采用這種方式與 UDDI 注冊(cè)中心交互,但要注意的一個(gè)事實(shí)是,UDDI 實(shí)際上就是 SOAP 應(yīng)用程序;執(zhí)行的所有操作都作為往返傳遞 SOAP 消息的結(jié)果發(fā)生。這意味著,F(xiàn)rancis 所創(chuàng)建的 businessEntity 最終將表示為 XML 元素。請(qǐng)參見清單 2


          清單 2. businessEntity 元素
          												
          														<businessEntity businessKey="{uuid}"
          												 operator="(optional)" 
          authorizedName="(optional)">
          <discoveryURLs>
          <discoveryURL></discoveryURL>
          <discoveryURL></discoveryURL>
          </discoveryURLs>
          <name>The Daily Moon</name>
          <name lang="fr-ca">La Lune Quotidienne</name>
          <description></description>
          <contacts>
          <contact>
          <description></description>
          <personName>Pat Mooney</personName>
          <phone></phone>
          <email>patm@daily-moon.com</email>
          <address useType="optional, billing, etc." 
          sortCode="optional" 
          tModelKey="optional">
          <addressLine></addressLine>
          <addressLine></addressLine>
          <addressLine></addressLine>
          </address>
          </contact>
          <contact>
                   ...
          </contact>
          </contacts>
          <businessServices>
          <businessService serviceKey="required" 
          businessKey="optional">
                   ...
          </businessService>
          </businessServices>
          <identifierBag>
                ...
          </identifierBag>
          <categoryBag>
                ...
          </categoryBag>
          </businessEntity>

          businessEntity 記錄并不一定要很復(fù)雜。事實(shí)上,按照 businessKey 的要求,單個(gè)名稱和一個(gè)唯一標(biāo)識(shí)符就足夠了。不過,出于完整性考慮,我包含了完整的結(jié)構(gòu),但去掉了一些稍后將另行討論的部分。在生產(chǎn)環(huán)境中,應(yīng)將空白元素刪除。

          讓我們看一看此處的一些信息。

          從代碼的起始處開始,businessKey 當(dāng)然是唯一標(biāo)識(shí)符。operator 和 authorizedName 屬性由注冊(cè)中心內(nèi)部進(jìn)行處理;您不必考慮這部分內(nèi)容,它們僅僅分別表示運(yùn)行注冊(cè)中心的實(shí)體和添加此記錄的人員或帳戶。

          discoveryURLs 會(huì)在每次將 businessEntity 保存到注冊(cè)中心時(shí)添加到注冊(cè)中心。這些 URL 旨在用作供用戶訪問有關(guān) businessEntity 的更多信息的地址。

          請(qǐng)注意,F(xiàn)rancis 添加了一個(gè)額外的名稱,用于以法語表示其名稱(報(bào)社打算在法國(guó)宣傳其業(yè)務(wù))。這些實(shí)體中的每一個(gè)都具有 lang 屬性,用于指定相關(guān)語言的代碼。您可以提供常見縮寫的可替換名稱,如 IBM 對(duì)應(yīng)于 International Business Machines。

          接下來的可選描述是一個(gè)簡(jiǎn)單的文本字符串。事實(shí)上,UDDI 中的大部分元素都具有一個(gè)可選描述。

          接下來,F(xiàn)rancis 添加了其他一些聯(lián)系人。對(duì)于每個(gè)聯(lián)系人,他可以根據(jù)需要指定任意多的信息。通常會(huì)提供 personName,但電話號(hào)碼、電子郵件等其他信息是由個(gè)人自行提供的,因?yàn)?UDDI 注冊(cè)中心的所有信息對(duì)所有用戶均可用。聯(lián)系人還可能具有地址信息,使用 useType 來指定地址類型。例如,對(duì)于聯(lián)系人,它可以為家庭地址和公司地址等。對(duì)于公司,useType 可以為總部、發(fā)行中心等等。

          businessServices 元素將列出已與 businessEntity 關(guān)聯(lián)的任何服務(wù)。由于 Gene 尚未添加任何服務(wù),故而此元素通常為空。最后兩項(xiàng) identifierBagcategoryBag 提供了有關(guān)公司本身的其他信息,以便進(jìn)行搜索。我們稍后將對(duì)二者分別進(jìn)行分析。





          回頁(yè)首


          publisherAssertion

          publisherAssertionbusinessEntity 之間的關(guān)系聲明。例如,F(xiàn)rancis 知道此項(xiàng)目的目標(biāo)之一是使用 Daily Star 中提供的服務(wù),其中,Daily Star 將為 Daily Moon 提供體育賽事比分。這使得 Daily Star 成為 Daily Moon 的內(nèi)容提供者。Francis 可以按照清單 3 中所示的方式表示此關(guān)系。


          清單 3. publisherAssertion
                              
          <publisherAssertion>
          <fromKey>(businessKey for Daily Star)</fromKey>
          <toKey>(businessKey for Daily Moon)</toKey>
          <keyedReference tModelKey="904BD800-D53A-11DA-B055-850A1DA99D79" 
                   keyName="optional" keyValue="CONTENTPROVIDER" />
          </publisherAssertion>
          

          fromKeytoKey 元素表示所涉及的兩個(gè)實(shí)體的唯一 ID。在本例中,這兩個(gè)實(shí)體指 Daily MoonDaily StarDaily StarDaily Moon 的內(nèi)容提供者,故而據(jù)此放置二者的鍵。keyedReference 將會(huì)多次出現(xiàn)。在本例中,我們可以說引用本身就是內(nèi)容提供者。keyValuekeyedReference 的唯一必需屬性,但常常也會(huì)包含 keyName(為了提高可讀性)和 tModelKey(標(biāo)識(shí)特定的引用類型)。在本例中,tModelKey 表示兩個(gè)報(bào)社之間關(guān)聯(lián)的命名空間(與內(nèi)部關(guān)系相對(duì))。我們稍后將對(duì) tModels 進(jìn)行進(jìn)一步的討論。





          回頁(yè)首


          businessService

          接下來,F(xiàn)rancis 需要輸入有關(guān) Daily Moon 將要提供的任何實(shí)際服務(wù)的信息。除了所需的唯一 serviceKey 和名稱外,businessService 對(duì)象中還包含兩條重要信息。即 bindingTemplates 和服務(wù)所屬的任何類別。請(qǐng)參見清單 4


          清單 4. businessService
          												
          														<businessService serviceKey="required"
          												 businessKey="optional">
          <name></name>
          <description></description>
          <bindingTemplates>
          <bindingTemplate serviceKey="optional" bindingKey="required">
                   ...
          </bindingTemplate>
          </bindingTemplates>
          <categoryBag>
                ...
          </categoryBag>
          </businessService>





          回頁(yè)首


          BindingTemplate

          Tmodelinstancedetails 指示其兼容的應(yīng)用程序或規(guī)范。請(qǐng)參見清單 5


          清單 5. bindingTemplate
          												
          														<bindingTemplate
          												 serviceKey="optional"
           bindingKey="required">
                              <accessPoint> OR <hostingRedirector bindingKey="another
           binding to be used instead">
          <tModelInstanceDetails>
          <tModelInstanceDetail>
          <tModelInstanceInfo tModelKey=""uuid key for specification tModel">>
          <description></description>
          <instanceDetails>
          <description></description>
          <overviewDoc>
          <description></description>
          <overviewURL></overviewURL>
          </overviewDoc>
          <instanceParams>string</intstanceParms>
          </instanceDetails>
          </tModelInstanceInfo>
          <tModelInstanceInfo>
                      ...
          </tModelInstanceInfo>
            </tModelInstanceDetail>
             <tModelInstanceDetails>
          </bindingTemplate>
          TModels (including tModel of tModels)
          Serve two purposes.  As specification indicators, and as namespace indicators.
          <tModel tModelKey="required" operator="optional" 
          authorizedName="optional">
          <name></name>
          <description></description>
          <overviewDoc>
          <description></description>
          <overviewURL></overviewURL>
          <overviewDoc>
          
             <identifierBag>
          ...
          </identifierBag>
          <categoryBag>
                ...
          </categoryBag>
          </tModel>

          bindingTemplate 定義在何處能找到服務(wù)以及其執(zhí)行什么工作,這聽起來并不復(fù)雜。不過,這兩項(xiàng)功能在 UDDI 上下文中擔(dān)任了新的重要角色。例如,為了確定可以在何處訪問服務(wù),可以提供 accessPoint(表示簡(jiǎn)單的 URL)或任何其他相應(yīng)的數(shù)據(jù),如求助熱線的號(hào)碼或 hostingRedirector

          分類法

          對(duì)信息進(jìn)行分類時(shí),如果能就如何進(jìn)行分類達(dá)成一致則很有幫助。這些一致同意的分類標(biāo)準(zhǔn)稱為分類法。

          例如,北美工業(yè)分類系統(tǒng) (NAICS) 通過為每種類別指定一個(gè)唯一代碼來區(qū)分“體育用品出租”、“體育用品商店”和“二手體育用品商店”。這樣,當(dāng)遇到代碼 532292 時(shí),就知道所說的是出租體育用品的商家,而不是出售這些東西的商家。

          UDDI 操作員向系統(tǒng)添加一系列分類法作為例行規(guī)定,可供您在無需為其注冊(cè) tModels 的情況下使用。例如,jUDDI 可以使用 tModelA035A07C-F362-44DD-8F95-E2B134BF43B4uddi-org:general_keywords 創(chuàng)建 tModel,因此您可以使用它,而不必自己定義。

          當(dāng)服務(wù)的綁定發(fā)生更改時(shí),將使用 hostingRedirector。例如,如果 Daily Moon 要建立自己的分類廣告服務(wù),并允許這兩家報(bào)社使用 createNewAdd() 調(diào)用提交廣告,則需要確保服務(wù)永遠(yuǎn)不會(huì)更改,或者提供一個(gè)方法來告知客戶機(jī)服務(wù)已發(fā)生更改。而這就是要使用 hostingRedirector 的地方。在這種情況下,F(xiàn)rancis(或?qū)嶋H由 Gene 進(jìn)行)將創(chuàng)建一個(gè)新 bindingTemplate,用于表示新信息,并將該 bindingTemplatebindingKey 輸入 hostingRedirector 元素的 bindingKey 屬性中。

          定義服務(wù)能進(jìn)行的工作可能會(huì)更困難。這個(gè)原因是兩方面的。首先,由于我們討論的并不一定是 SOAP 服務(wù),因此無法直接為其提供 WSDL 文件。其次,由于這應(yīng)該是一個(gè)自動(dòng)化過程,因此需要以無歧義的方式提供此信息。

          這樣所得的結(jié)果是一個(gè)包括 tModelInstanceDetails 元素的 bindingTemplate,而此元素中又包含一個(gè)或多個(gè) tModelInstanceDetail 元素。每個(gè) tModelInstanceDetail 元素又包含一個(gè)或多個(gè) tModelInstanceInfo 元素,而后者各自指向一個(gè)特定的 tModel。我們稍后將對(duì) tModels 進(jìn)行討論。不過,重要的是要理解,tModelInstanceInfo 元素可以包含一個(gè) instanceDetails 元素,后者本身包含一個(gè) overviewDoc,其中包括 overviewURL,即實(shí)際定義服務(wù)的文檔的 URL。(是的,就是在此處指定 WSDL 文件。)





          回頁(yè)首


          TModels(包括 tModels 的 tModel)

          現(xiàn)在讓我們討論一下 tModels

          tModels 實(shí)際有兩個(gè)用途。第一,就是我們?cè)陉P(guān)于 publisherAssertions 的討論中了解到的,作為“命名空間指示符”。也就是說,tModel 可以提供用于區(qū)分很容易混淆的信息類型的方法。經(jīng)常給出的一個(gè)例子是稅碼(或其他很容易混淆的數(shù)字)。例如,包含以下內(nèi)容的 keyedReference 并不會(huì)提供所有信息,因?yàn)檫@兩個(gè)稅務(wù) ID 屬于不同的國(guó)家。它們?cè)趦蓚€(gè)國(guó)家里都稱為稅務(wù) ID,但就編程而言,我們必須提供一個(gè)區(qū)分二者的方法,如清單 6 中所示。


          清單 6. 來自不同國(guó)家的稅務(wù) ID
                              
          <keyedReference tModelKey="" keyName="taxid" 
          keyValue="11111111" />
          <keyedReference tModelKey="" keyName="taxid" 
          keyValue="22222222" />
          

          這就是要使用 tModel 的地方。我們可以為“美國(guó)稅碼”創(chuàng)建一個(gè)鍵模型,再為“墨西哥稅碼”創(chuàng)建一個(gè)鍵模型,依此類推。創(chuàng)建了這些模型后,可以使用其 tModel 鍵來進(jìn)一步限定這些 keyedReference。請(qǐng)參見清單 7


          清單 7. tModels 和 keyedReferences
                              
          <tModel tModelKey="902CDE50-D53A-11DA-B055-A74C17FA61A7">
             <name>United States codes</name>
          </tModel>
          <tModel tModelKey="062377D0-D5F5-11DA-8170-8ACF057FECAD">
             <name>Mexico codes</name>
          </tModel>
          <keyedReference tModelKey="902CDE50-D53A-11DA-B055-A74C17FA61A7" 
                          keyName="taxid" keyValue="11111111" />
          <keyedReference tModelKey="062377D0-D5F5-11DA-8170-8ACF057FECAD" 
                          keyName="taxid" keyValue="22222222" />
          

          tModel 的另一個(gè)用途是作為規(guī)范標(biāo)識(shí)符。例如,F(xiàn)rancis 知道 Gene 將為上個(gè)月所處理的 ClassifiedService 創(chuàng)建相應(yīng)的條目。此服務(wù)表示特定的接口,因此可以使用 tModel 對(duì)其進(jìn)行標(biāo)識(shí)。tModel 可能與清單 8 中所示類似。


          清單 8. tModel
          												
          														<tModel tModelKey="66999A50-D5F4-11DA-9A50-FA44D6AD622A"
          												 
                  operator="optional" authorizedName="optional">
          
             <name>Classified Service Interface</name>
             <description></description>
          
             <overviewDoc>
                <description></description>
                <overviewURL>
                  http://www.daily-moon.com/ClassifiedService-interface.wsdl
                </overviewURL>
             <overviewDoc>
          
             <identifierBag>
          ...
             </identifierBag>
          
             <categoryBag>
                ...
             </categoryBag>
          </tModel>

          和我們所討論的各個(gè)其他對(duì)象一樣,tModel 具有一個(gè)唯一鍵,這是它唯一必需的信息。不過,在本例中,我們還要指定 overviewURL,即接口的 WSDL 文件的 URL。(我們將在后面部分創(chuàng)建它。)

          同樣,可以使用 identifierBag 對(duì) tModels 進(jìn)行標(biāo)識(shí),還可以使用 categoryBag 對(duì)其進(jìn)行歸類。接下來讓我們看一看如何進(jìn)行此工作。





          回頁(yè)首


          identifierBag

          由于 UDDI 設(shè)計(jì)十分靈活,因此沒有特定的方式來標(biāo)識(shí) businessEntity。UDDI 并不強(qiáng)制要求使用其 D-U-N-S 編號(hào)、其稅務(wù) ID 編號(hào)或任何特定的標(biāo)識(shí)方法對(duì)公司進(jìn)行標(biāo)識(shí)。相反,它提供了一個(gè)容器,可以根據(jù)需要在其中放置任意數(shù)量的標(biāo)識(shí)符,如清單9 中所示。


          清單 9. indentifierBag
          												
          														<identifierBag>
          												
          												
          														<keyedReference
          												
           tModelKey="4064C064-6D14-4F35-8953-9652106476A9" 
                   keyName="DUNS Number" keyValue="55555555" /><keyedReference tModelKey="" 
                   keyName="US Tax ID" keyValue="111111111" />
          </identifierBag>

          identifierBag 中添加的每個(gè) keyedReference 都代表用戶在搜索中找到相關(guān)對(duì)象的另一個(gè)機(jī)會(huì)。





          回頁(yè)首


          categoryBag

          categoryBag 的工作方式與 identifierBag 類似,因?yàn)槠渲邪粋€(gè)或多個(gè) keyedReferences。請(qǐng)參見清單 10


          清單 10. categoryBag
          												
          														<categoryBag>
             <keyedReference
          												 tModelKey="C0B9FE13-179F-413D-8A5B-5004DB8E5BB2" 
                     keyName="optional" keyValue="511110" />
          </categoryBag>

          在本例中,F(xiàn)rancis 創(chuàng)建了一個(gè) categoryBag,指示 Daily Moon 是一個(gè)報(bào)社分支機(jī)構(gòu)。現(xiàn)在讓我們了解如何使用所有這些對(duì)象。





          回頁(yè)首


          將 WSDL 映射到 UDDI

          在 Gene 編寫任何代碼將所有這些信息發(fā)送到 UDDI 注冊(cè)中心前,他必須在其當(dāng)前服務(wù)和 UDDI 之間建立一個(gè)重要的聯(lián)系。他必須對(duì)其進(jìn)行調(diào)整,以適應(yīng) UDDI 的服務(wù)、接口和綁定模板概念。

          服務(wù)與接口

          您可能還記得,服務(wù)在 UDDI 中包含三個(gè)部分:接口(使用 tModels 定義)、businessServicebindingTemplate(用于將兩者捆綁在一起)。因此,Gene 將首先確定用于定義 SOAP 服務(wù)的 WSDL 文件如何適應(yīng)此結(jié)構(gòu)。

          他首先對(duì) WSDL 進(jìn)行分析。幸運(yùn)的是,這非常簡(jiǎn)單。除了實(shí)現(xiàn)本身外,其余所有 WSDL 內(nèi)容都屬于接口。請(qǐng)參見清單 11


          清單 11. WSDL 接口
                              
          <wsdl:definitions xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
                xmlns:tns="http://ws.apache.org/axis2"
                xmlns:axis2="http://ws.apache.org/axis2"
                xmlns:ns1="http://org.apache.axis2/xsd" 
                targetNamespace="http://ws.apache.org/axis2">
          
             <wsdl:types>
                <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                      targetNamespace="http://org.apache.axis2/xsd" 
                      elementFormDefault="unqualified" 
                      attributeFormDefault="unqualified">
          
                   <xs:element type="ns1:ClassifiedAd" name="ClassifiedAd"
           />
                   <xs:complexType name="ClassifiedAd">
                      <xs:sequence>
                         <xs:element type="xs:int" name="id" />
                         <xs:element type="xs:string" name="content" />
                         <xs:element type="xs:string" name="endDate" />
                         <xs:element type="xs:string" name="startDate" />
                      </xs:sequence>
                   </xs:complexType>
                   ...
                </xs:schema>
             </wsdl:types>
          
             <wsdl:message name="createNewAdRequestMessage">
                <wsdl:part name="part1" element="ns1:createNewAdRequest" />
             </wsdl:message>
             <wsdl:message name="createNewAdResponseMessage">
                <wsdl:part name="part1" element="ns1:createNewAdResponse" />
             </wsdl:message>
             ...
          
             <wsdl:portType name="ClassifiedServicePortType">
                <wsdl:operation name="finalizeIssue">
                   <wsdl:input message="tns:finalizeIssueRequestMessage" />
                </wsdl:operation>
                <wsdl:operation name="createNewAd">
                   <wsdl:input message="tns:createNewAdRequestMessage" />
                   <wsdl:output message="tns:createNewAdResponseMessage" />
                </wsdl:operation>
                ...
             </wsdl:portType>
          
             <wsdl:binding name="ClassifiedServiceBinding" 
                            type="tns:ClassifiedServicePortType">
                <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
                            style="document" />
                <wsdl:operation name="createNewAd">
                   <soap:operation soapAction="createNewAd" style="document"
           />
                   <wsdl:input>
                      <soap:body use="literal" 
                                  namespace="http://ws.apache.org/axis2" />
                   </wsdl:input>
                   <wsdl:output>
                      <soap:body use="literal" 
                                  namespace="http://ws.apache.org/axis2" />
                   </wsdl:output>
                </wsdl:operation>
                ...
             </wsdl:binding>
          </wsdl:definitions>
          

          這包括類型定義(XML 模式)、任何消息、portType 甚至 binding,因?yàn)榻壎ú⒉皇翘囟ㄓ趯?shí)現(xiàn)的。

          實(shí)現(xiàn)由實(shí)際的服務(wù)元素組成。請(qǐng)參見清單 12


          清單 12. 服務(wù)實(shí)現(xiàn) WSDL
                              
          <wsdl:definitions xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
                xmlns:tns=
                  "http://www.daily-moon.com/ClassifiedService-interface"
                xmlns:axis2="http://ws.apache.org/axis2"
                xmlns:ns1="http://org.apache.axis2/xsd" 
                targetNamespace=
                  "http://www.daily-moon.com/ClassifiedService-interface">
          
          <wsdl:import namespace="http://ws.apache.org/axis2" 
             location=
          "http://www.nicholaschase.com/ClassifiedService-interface.wsdl" 
          />
          
          <wsdl:service name="ClassifiedService">
             <wsdl:port name="ClassifiedServicePort" 
                         binding="axis2:ClassifiedServiceBinding">
                <soap:address 
                   location=
           "http://www.daily-moon.com:8080/axis2/services/ClassifiedService" 
                />
             </wsdl:port>
          </wsdl:service>
          
          </wsdl:definitions>
          

          請(qǐng)注意,實(shí)現(xiàn)文件導(dǎo)入了接口文件。也就是說,此文件是服務(wù)的完整定義。

          現(xiàn)在讓我們來看一看這如何與我們的 UDDI 對(duì)象對(duì)應(yīng)。





          回頁(yè)首


          將接口映射到 tModel

          Gene 首先必須將接口映射到相應(yīng)的 tModel。請(qǐng)參見清單 13


          清單 13. tModel
                              
          <tModel tModelKey="66999A50-D5F4-11DA-9A50-FA44D6AD622A">
          
            
           <name>http://www.daily-moon.com/ClassifiedService-
          interface</name>
             <description>Interface for the Daily Moon Classified 
          Department web application</description>
          
             <overviewDoc>
                <description>WSDL interface document</description>
                <overviewURL>
                    http://www.daily-moon.com/ClassifiedService-interface.wsdl
                </overviewURL>
             <overviewDoc>
          
             <categoryBag>
                <keyedReference
           tModelKey="C1ACF26D-9672-4404-9D70-39B756E62AB4"
                         keyName="uddi-org:types" keyValue="wsdlSpec" />
                <keyedReference
           tModelKey="C0B9FE13-179F-413D-8A5B-5004DB8E5BB2" 
                         keyName="ntis-gov:naics:1997" keyValue="511110" />
             </categoryBag>
          </tModel>
          

          首先看最下面,請(qǐng)注意 categoryBag。Gene 添加了兩個(gè) keyReferences。第一個(gè)指定我們事實(shí)上在處理 WSDL 文件。已預(yù)定義了特定的 tModelKey 來表示 uddi-org:types 命名空間。所有 WSDL 文件都必須采用這種方式指定。第二個(gè)引用綁定到 ntis-gov:naics:1997 命名空間,因此 Gene 的用戶可以方便地在表示與報(bào)紙有關(guān)的服務(wù)的所有 WSDL 文件中找到此定義。繼續(xù)往上,我們可以看到 overviewDoc。除了可選描述外,它還指定了實(shí)際的 URL,可以在此處找到 WSDL 文件。

          最后,tModel 的名稱應(yīng)與 WSDL 文件的目標(biāo)命名空間匹配。





          回頁(yè)首


          將實(shí)現(xiàn)映射到綁定模板

          Gene 接下來必須將實(shí)現(xiàn)本身映射到 bindingTemplate。請(qǐng)參見清單 14


          清單 14. bindingTemplate
                              
          <bindingTemplate serviceKey="" bindingKey="">
          
             <accessPoint>
                http://www.daily-moon.com:8080/axis2/services/ClassifiedService
             </accessPoint>
          
             <tModelInstanceDetails>
                <tModelInstanceDetail>
                   <tModelInstanceInfo 
                           tModelKey="66999A50-D5F4-11DA-9A50-FA44D6AD622A">
                      <instanceDetails>
                         <description>The canonical implementation of 
                            the Daily Moon's classified
           service.</description>
                         <overviewDoc>
                            <overviewURL>
                     http://www.daily-moon.com/ClassifiedService-impl.wsdl
                            </overviewURL>
                         </overviewDoc>
                      </instanceDetails>
                   </tModelInstanceInfo>
                </tModelInstanceDetail>
             </tModelInstanceDetails>
          
          
          </bindingTemplate> 
          

          這里我們看到,Gene 創(chuàng)建了一個(gè)新 bindingTemplate,并將 accessPoint 設(shè)置為實(shí)際服務(wù)的 URL。鍵 modelInstanceDetails 將接口 tModel(通過 tModelKey)鏈接到實(shí)現(xiàn)文檔(在 overviewDoc 中指定)。現(xiàn)在他只需要從服務(wù)引用它即可。





          回頁(yè)首


          從 businessService 和 businessEntity 引用 bindingTemplate

          最后一步是將所有這些組裝起來,并從 businessService 引用 bindingTemplate、從 businessEntity 引用 businessService。請(qǐng)參見清單 15


          清單 15. 完整的 businessEntity
                              
          <businessEntity businessKey="1A3DB880-D5F4-11DA-B880-F94D3591C691">
             <name>The Daily Moon</name>
             <name lang="fr-ca">La Lune Quotidienne</name>
             <contacts>
                <contact>
                   <personName>Pat Mooney</personName>
                   <email>patm@daily-moon.com</email>
                </contact>
             </contacts>
          
             <businessServices>
                <businessService 
                      serviceKey="064B4170-D5F5-11DA-8170-A74C17FA61A7">
                   <name>ClassifiedService</name>
                   <bindingTemplates>
                      <bindingTemplate 
                           bindingKey="904BD800-D53A-11DA-B055-850A1DA99D79">
                         <accessPoint>
                http://www.daily-moon.com:8080/axis2/services/ClassifiedService
                         </accessPoint>
          
                         <tModelInstanceDetails>
                            <tModelInstanceDetail>
                               <tModelInstanceInfo 
                           tModelKey="66999A50-D5F4-11DA-9A50-FA44D6AD622A">
                                  <instanceDetails>
                                     <description>The canonical
           implementation of the Daily Moon's classified 
          service.</description>
                                     <overviewDoc>
                                        <overviewURL>
                     http://www.daily-moon.com/ClassifiedService-impl.wsdl
                                        </overviewURL>
                                     </overviewDoc>
                                  </instanceDetails>
                               </tModelInstanceInfo>
                            </tModelInstanceDetail>
                         </tModelInstanceDetails>
          
                      </bindingTemplate>
                   </bindingTemplates>
          
                   <categoryBag>
                      <keyedReference 
                           tModelKey="C1ACF26D-9672-4404-9D70-39B756E62AB4"
                           keyName="uddi-org:types" keyValue="wsdlSpec" />
                      <keyedReference 
                           tModelKey="C0B9FE13-179F-413D-8A5B-5004DB8E5BB2" 
                           keyName="ntis-gov:naics:1997" keyValue="511110" />
                   </categoryBag>
                </businessService>
             </businessServices>
          
             <identifierBag>
                <keyedReference
           tModelKey="4064C064-6D14-4F35-8953-9652106476A9" 
                   keyName="DUNS Number" keyValue="55555555" />
                <keyedReference tModelKey="" 
                   keyName="US Tax ID" keyValue="111111111" />
             </identifierBag>
          
             <categoryBag>
                <keyedReference
           tModelKey="C0B9FE13-179F-413D-8A5B-5004DB8E5BB2" 
                     keyName="optional" keyValue="511110" />
             </categoryBag>
          </businessEntity>
          

          也就是說,服務(wù)現(xiàn)在已經(jīng)完成:Gene 現(xiàn)在有了一個(gè)包含服務(wù)的 businessEntity





          回頁(yè)首

          posted on 2006-12-29 19:32 SIMONE 閱讀(1268) 評(píng)論(0)  編輯  收藏 所屬分類: AXISJAVA
          主站蜘蛛池模板: 十堰市| 大连市| 微博| 九寨沟县| 台安县| 喀什市| 新闻| 顺义区| 克什克腾旗| 德庆县| 大方县| 忻城县| 枣阳市| 湖北省| 宝应县| 扎鲁特旗| 洪洞县| 莫力| 贺州市| 修水县| 柘荣县| 新竹市| 邵阳市| 新余市| 温泉县| 措勤县| 磐石市| 固始县| 海晏县| 东丰县| 即墨市| 额敏县| 巨鹿县| 永春县| 五华县| 宁明县| 边坝县| 洛扎县| 类乌齐县| 酒泉市| 赫章县|