<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-128  評論-55  文章-5  trackbacks-0
      WS-ServiceGroup協議

    WS-ServiceGroup協議定義了ServiceGroup的概念,它使得我們可以根據各種規則,將 Web 服務和 WS-Resources 成組在一起

    以下是WS-ServiceGroup協議中的幾個重要定義:

    l        Member:

    A Web service that belongs to a ServiceGroup. Note, this Web service may be a component of a WS-Resource as defined in “Web Services Resources” [WS-Resource].

    l        ServiceGroup:

    A Web service that is a collection of other Web services or WS-Resources and the information that pertains to them. The purpose of the group is application domain specific. The means by which the membership in the ServiceGroup is formed may be through ServiceGroupRegistration, or through other means not defined by this specification.

    l        ServiceGroupEntry:

    An atomic entry in a ServiceGroup which associates a member to a ServiceGroup. A ServiceGroupEntry also contains content information by which the member’s participation in the ServiceGroup is advertised.

    l        ServiceGroupRegistration:

    A ServiceGroup that provides the means to allow users of the service to explicitly insert new members.

    1.1.1.1    什么ServiceGroup

    一旦應用程序變得足夠大而復雜,就應該將資源成組在一起。您可能想要基于用戶或服務角色來限制訪問,或者您想要提供可用服務的注冊表。不管是什么原因,WSRF 都通過使用 ServiceGroup 來處理問題。ServiceGroup 是一個 WS-Resource,它將指向其他 WS-Resources 和純 Web 服務的指針成組在一起

    ServiceGroup 是一個 WS-Resource。這對于我們來說意味著幾件事情。首先,它意味著 ServiceGroup Web 服務與有狀態資源的組合。在這種情況下,有狀態資源是 ServiceGroup 包含的項的組合,因為它是 WS-Resource,所以這個項組合是由 ServiceGroup 的資源屬性文檔表示的。

    它還意味著 ServiceGroup 是由端點引用識別的,我們可以通過后者來引用前者,并且我們可以在 ServiceGroup 上執行可以在任何其他 WS-Resource 上執行的相同操作,比如創建或銷毀它,或者訪問它的屬性。

    協議中的定義如下:

    A ServiceGroup is a WS-Resource and MUST comply with the definition of a WS-Resource in [WS-Resource]; the ServiceGroup represents a collection of other Web services. The individual services represented within the ServiceGroup are the ServiceGroup’s members, or its membership. The model for membership of a ServiceGroup is an entry resource property of the ServiceGroup. An entry WS-Resource also represents an association with a given member in the ServiceGroup and is used to manage the membership relationship. Additionally a ServiceGroup has the following characteristics:

    l        When a ServiceGroup WS-Resource is destroyed, all of the ServiceGroupEntry WS-Resources are also RECOMMENDED to be destroyed. Note however, that the actual member Web services or WS-Resources are not affected.

    l        Once a ServiceGroup is destroyed, a requestor MUST make no assumptions about either the existence of the entry WS-Resources or the validity of the contents of those WS-Resources.

    l        A member MAY belong to several ServiceGroups.

    l        A member MAY belong to the same ServiceGroup more then once.

    l        The member of a ServiceGroup MAY implement message exchanges from various interfaces.

    l        If a member WS-Resource is destroyed, the ServiceGroup MAY destroy the corresponding entry WS-Resource.

    l        A ServiceGroupEntry in isolation has no semantic meaning.

    1.1.1.2    創建ServiceGroup

    創建 ServiceGroup

    使用 ServiceGroup 的第一步是創建它。因為 ServiceGroup 就是一個 WS-Resource,所以我們就像創建其他 WS-Resource 一樣用一個 Create 消息來創建它:

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

        <SOAP-ENV:Header/>

        <SOAP-ENV:Body>

            <createSatGroup  xmlns="http://example.com/satellite"/>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    跟前面一樣,響應包含對新 WS-Resource 的端點引用:

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

        <SOAP-ENV:Header/>

        <SOAP-ENV:Body>

           <createSatGroupResponse xmlns="http://example.com/satellite">

             <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                 xmlns:sat="http://example.org/satelliteSystem">

               <wsa:Address> http://example.com/satellite</wsa:Address>

               <wsa:ReferenceProperties>

                   <sat:SatGroupId>SATGRP3</sat:SatGroupId>

               </wsa:ReferenceProperties>

             </wsa:EndpointReference>

           </createSatGroupResponse>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    好的,那么我們真正具有了什么呢?到目前為止,我們總是從定義 WS-Resource 的資源屬性文檔開始,但是我們在這里不是這樣做的,因為它已經為我們定義好了,正如您下面就會看到的。

     

    ServiceGroup ResourceProperties

    ServiceGroup 的資源屬性文檔定義在 WS-ServiceGroup.wsdl 文件中,所以我們無須定義它。實際上,實際的文檔類似于下面這樣:

    <wssg:ServiceGroupRP>

       <wssg:MembershipContentRule MemberInterface="sat:AuditedSatellitePortType" />

       <wssg:MembershipContentRule MemberInterface="sat:CounterPortType"

                                  ContentElements="sat:audited" />

       <wssg:MembershipContentRule ContentElements="sat:approvedBy" />

       <wssg:Entry>...</wssg:Entry>

       <wssg:Entry>...</wssg:Entry>

    </wssg:ServiceGroupRP>

    我們馬上就會在 ServiceGroup Entry 元素一節中談論 Entry 元素。

    我們將從 MembershipContentRule 元素開始。這些元素定義 ServiceGroupEntry 在可以被添加到 ServiceGroup 之前必須滿足的條件

    MemberInterface 屬性列出一系列PortType,所有實現了這些PortType的成員都必須滿足此成員規則。

    第二個屬性,即 ContentElements,指定必須包含在 ServiceGroupEntry Content 元素中的元素。我們在了解 ServiceGroupEntry 時再來詳細了解這一點。

    以下是協議中的定義:

    The general form of a MembershipContentRule resource property element is:

    <wsrf-sg:MembershipContentRule

        MemberInterfaces="list of QName"?

        ContentElements="list of QName"

    />

    This resource property element is further constrained as follows:

    /wsrf-sg:MembershipContentRule

    The MembershipContentRule constrains the ServiceGroup membership to those members that implement the interfaces described below in /wsrf-sg:membershipContentRule/@MemberInterfaces if present. A MembershipContentRule is further satisfied according to the rules defined below in wsrf-sg:membershipContentRule/@ContentElements.

    /wsrf-sg:membershipContentRule/@MemberInterfaces

    This optional attribute, when present, specifies the members to which this MembershipConentRule applies according to the interface (WSDL 1.1 portType) of the member Web service. 

    A MembershipContentRule applies to a member if, for each QName in the value of @MemberInterfaces, there is a corresponding interface (WSDL 1.1 portType) of the member Web service whose name matches that QName.  Two QNames are equivalent when they have the same local part and they have prefixes which have been bound to namespace names that are identical [XML-Names].  If this attribute is not present, all members MUST satisfy the enclosing MembershipContentRule’s @ContentElements constraint.

    /wsrf-sg:membershipContentRule/@ContentElements

    This attribute specifies the content restrictions according to the list of QNames, each of which refer to a XML Schema global element declaration.  This list defines the constraints on the wsrf-sg:Content resource property of the ServiceGroupEntry that MUST be satisfied for membership.  The list MAY be an empty list.  When an empty list is specified there are no content constraints on the resource properties of the ServiceGroupEntries that match the enclosing MembershipContentRule. 

    A member satisfies a MembershipContentRule if, for each QName in the value of @ContentElements, there is at least one child element of the wsrf-sg:Content of the ServiceGroupEntry’s resource properties document whose name matches that QName.  Two QNames are equivalent when they have the same local part and they have prefixes which have been bound to namespace names that are identical [XML-Names].

    Note: It is possible to construct a MembershipContentRule without a MemberInterface and with an empty list for the ContentElements.  Such a MembershipContentRule would have no effect on the membership as per the normative semantics described for this component.

    1.1.1.3    ServiceGroupEntry

    ServiceGroupEntry 也是一個 WS-Resource,所以它也具有定義其狀態的資源屬性文檔和識別它的 WS-Address它定義 ServiceGroup 和服務之間的關系,并包含可選內容,所以資源屬性文檔類似于下面這樣:

    <wssg:ServiceGroupEntryRP>

       <wssg:ServiceGroupEPR>

           <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                 xmlns:sat="http://example.org/satelliteSystem">

               <wsa:Address>http://example.com/satellite</wsa:Address>

               <wsa:ReferenceProperties>

                   <sat:SatGroupId>SATGRP3</sat:SatGroupId>

               </wsa:ReferenceProperties>

           </wsa:EndpointReference>

       </wssg:ServiceGroupEPR>

       <wssg:MemberEPR>

           <wsa:EndpointReference xmlns:wsa=http://www.w3.org/2005/02/addressing"

                 xmlns:sat="http://example.org/satelliteSystem">

               <wsa:Address>http://example.com/satellite</wsa:Address>

               <wsa:ReferenceProperties>

                   <sat:SatelliteId>SAT9928</sat:SatelliteId>

               </wsa:ReferenceProperties>

           </wsa:EndpointReference>

       </wssg:MemberEPR>

       <wssg:Content>

           <sat:approvedBy>BossManBing</sat:approvedBy>

       </wssg:Content>

    </wssg:ServiceGroupEntryRP>

    ServiceGroupEPR 是對 ServiceGroup 的端點引用,而 MemberEPR 引用實際的 Web 服務或 WS-ResourceServiceGroupEntry 也引用實際的 Web 服務或 WS-Resource

    Content 元素是可以包含在 ServiceGroupEntry 中的附加信息。在本例中,我們添加了一個批準代碼,指出服務即使沒有實現 CounterPortType AuditedSatellitePortType portTypes 也可以被添加到組中。

     

    ServiceGroup資源屬性文檔中的Entry 元素

    現在我們可以回過頭來看 ServiceGroup 的資源屬性文檔中的 Entry 元素。在本例中,每一項識別 ServiceGroupEntry 資源并提供到實際服務的指針,所以 ServiceGroup 的資源屬性文檔類似于下面這樣:

    <wssg:ServiceGroupRP>

       <wssg:MembershipContentRule MemberInterface="sat:AuditedSatellitePortType" />

       <wssg:MembershipContentRule MemberInterface="sat:CounterPortType"

                                  ContentElements="sat:audited" />

       <wssg:MembershipContentRule ContentElements="sat:approvedBy" />

       <wssg:Entry>

           <wssg:ServiceGroupEntryEPR>

               <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/02/addressing"

                     xmlns:sat="http://example.org/satelliteSystem">

                   <wsa:Address>http://example.com/satellite</wsa:Address>

                   <wsa:ReferenceProperties>

                       <sat:SatGroupEntryId>SATGRPENTRY28981</sat:SatGroupEntryId>

                   </wsa:ReferenceProperties>

               </wsa:EndpointReference>

           </wssg:ServiceGroupEntryEPR>

           <wssg:MemberServiceEPR>

               <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                     xmlns:sat="http://example.org/satelliteSystem">

                   <wsa:Address>http://example.com/satellite</wsa:Address>

                   <wsa:ReferenceProperties>

                       <sat:SatelliteId>SAT9928</sat:SatelliteId>

                   </wsa:ReferenceProperties>

               </wsa:EndpointReference>

           </wssg:MemberServiceEPR>

           <wssg:Content>

               <sat:approvedBy>BossManBing</sat:approvedBy>

           </wssg:Content>

       </wssg:Entry>

       <wssg:Entry>

           <wssg:ServiceGroupEntryEPR>

               <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                     xmlns:sat="http://example.org/satelliteSystem">

                   <wsa:Address>http://example.com/satellite</wsa:Address>

                   <wsa:ReferenceProperties>

                       <sat:SatGroupEntryId>SATGRPENTRY29003</sat:SatGroupEntryId>

                   </wsa:ReferenceProperties>

               </wsa:EndpointReference>

           </wssg:ServiceGroupEntryEPR>

           <wssg:MemberServiceEPR>

               <wsa:EndpointReference  xmlns:wsa=http://www.w3.org/2005/02/addressing"

                     xmlns:sat="http://example.org/satelliteSystem">

                   <wsa:Address>http://example.com/satellite</wsa:Address>

                   <wsa:ReferenceProperties>

                       <sat:SatelliteId>SAT8557</sat:SatelliteId>

                   </wsa:ReferenceProperties>

               </wsa:EndpointReference>

           </wssg:MemberServiceEPR>

           <wssg:Content>

               <sat:approvedBy> BossManBing</sat:approvedBy>

           </wssg:Content>

       </wssg:Entry>

    </wssg:ServiceGroupRP>

    ServiceGroupEntryEPR 指向我們在前一節(ServiceGroupEntries)中看到的 ServiceGroupEntry 對象,而 MemberServiceEPR指向添加到ServiceGroup的實際服務或WS-ResourceContent 元素展示 ServiceGroupEntry 中的 Content 元素

    1.1.1.4    ServiceGroup資源屬性文檔中添加信息

    然而,回到我們的例子,我們還只創建了這個 ServiceGroup,所以需要添加所有這些信息,下面我們從 MembershipContentRules 開始。

     

    添加 MembershipContentRules

    一旦創建了 ServiceGroup,我們就可以添加一個或多個 MembershipContentRule。因為它們是 ServiceGroup 的資源屬性的一部分,所以我們利用 Insert 消息來添加:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

             xmlns:sat="http://example.org/satelliteSystem"

             xmlns:wsa="http://www.w3.org/2005/02/addressing"

          xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"

          xmlns:wssg=""http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>

    http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/SetResourceProperties

           </wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/satellite</wsa:To>

           <sat:SatGroupId>SATGRP3</sat:SatGroupId>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:SetResourceProperties  xmlns:satProp="http://example.com/satellite">

               <wsrp:Insert>

                  <wssg:MembershipContentRule  MemberInterface="sat:AuditedSatellitePortType" />

               </wsrp:Insert>

               <wsrp:Insert>

                  <wssg:MembershipContentRule  MemberInterface="sat:CounterPortType"

                        ContentElements="sat:audited" />

               </wsrp:Insert>

               <wsrp:Insert>

                  <wssg:MembershipContentRule  ContentElements="sat:approvedBy" />

               </wsrp:Insert>

           </wsrp:SetResourceProperties>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    這里,我們把消息發送到了 ServiceGroup WS-Resource,并添加了匹配我們在 ServiceGroup ResourceProperties 一節中看到過的規則的屬性。服務器返回一個確認更改的 SetResourcePropertiesResponse 消息:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

              xmlns:sat="http://example.org/satelliteSystem"

              xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>

    http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/SetResourcePropertiesResponse

           </wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/myClient</wsa:To>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:SetResourcePropertiesResponse></wsrp:SetResourcePropertiesResponse>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    現在 ServiceGroup 本身已經準備就緒,我們可以開始添加項了。

     

    添加新的項

    為了向 ServiceGroup 添加項,我們需要對服務或 WS-Resource 的端點引用。還需要任何相關 Content。例如,我們可以將人造衛星 SAT8557 添加到 ServiceGroup

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

             xmlns:sat="http://example.org/satelliteSystem"

             xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"

       xmlns:wssg=""http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>http://docs.oasis-open.org/wsrf/2004/06/WS-ServiceGroup/Add</wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/satellite</wsa:To>

           <sat:SatGroupId>SATGRP3</sat:SatGroupId>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wssg:Add>

              <wssg:MemberEPR>

                   <wsa:Address>http://example.com/satellite</wsa:Address>

                   <wsa:ReferenceProperties>

                       <sat:SatelliteId>SAT8557</sat:SatelliteId>

                   </wsa:ReferenceProperties>

              </wssg:MemberEPR>

              <wssg:Content>

                  <sat:approvedBy>BossManBing</sat:approvedBy>

              </wssg:Content>

           </wssg:Add>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    這里,我們指定了對服務的端點引用和任何所需的 Content。您也可以添加 InitialTerminationTime 元素,為生成的 ServiceGroupEntry 指定一個 TerminationTime

    在響應中,服務器發送對新 ServiceGroupEntry 的端點引用

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

              xmlns:sat="http://example.org/satelliteSystem"

              xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

    <wsa:Action>http://docs.oasis-open.org/wsrf/2004/06/WS-ServiceGroup/AddResponse</wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/myClient</wsa:To>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:AddResponse>

              </wsa:EndpointReference>

                   <wsa:Address>http://example.com/satellite</wsa:Address>

                   <wsa:ReferenceProperties>

                       <sat:SatGroupEntryId>SATGRPENTRY29003</sat:SatGroupEntryId>

                   </wsa:ReferenceProperties>

              </wsa:EndpointReference>

           </wsrp:AddResponse>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    我們可以添加任意多的資源,只要它們不違反任意一個 MembershipContentRule

    1.1.1.5    檢索ServiceGroupEntry

    至此,我們已經向 ServiceGroup 添加了 MembershipContentRule 和一個或多個項,所以資源屬性文檔跟 ServiceGroup Entry 元素 一節中的類似。現在我們來看檢索信息。

    例如,假設我們想要計數恒星的個數。ServiceGroup 包含大量我們可以使用的 WS-Resources。如果我們只需要其中之一,最簡單的方法是使用 GetResourceProperty 消息:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

           xmlns:sat="http://example.org/satelliteSystem"

           xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"

           xmlns:wssg="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>

               http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/GetResourceProperty

           </wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/satellite</wsa:To>

           <sat:SatGroupId>SATGRP3</sat:SatGroupId>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:GetResourceProperty>wssg:Entry</wsrp:GetResourceProperty>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

     

    響應包含一個 Entry 元素:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

            xmlns:sat="http://example.org/satelliteSystem"

            xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>

    http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/GetResourcePropertyResponse

           </wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/myClient</wsa:To>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:GetResourcePropertyResponse>

             <wssg:Entry>

                 <wssg:ServiceGroupEntryEPR>

                     <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                           xmlns:sat="http://example.org/satelliteSystem">

                         <wsa:Address>http://example.com/satellite</wsa:Address>

                         <wsa:ReferenceProperties>

                             <sat:SatGroupEntryId>SATGRPENTRY28981</sat:SatGroupEntryId>

                         </wsa:ReferenceProperties>

                     </wsa:EndpointReference>

                 </wssg:ServiceGroupEntryEPR>

                 <wssg:MemberServiceEPR>

                     <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/02/addressing"

                           xmlns:sat="http://example.org/satelliteSystem">

                         <wsa:Address>http://example.com/satellite</wsa:Address>

                         <wsa:ReferenceProperties>

                             <sat:SatelliteId>SAT9928</sat:SatelliteId>

                         </wsa:ReferenceProperties>

                     </wsa:EndpointReference>

                 </wssg:MemberServiceEPR>

                 <wssg:Content>

                     <sat:approvedBy>BossManBing</sat:approvedBy>

                 </wssg:Content>

              </wssg:Entry>

           </wsrp:GetResourcePropertyResponse>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    該元素包含 MemberServiceEPR,而后者是對服務或 WS-Resource 的端點引用。一旦有了該引用,我們就可以像第1部分中那樣使用服務或 WS-Resource 不管是從CreateResponse還是 GetResourcePropertyResponse 收到端點引用,之間沒有什么區別。我們有了一個端點引用,所以可以使用它所代表的服務或 WS-Resource 了。

     

    檢索多個項

    1 部分 中,我們使用了 QueryResourceProperties 消息來查詢屬性,但是我們也可以使用它來檢索多個具有相同名稱的屬性。例如,我們可以檢索 ServiceGroup 的所有 Entry 元素:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

            xmlns:sat="http://example.org/satelliteSystem"

            xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"

            xmlns:wssg="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>

               http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/QueryResourceProperties

           </wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/satellite</wsa:To>

           <sat:SatGroupId>SATGRP3</sat:SatGroupId>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:QueryResourceProperties>

              <wsrp:QueryExpression Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">

                  /*/Entry

              </wsrp:QueryExpression>

           </wsrp:QueryResourceProperties>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

     

    響應包含所有的 Entry 屬性:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

            xmlns:sat="http://example.org/satelliteSystem"

            xmlns:wsa="http://www.w3.org/2005/02/addressing"

    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"

            xmlns:wssg="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ServiceGroup-1.2-draft-01.xsd">

        <SOAP-ENV:Header>

           <wsa:Action>

    http://docs.oasis-open.org/wsrf/2004/06/WS-ResourceProperties/QueryResourcePropertiesResponse

           </wsa:Action>

           <wsa:To SOAP-ENV:mustUnderstand="1">http://example.com/myClient</wsa:To>

        </SOAP-ENV:Header>

        <SOAP-ENV:Body>

           <wsrp:GetResourcePropertyResponse>

             <wssg:Entry>

                 <wssg:ServiceGroupEntryEPR>

                     <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                           xmlns:sat="http://example.org/satelliteSystem">

                         <wsa:Address>http://example.com/satellite</wsa:Address>

                         <wsa:ReferenceProperties>

                             <sat:SatGroupEntryId>SATGRPENTRY28981</sat:SatGroupEntryId>

                         </wsa:ReferenceProperties>

                     </wsa:EndpointReference>

                 </wssg:ServiceGroupEntryEPR>

                 <wssg:MemberServiceEPR>

                     <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                           xmlns:sat="http://example.org/satelliteSystem">

                         <wsa:Address>http://example.com/satellite</wsa:Address>

                         <wsa:ReferenceProperties>

                             <sat:SatelliteId>SAT9928</sat:SatelliteId>

                         </wsa:ReferenceProperties>

                     </wsa:EndpointReference>

                 </wssg:MemberServiceEPR>

                 <wssg:Content>

                     <sat:approvedBy>BossManBing</sat:approvedBy>

                 </wssg:Content>

             </wssg:Entry>

             <wssg:Entry>

                 <wssg:ServiceGroupEntryEPR>

                     <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                           xmlns:sat="http://example.org/satelliteSystem">

                         <wsa:Address>http://example.com/satellite</wsa:Address>

                         <wsa:ReferenceProperties>

                             <sat:SatGroupEntryId>SATGRPENTRY29003</sat:SatGroupEntryId>

                         </wsa:ReferenceProperties>

                     </wsa:EndpointReference>

                 </wssg:ServiceGroupEntryEPR>

                 <wssg:MemberServiceEPR>

                     <wsa:EndpointReference  xmlns:wsa="http://www.w3.org/2005/02/addressing"

                           xmlns:sat="http://example.org/satelliteSystem">

                         <wsa:Address>http://example.com/satellite</wsa:Address>

                         <wsa:ReferenceProperties>

                             <sat:SatelliteId>SAT8557</sat:SatelliteId>

                         </wsa:ReferenceProperties>

                     </wsa:EndpointReference>

                 </wssg:MemberServiceEPR>

                 <wssg:Content>

                     <sat:approvedBy>BossManBing</sat:approvedBy>

                 </wssg:Content>

              </wssg:Entry>

           </wsrp:QueryResourcePropertiesResponse>

        </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

    我們也可以使用 XPath 表達式來限制檢索的 Entry。例如,我們可以只檢索具有 audited 元素的項。一旦有了響應,我們可以使用客戶機應用程序來查找每一個 Entry 并使用由每個 MemberServiceEPR 表示的服務

    刪除 ServiceGroupEntries ServiceGroups

    我們已經向 ServiceGroup 添加了一個服務,但是該如何刪除它呢?答案在于 ServiceGroupEntry 以及它是 WS-Resource 這樣一個事實。要從 ServiceGroup 刪除服務,只要檢索對 ServiceGroupEntry 的端點引用,并使用該引用來發送 Destroy 消息即可。在這種情況下,您只是破壞了資源和組之間的鏈接如果您銷毀資源,就應該也銷毀指向該資源的任何 ServiceGroupEntry 對象

    類似地,如果您銷毀 ServiceGroup,就應該也銷毀它包含的所有 ServiceGroupEntry 資源。



    Author: orangelizq
    email: orangelizq@163.com

    歡迎大家訪問我的個人網站 萌萌的IT人
    posted on 2009-07-19 15:51 桔子汁 閱讀(388) 評論(0)  編輯  收藏 所屬分類: Web Service
    主站蜘蛛池模板: 国产精品亚洲片在线va| 国产成人精品亚洲精品| 久久久久亚洲精品无码蜜桃| 又粗又长又爽又长黄免费视频| 麻豆国产入口在线观看免费| 亚洲国产最大av| 女人18毛片免费观看| 亚洲人av高清无码| 成人毛片视频免费网站观看| 亚洲另类春色校园小说| 9久9久女女免费精品视频在线观看| 666精品国产精品亚洲 | 美女视频黄免费亚洲| 亚洲精品视频观看| 57PAO成人国产永久免费视频| 色老板亚洲视频免在线观| 成人啪精品视频免费网站| 久久亚洲AV成人无码国产电影| 亚洲精品国产成人影院| 你懂的在线免费观看| 亚洲国产人成网站在线电影动漫| 91精品成人免费国产片| 亚洲熟妇无码AV| 久久精品国产精品亚洲艾草网美妙| 国产中文字幕在线免费观看| 亚洲酒色1314狠狠做| 在线观看人成视频免费| 免费一级毛片在线播放放视频| 亚洲综合网站色欲色欲| 最近2019中文字幕免费直播| 亚洲一区二区观看播放| 亚洲精品老司机在线观看| 暖暖免费在线中文日本| 中国亚洲呦女专区| 久久亚洲av无码精品浪潮| 亚洲一区免费在线观看| 久久亚洲精品11p| 亚洲成a人片在线观看中文动漫| 欧美男同gv免费网站观看| 一级毛片**免费看试看20分钟| 亚洲色图综合网站|