EQUIVALENTES CARPETAS DE
2.2.2.3 Aplicación del Método Racional Desarrollada por el LNEC.
Because WS-Transfer works with entire instances and it may be inconvenient to specify hundreds or thousands of EPRs just to model property-level access with full EPRs, WS- Management supports the concept of fragment-level (property) access of resources that are normally accessed via WS-Transfer operations. This is done using special usage of WS- Transfer.
Because of the XML schema limitations discussed in 4.7, it is often incorrect to simply return a subset of the XML defined for the object being accessed, as a subset may violate the XML schema for that fragment. In order to support transfer of fragments or individual elements of a representation object, several modifications to the basic WS-Transfer operations are made.
R4.9-1 A conformant service is NOT REQUIRED to support Property-Level WS- Transfer. The service MUST NOT behave as if normal WS-Transfer operations were in place, but MUST operate exclusively on the fragments specified. If the service does not support fragment-level access, it MUST return a wsman:UnsupportedFeature fault with a detail code of
wsman:FragmentLevelAccess.
R4.9-2 A conformant service which supports fragment-levell WS-Transfer MUST accept the following SOAP header in all requests and include it in all responses which transport the fragments:
(1)<wsman:FragmentTransfer mustUnderstand="true"> (2) xpath to fragment
(3)</wsman:FragmentTransfer>
This header may only appear once and mustUnderstand MUST be set to true, as a special XML usage is in progress. In this manner, both the service and the client can be certain that a special mode of transfer is in progress. The default value of this header is the XPath 1.0 Selector of the fragment being tranferred (using http://www.w3.org/TR/1999/REC-xpath- 19991116), with relation to the full representation of the object. If a value other than XPath 1.0 is being used, a Dialect attribute may be added to indicate this: (4)<wsman:FragmentTransfer mustUnderstand="true" (5) Dialect="URIToNewSelectorDialect"> (6) dialect text (7)</wsman:FragmentTransfer>
Note that XPath is special-cased due to its importance, but it is not mandated. Any other type of language to describe fragment-level access is permitted as long as the Dialect value is set to indicate to the service what dialect is being used.
Note that an XPath value may refer to the entire node, so the concept of a fragment can include the entire object, so fragment-level WS-Transfer is a proper superset of normal WS- Transfer.
R4.9-3 All transfer in either direction of the XML fragments must be wrapped with a <wsman:XmlFragment> wrapper which contains a definition which
suppresses validation and allows any content to pass. A service MUST reject any attempt to use wsman:FragmentTransfer unless the s:Body wraps the content using a wsman:XmlFragment wrapper. If any other usage is encountered, the service MUST fault the request using a wxf:InvalidRepresentation fault with a detail code of
wsman:faultDetail/InvalidFragment.
Fragment transfer may occur at any level, single element, complex elements, simple values, and attributes. In practice, services will only typically support value-level access to
elements:
R4.9-4 If fragment-level WS-Transfer is suported, a conformant service SHOULD at least support leaf-node value-level access using an XPath with a /Text( )
specifier. In this case, the value is not wrapped with XML, but is transferred directly as text within the wsman:XmlFragment wrapper.
In essence, the content which is transferred is whatever an XPath operation over the full XML would produce.
R4.9-5 For all fragment-level operations, partial successes are NOT permitted. The entire meaning of the XPath or other dialect MUST be fully observed by the service in all operations and the entire fragment that is specified MUST be successfully transferred in either direction. Otherwise, faults occur as if none of the operation had succeeded.
All faults are as for normal, "full" WS-Transfer operations.
The following sections show how the underlying WS-Transfer operations change when transferring XML fragments.
4.10
Fragment-Level WS-Transfer:Get
Fragment-level gets are as for full wxf:Get, except for the wsman:FragmentTransfer header (line 24). This example is drawn from the example in 4.2:
(1)<s:Envelope (2) xmlns:s="http://www.w3.org/2003/05/soap-envelope" (3) xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" (4) xmlns:wsman="http://schemas.xmlsoap.org/ws/2005/02/management"> (5) <s:Header> (6) <wsa:To> (7) http://1.2.3.4/wsman?ResourceURI=(wsman:samples.org/2005/02/physicalDisk) (8) </wsa:To> (9) <wsa:ReplyTo> (10) <wsa:Address> (11) http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous (12) </wsa:Address> (13) </wsa:ReplyTo> (14) <wsa:Action> (15) http://schemas.xmlsoap.org/ws/2004/09/transfer/Get (16) </wsa:Action> (17) <wsa:MessageID> (18) uuid:d9726315-bc91-430b-9ed8-ce5ffb858a87 (19) </wsa:MessageID> (20) <wsman:SelectorSet>
(21) <wsman:Selector Name="LUN"> 2 </wsman:Selector> (22) </wsman:SelectorSet> (23) <wsman:OperationTimeout> PT30S </wsman:OperationTimeout> (24) <wsman:FragmentTransfer mustUnderstand="true"> (25) PhysicalDisk/Manufacturer (26) </wsman:FragmentTransfer> (27) </s:Header> (28) <s:Body/> (29) </s:Envelope>
would normally have been retrieved, and then return a fragment instead.
Note that the wsman:FragmentTransfer MUST be repeated in the wxf:GetResponse (line 47-49) by the service to reference the fragment and to signal that a fragment has been transferred, and that the response is wrapped in a wsman:XmlFragment wrapper, which suppresses the schema validation which would otherwise apply:
(30) <s:Envelope (31) xmlns:s="http://www.w3.org/2003/05/soap-envelope" (32) xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" (33) xmlns:wsman="http://schemas.xmlsoap.org/ws/2005/02/management"> (34) <s:Header> (35) <wsa:To> (36) http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous (37) </wsa:To> (38) <wsa:Action s:mustUnderstand="true"> (39) http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse (40) </wsa:Action> (41) <wsa:MessageID s:mustUnderstand="true"> (42) uuid:d9726315-bc91-430b-9ed8-ce5ffb858a88 (43) </wsa:MessageID> (44) <wsa:RelatesTo> (45) uuid:d9726315-bc91-430b-9ed8-ce5ffb858a87 (46) </wsa:RelatesTo> (47) <wsman:FragmentTransfer mustUnderstand="true"> (48) PhysicalDisk/Manufacturer (49) </wsman:FragmentTransfer> (50) </s:Header> (51) <s:Body> (52) <wsman:XmlFragment>
(53) <Manufacturer> Acme, Inc. </Manufacturer> (54) </wsman:XmlFragment>
(55) </s:Body>
(56) </s:Envelope>
The output (lines 52-54) is that that would be supplied by a typical XPath processor and may or may not contain XML namespace information or attributes.
If the client wishes to recieve the value in isolation without an XML wrapper, XPath
techniques, such as using the Text() operator can be used to retrieve just the values. The following request
(57) <wsman:FragmentTransfer mustUnderstand="true"> (58) PhysicalDisk/Manufacturer/Text()
(59) </wsman:FragmentTransfer>
...which will yield this XML: (60) <wsman:XmlFragment>
(61) Acme, Inc.