- From: Arthur Ryman via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 16 Jun 2005 01:29:45 +0000
- To: public-ws-desc-eds@w3.org
Update of /sources/public/2002/ws/desc/wsdl20 In directory hutz:/tmp/cvs-serv20980/wsdl20 Modified Files: wsdl20-primer.xml Log Message: Fixed my "Comments on Primer Sections 4 - 6.5". Revert to tag before-removing-transitive-2005-06-15 if you don't like these changes. Index: wsdl20-primer.xml =================================================================== RCS file: /sources/public/2002/ws/desc/wsdl20/wsdl20-primer.xml,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** wsdl20-primer.xml 16 Jun 2005 00:34:46 -0000 1.96 --- wsdl20-primer.xml 16 Jun 2005 01:29:43 -0000 1.97 *************** *** 675,680 **** One way is to inline schema definitions within <code>xs:schema</code> elements that are children of <code>types</code>, as we have already seen. The other way is to use <code>xs:import</code> directly under <code>types</code>. It is perfectly reasonable to use both ways in one WSDL 2.0 document.</p> ! <p>A WSDL 2.0 <code>description</code> must NOT refer to XML Schema components that are neither imported nor ! inlined into that WSDL 2.0 <code>description</code>. In other words, the use of <code>xs:import</code> and/or <code>xs:schema</code> is a necessary condition for making XML Schema components available to a WSDL 2.0 Description component. </p> <p>The following XML syntax for the <code>types</code> element illustrates the use of <code>xs:import</code> and <code>xs:schema</code>:</p> --- 675,691 ---- One way is to inline schema definitions within <code>xs:schema</code> elements that are children of <code>types</code>, as we have already seen. The other way is to use <code>xs:import</code> directly under <code>types</code>. It is perfectly reasonable to use both ways in one WSDL 2.0 document.</p> ! <p> ! A WSDL 2.0 ! <code>description</code> ! may only refer to XML Schema components that are either ! imported nor inlined into that WSDL 2.0 ! <code>description</code>. In other words, the use of ! <code>xs:import</code> ! and/or ! <code>xs:schema</code> ! is a necessary condition for making XML Schema ! components available to a WSDL 2.0 Description ! component. ! </p> <p>The following XML syntax for the <code>types</code> element illustrates the use of <code>xs:import</code> and <code>xs:schema</code>:</p> *************** *** 713,721 **** ! <p>The <code>xs:import</code> mechanism is not transitive. Only components defined in the imported schema itself and components the schema includes via <code>xs:include</code> are available to the containing WSDL 2.0 document. Specifically, components that the schema imports via <code>xs:import</code> are NOT available to WSDL 2.0. </p> ! ! <ednote><name>dbooth</name><date>2005-04-13</date><edtext>Check this. An issue was recently raised about import not being transitive.</edtext></ednote> ! ! <p>Here is an example of importing a schema. Assuming the message types in <specref ref="example-initial-types"/> are defined in a separate schema file named "http://greath.example.com/2004/schemas/resSvc.xsd" with a target namespace "http://greath.example.com/2004/schemas/resSvc", the schema definition can then be imported into the WSDL 2.0 as follows: </p> <example id="example-schema-import"> --- 724,739 ---- ! <p> ! Within the <el>types</el> element, the type components defined in any ! XML Schema namespaces that are imported ! via <el>xs:import</el> elements and any type components defined via <el>xs:schema</el> elements ! are available to the WSDL 2.0 components defined in the containing WSDL 2.0 documents. ! The type components defined in <el>xs:schema</el> elements may by introduced via <el>xs:include</el> ! elements. ! However, the XML Schema namespaces declared via <el>xs:import</el> elements within ! <el>xs:schema</el> elements do not become available to the WSDL 2.0 components defined in the ! containing WSDL 2.0 document. ! </p> ! <p>Here is an example of importing a schema. Assuming the message types in <specref ref="example-initial-types"/> are defined in a separate schema file named "http://greath.example.com/2004/schemas/resSvc.xsd" with a target namespace "http://greath.example.com/2004/schemas/resSvc", the schema definition can then be imported into the WSDL 2.0 as follows: </p> <example id="example-schema-import"> *************** *** 742,749 **** id="more-types-import-include-summary"><head>Summary of Import and Include Mechanisms</head> <p>The following table summarizes the similarities and differences ! between the <code>wsdl:</code> and <code>xs:</code> ! <code>include</code> and <code>import</code> mechanisms.</p> ! <table border="1" id='imin'><caption>Summary of Import and Include Mechanisms</caption><thead><tr><th>Mechanism</th><th>Imported/Included Document Type</th><th>Meaning</th><th>Transitive?</th></tr></thead><tbody><tr><td>wsdl:import</td><td>WSDL 2.0 document</td><td>Merge Interface, Binding and Service components from another WSDL 2.0 document that has a DIFFERENT targetNamespace. (Schema type and element declarations are NOT merged.)</td><td>No</td></tr><tr><td>wsdl:include</td><td>WSDL 2.0 document</td><td>Merge Interface, Binding and Service components from another WSDL 2.0 document that has the SAME targetNamespace. (Schema type and element declarations are NOT merged.)</td><td>Yes</td></tr><tr><td>xs::import</td><td>XML Schema document</td><td>Merge type and element declarations from another XML Schema document that has a DIFFERENT targetNamespace.</td><td>No</td></tr><tr><td>xs:import</td><td>XML Schema document</td><td>Merge type and element declarations from another XML Schema document that has te SAME targetNamespace.</td><td>Yes</td></tr></tbody></table> ! <p>More advanced topics on importing schemas are discussed in <specref ref="adv-multiple-inline-schemas"/></p> </div2> --- 760,816 ---- id="more-types-import-include-summary"><head>Summary of Import and Include Mechanisms</head> <p>The following table summarizes the similarities and differences ! between the WSDL 2.0 and XML Schema ! <el>include</el> and <el>import</el> mechanisms.</p> ! <table border="1" id='imin'> ! <caption> ! Summary of Import and Include Mechanisms ! </caption> ! <thead> ! <tr> ! <th>Mechanism</th> ! <th>Object</th> ! <th>Meaning</th> ! </tr> ! </thead> ! <tbody> ! <tr> ! <td>wsdl:import</td> ! <td>WSDL 2.0 Namespace</td> ! <td> ! Declare that WSDL 2.0 components ! refer to WSDL 2.0 components ! from a DIFFERENT targetNamespace. ! </td> ! </tr> ! <tr> ! <td>wsdl:include</td> ! <td>WSDL 2.0 Document</td> ! <td> ! Merge Interface, Binding and Service ! components from another WSDL 2.0 document ! that has the SAME targetNamespace. ! </td> ! </tr> ! <tr> ! <td>xs:import</td> ! <td>XML Schema Namespace</td> ! <td> ! Declare that XML Schema components ! refer to XML Schema components ! from a DIFFERENT targetNamespace. ! </td> ! </tr> ! <tr> ! <td>xs:include</td> ! <td>XML Schema Document</td> ! <td> ! Merge XML Schema components from ! another XML Schema document that has the ! SAME targetNamespace. ! </td> ! </tr> ! </tbody> ! </table> ! <p>More advanced topics on importing schemas are discussed in <specref ref="adv-multiple-inline-schemas"/></p> </div2> *************** *** 773,777 **** <fault name="<emph>xs:NCName</emph>" ! element="<emph>xs:QName</emph>"? > </fault>* --- 840,844 ---- <fault name="<emph>xs:NCName</emph>" ! element="<emph>xs:QName</emph>"? > </fault>* *************** *** 782,790 **** <input messageLabel="<emph>xs:NCName</emph>"? ! element="<emph>union of xs:QName, xs:Token</emph>"? > </input>* <output messageLabel="<emph>xs:NCName</emph>"? ! element="<emph>union of xs:QName, xs:Token</emph>"? > </output>* --- 849,857 ---- <input messageLabel="<emph>xs:NCName</emph>"? ! element="<emph>union of xs:QName, xs:Token</emph>"? > </input>* <output messageLabel="<emph>xs:NCName</emph>"? ! element="<emph>union of xs:QName, xs:Token</emph>"? > </output>* *************** *** 807,813 **** <div2 id="more-interfaces-inheritance"> <head>Interface Inheritance</head> ! <p>The optional <att>extends</att> attribute allows an interface to extend or inherit from one or more other interfaces. In such cases the interface contains the operations of the interfaces it extends, along with any operations it defines directly. Two things about extending interfaces deserve some attention. </p><p>First, an inheritance loop (or infinite recursion) is prohibited: the interfaces that a given interface extends must NOT themselves extend that interface either directly or indirectly. </p><p>Second, we must explain what happens when operations from two different interfaces have the same target namespace and operation name. There are two cases: either the component models of the operations are the same, or they are different. If the component models are the same (per the component comparison algorithm defined in WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> "<xspecref href="&w3c-designation-part1;#compequiv">Equivalence of Components</xspecref>") then they are considered to be the same peration, i.e., they are collapsed into a single operation, and the fact that they were included more than once is not considered an error. (For operations, component equivalence basically means that the two operations have the same set of attributes and descendents.) In the second case, if two operations have the same name in the same WSDL 2.0 target namespace but are not equivalent, then it is an error. For the above reason, it is considered good practice to ensure that all operations within the same target namespace are named uniquely. </p><p>Finally, since faults, features and properties can also be defined as children of the <code>interface</code> element (as described in the following sections), the same name-collision rules apply to those constructs. </p> ! ! <p>Let's say the GreatH hotel wants to maintain a a standard message log operation for all received messages. It wants this operation to be reusable across the whole reservation system, so each service will send out, for potential use of a logging service, the content of each message it receives together with a timestamp and the originator of the message. One way to meet such requirement is to define the log operation in an interface which can be inherited by other interfaces. Assuming a <code>messageLog</code> element is already defined in the ghns namespace with the required content, the inheritance use case is illustrated in the following example. As a result of the inheritance, the <code>reservationInterface</code> now contains two operations: <code>opCheckAvailability</code> and <code>opLogMessage</code></p> --- 874,930 ---- <div2 id="more-interfaces-inheritance"> <head>Interface Inheritance</head> ! <p> ! The optional ! <att>extends</att> ! attribute allows an interface to extend or inherit ! from one or more other interfaces. In such cases the ! interface contains the operations of the interfaces ! it extends, along with any operations it defines ! directly. Two things about extending interfaces ! deserve some attention. ! </p> ! <p> ! First, an inheritance loop (or infinite recursion) ! is prohibited: the interfaces that a given interface ! extends must NOT themselves extend that interface ! either directly or indirectly. ! </p> ! <p> ! Second, we must explain what happens when operations ! from two different interfaces have the same target ! namespace and operation name. There are two cases: ! either the component models of the operations are ! the same, or they are different. If the component ! models are the same (per the component comparison ! algorithm defined in WSDL 2.0 Part 1 ! <bibref ref="WSDL-PART1" /> ! " ! <xspecref ! href="&w3c-designation-part1;#compequiv"> ! Equivalence of Components ! </xspecref> ! ") then they are considered to be the same ! operation, i.e., they are collapsed into a single ! operation, and the fact that they were included more ! than once is not considered an error. (For ! operations, component equivalence basically means ! that the two operations have the same set of ! attributes and descendents.) In the second case, if ! two operations have the same name in the same WSDL ! 2.0 target namespace but are not equivalent, then it ! is an error. For the above reason, it is considered ! good practice to ensure that all operations within ! the same target namespace are named uniquely. ! </p> ! <p> ! Finally, since faults can ! also be defined as children of the ! <code>interface</code> ! element (as described in the following sections), ! the same name-collision rules apply to those ! constructs. ! </p> ! ! <p>Let's say the GreatH hotel wants to maintain a a standard message log operation for all received messages. It wants this operation to be reusable across the whole reservation system, so each service will send out, for potential use of a logging service, the content of each message it receives together with a timestamp and the originator of the message. One way to meet such requirement is to define the log operation in an interface which can be inherited by other interfaces. Assuming a <code>messageLog</code> element is already defined in the ghns namespace with the required content, the inheritance use case is illustrated in the following example. As a result of the inheritance, the <code>reservationInterface</code> now contains two operations: <code>opCheckAvailability</code> and <code>opLogMessage</code></p> *************** *** 867,871 **** them, thereby ensuring consistency across all operations that use the faults </p> ! <p>The <code>fault</code> element has a required <att>name</att> attribute that must be unique within the WSDL 2.0 document's target namespace, and permits it to be referenced from operation declarations. The optional <att>element</att> attribute can be used to indicate a schema for the content or payload of the fault message. Its value should be the QName of a global element defined in the <code>types</code> section. Please note that when other type systems are used to define the schema for a fault message, additional attributes may need to be defined via WSDL 2.0's attribute extension mechanism to allow the schema to be associated with the fault.</p> --- 984,1006 ---- them, thereby ensuring consistency across all operations that use the faults </p> ! <p> ! The ! <el>fault</el> ! element has a required ! <att>name</att> ! attribute that must be unique within the parent <el>interface</el> element, and permits it to be ! referenced from operation declarations. The optional ! <att>element</att> ! attribute can be used to indicate a schema for the ! content or payload of the fault message. Its value ! should be the QName of a global element defined in ! the ! <code>types</code> ! section. Please note that when other type systems ! are used to define the schema for a fault message, ! additional attributes may need to be defined via ! WSDL 2.0's attribute extension mechanism to allow ! the schema to be associated with the fault. ! </p> *************** *** 899,907 **** </item> - <item> - <p>An optional <att>safe</att> attribute whose value is a boolean indicating whether the operation is asserted to be "safe" (as defined in Section 3.5 of the Web Architecture <bibref ref="webarch"/>) for clients to invoke. In essence, a safe operation is any operation that does not give the client any new obligations. For example, an operation that permits the client to check prices on products typically would not obligate the client to buy those products, and thus would be safe, whereas an operation for purchasing products would obligate the client to pay for the products that were ordered, and thus would not be safe. </p><p>An operation should be marked safe (by setting the <att>safe</att> to true) if it meets the criteria for a safe interaction defined in Section 3.5 of the Web Architecture <bibref ref="webarch"/>, because this permits the infrastructure to perform efficiency optimizations, such as pre-fetch, re-fetch and caching. </p><p>The default value of this attribute is false. If it isfalse or is not set, then no assertion is made about the safety of the operation; thus the operation may or may NOT be safe.</p> - </item> </ulist></div3><div3><head>Operation Message References</head><p>An <code>operation</code> will also have <code>input</code>, <code>output</code>,<code>infault</code>, and/or <code>outfault</code> element children that specify the ordinary and fault message types to be used by that operation. The MEP specified by the <code>pattern</code> attribute determines which of these elements should be included, since each MEP has placeholders for the message types involved in its pattern. </p><p>Since operations were already discussed in <specref ref="basics-interface"/>, this section will merely comment on additional capabilities that were not previously explained.</p> ! <div4><head>The messageLabel Attribute</head><p>The <att>messageLabel</att> attribute of the <code>input</code> and <code>output</code> elements is optional. It is not necessary to explicitly set the <code>messageLabel</code> when the MEP in use is one of the eight MEPs predefined in WSDL 2.0 Part 2 <bibref ref="WSDL-PART2"/> and it has only one message with a given direction. </p></div4><div4><head>The element Attribute</head><p>The <att>element</att> attribute of the <code>input</code> and <code>output</code> elements is used to specify the message content schema (aka payload schema) when the content model is defined using XML Schema. As we have seen already, it can specify the QName of an element schema that was defined in the <code>types</code> section. However, alternatively it can specify one of the following tokens: <glist><gitem><label><code>#any</code></label><def><p>The message content is any single element.</p></def></gitem><gitem><label><code>#none</code></label><def><p>There is no messge content, i.e., the message payload is empty.</p></def></gitem></glist>The <code>element</code> attribute is also optional. If it is not specified, then @@@@. <ednote><edtext>ToDo: Say what happens if the element attribute is not specified, after issue LC99 is resolved. See http://www.w3.org/2002/ws/desc/4/lc-issues/issues.html#LC99 </edtext></ednote></p></div4><div4><head>Multiple infault or outfault Elements</head><p>When <code>infault</code> and/or <code>outfault</code> occur multiple times within an <code>operation</code>, they define alternative fault messages. </p></div4></div3> <!-- ************************MEPs*************************** --> --- 1034,1117 ---- </item> </ulist></div3><div3><head>Operation Message References</head><p>An <code>operation</code> will also have <code>input</code>, <code>output</code>,<code>infault</code>, and/or <code>outfault</code> element children that specify the ordinary and fault message types to be used by that operation. The MEP specified by the <code>pattern</code> attribute determines which of these elements should be included, since each MEP has placeholders for the message types involved in its pattern. </p><p>Since operations were already discussed in <specref ref="basics-interface"/>, this section will merely comment on additional capabilities that were not previously explained.</p> ! <div4> ! <head>The messageLabel Attribute</head> ! <p> ! The ! <att>messageLabel</att> ! attribute of the ! <code>input</code> ! and ! <code>output</code> ! elements is optional. It is not necessary to ! explicitly set the ! <code>messageLabel</code> ! when the MEP in use is one of the eight MEPs ! predefined in WSDL 2.0 Part 2 ! <bibref ref="WSDL-PART2" /> ! and it has only one message with a given ! direction. ! </p> ! </div4> ! <div4> ! <head>The element Attribute</head> ! <p> ! The ! <att>element</att> ! attribute of the ! <code>input</code> ! and ! <code>output</code> ! elements is used to specify the message content ! schema (aka payload schema) when the content ! model is defined using XML Schema. As we have ! seen already, it can specify the QName of an ! element schema that was defined in the ! <code>types</code> ! section. However, alternatively it can specify ! one of the following tokens: ! <glist> ! <gitem> ! <label> ! <code>#any</code> ! </label> ! <def> ! <p> ! The message content is any ! single element. ! </p> ! </def> ! </gitem> ! <gitem> ! <label> ! <code>#none</code> ! </label> ! <def> ! <p> ! There is no message content, ! i.e., the message payload is ! empty. ! </p> ! </def> ! </gitem> ! <gitem> ! <label> ! <code>#other</code> ! </label> ! <def> ! <p> ! The message content is described by a non-XML type system. ! Extension attributes specify the type. ! </p> ! </def> ! </gitem> ! </glist> ! The ! <code>element</code> ! attribute is also optional. If it is not ! specified, then #other. ! </p> ! </div4> ! <div4><head>Multiple infault or outfault Elements</head><p>When <code>infault</code> and/or <code>outfault</code> occur multiple times within an <code>operation</code>, they define alternative fault messages. </p></div4></div3> <!-- ************************MEPs*************************** --> *************** *** 967,970 **** --- 1177,1182 ---- <input messageLabel="<emph>xs:NCName</emph>"? > </input>* <output messageLabel="<emph>xs:NCName</emph>"? > </output>* + <infault ref="<emph>xs:QName</emph>" messageLabel="<emph>xs:NCName</emph>"? > </infault>* + <outfault ref="<emph>xs:QName</emph>" messageLabel="<emph>xs:NCName</emph>"? > </outfault>* </operation>*
Received on Thursday, 16 June 2005 01:29:57 UTC