W3C home > Mailing lists > Public > public-ws-desc-eds@w3.org > May 2005

2002/ws/desc/wsdl20 wsdl20-primer.xml,1.86,1.87

From: Hugo Haas via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 11 May 2005 03:32:00 +0000
To: public-ws-desc-eds@w3.org
Message-Id: <20050511033200.732DA4F02B@homer.w3.org>

Update of /sources/public/2002/ws/desc/wsdl20
In directory homer:/tmp/cvs-serv8381

Modified Files:
	wsdl20-primer.xml 
Log Message:
Fixed links: using &w3c-designation-part?;


Index: wsdl20-primer.xml
===================================================================
RCS file: /sources/public/2002/ws/desc/wsdl20/wsdl20-primer.xml,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** wsdl20-primer.xml	11 May 2005 03:08:58 -0000	1.86
--- wsdl20-primer.xml	11 May 2005 03:31:58 -0000	1.87
***************
*** 259,265 ****
  				</example><div3 id="example-initial-types-explanation"><head>Explanation of Example</head><glist><gitem><label><code>xmlns:ghns = "http://greath.example.com/2004/schemas/resSvc"</code></label><def><p>We've added another namespace declaration.  The <code>ghns</code> namespace prefix will allow us (later, when defining an interface) to reference the XML Schema target namespace that we define for our message types.  Thus, the URI we specify must be the same as the URI  that we define as the target namespace of our XML Schema types (below) -- <emph>not</emph> the target namespace of the WSDL document itself.</p></def></gitem><gitem><label><code>targetNamespace="http://greath.example.com/2004/schemas/resSvc"</code></label><def><p>This is the XML Schema target namespace that we've created for  use by the GreatH reservation service.  The <code>checkAvailability</code>, <code>checkAvailabilityResponse</code> and <code>invalidDataError</code> element names will be associated with this XML Schema target namespae.</p></def></gitem><gitem><label><code>checkAvailability</code>, <code>checkAvailabilityResponse</code> and <code>invalidDataError</code></label><def><p>These are the message types that we'll use.  Note that these are defined to be XML <emph>elements</emph>, as explained above.</p></def></gitem></glist><p>Although we have defined several types, we have not yet indicated which ones are to be used as message types for a Web service.  We'll do that in the next section.  </p></div3></div2>
  				
! 				<div2 id="basics-interface"><head>Defining an Interface</head><p>WSDL 2.0 enables one to separate the description of a Web service's abstract functionality from the concrete details of how and where that functionality is offered.    This separation facilitates different levels of reusability and distribution of work in the lifecycle of a Web service and the WSDL document that describes it. </p><p>A WSDL 2.0 <code>interface</code> defines the abstract interface of a Web service as a set of abstract <emph>operations</emph>, each operation representing a simple interaction between the client and the service.  Each operation specifies the types of messages that the service can send or receive as part of that operation.  Each operation also specifies a message exchange <emph>pattern</emph> that indicates the sequence in which the associated messages are to be transmitted between the parties.   For example, the <emph>in-out</emph> pattern (see <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PAT2"/> section  2.2.3 <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">In-Out</xspecref>) indicates that if the client sends a message <emph>in</emph> to the service, the service will either send a reply message back <emph>out</emph> to the client (in the normal case) or it will send a fault message back to the client (in the case of an error). We will explain more about message exchange <emph>pattern</emph>s in <specref ref = "more-interfaces-meps"/></p>
  				
! 				<p>For the GreatH service, we will (initially) define an interface containing a single operation, <code>opCheckAvailability</code>, using  the <code>checkAvailability</code> and <code>checkAvailabilityResponse</code> message types that we defined in the <code>types</code> section.   We'll use the <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">in-out</xspecref> pattern for this operation, because this is the most natural way to represent a simple request-response interaction.  We could have instead (for example) defined two separate operations using the <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">in-only</xspecref> and <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#out-only">out-only</xspecref> patterns (see <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PART2"/> section  2.2.1 <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-only">In-Only</xspecref> and section  2..5 <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#out-only">Out-Only</xspecref>), but that would just complicate matters for the client, because we would then have to separately indicate to the client developer that the two operations should be used together as a request-response pair.</p><p>In addition to the normal input and output messages, we also need to specify the fault message that we wish to use in the event of an error.  WSDL 2.0 permits fault messages to be declared within the <code>interface</code> element in order to facilitate reuse of faults across operations.   If a fault occurs, it terminates whatever message sequence was indicated by the message exchange pattern of the operation.  </p><p>Let's add these to our WSDL document.</p><example id="example-initial-interface">
  					<head>GreatH Interface Definition</head>
  					
--- 259,265 ----
  				</example><div3 id="example-initial-types-explanation"><head>Explanation of Example</head><glist><gitem><label><code>xmlns:ghns = "http://greath.example.com/2004/schemas/resSvc"</code></label><def><p>We've added another namespace declaration.  The <code>ghns</code> namespace prefix will allow us (later, when defining an interface) to reference the XML Schema target namespace that we define for our message types.  Thus, the URI we specify must be the same as the URI  that we define as the target namespace of our XML Schema types (below) -- <emph>not</emph> the target namespace of the WSDL document itself.</p></def></gitem><gitem><label><code>targetNamespace="http://greath.example.com/2004/schemas/resSvc"</code></label><def><p>This is the XML Schema target namespace that we've created for  use by the GreatH reservation service.  The <code>checkAvailability</code>, <code>checkAvailabilityResponse</code> and <code>invalidDataError</code> element names will be associated with this XML Schema target namespae.</p></def></gitem><gitem><label><code>checkAvailability</code>, <code>checkAvailabilityResponse</code> and <code>invalidDataError</code></label><def><p>These are the message types that we'll use.  Note that these are defined to be XML <emph>elements</emph>, as explained above.</p></def></gitem></glist><p>Although we have defined several types, we have not yet indicated which ones are to be used as message types for a Web service.  We'll do that in the next section.  </p></div3></div2>
  				
! 				<div2 id="basics-interface"><head>Defining an Interface</head><p>WSDL 2.0 enables one to separate the description of a Web service's abstract functionality from the concrete details of how and where that functionality is offered.    This separation facilitates different levels of reusability and distribution of work in the lifecycle of a Web service and the WSDL document that describes it. </p><p>A WSDL 2.0 <code>interface</code> defines the abstract interface of a Web service as a set of abstract <emph>operations</emph>, each operation representing a simple interaction between the client and the service.  Each operation specifies the types of messages that the service can send or receive as part of that operation.  Each operation also specifies a message exchange <emph>pattern</emph> that indicates the sequence in which the associated messages are to be transmitted between the parties.   For example, the <emph>in-out</emph> pattern (see <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PAT2"/> section  2.2.3 <xspecref href="&w3c-designation-part2;#in-out">In-Out</xspecref>) indicates that if the client sends a message <emph>in</emph> to the service, the service will either send a reply message back <emph>out</emph> to the client (in the normal case) or it will send a fault message back to the client (in the case of an error). We will explain more about message exchange <emph>pattern</emph>s in <specref ref = "more-interfaces-meps"/></p>
  				
! 				<p>For the GreatH service, we will (initially) define an interface containing a single operation, <code>opCheckAvailability</code>, using  the <code>checkAvailability</code> and <code>checkAvailabilityResponse</code> message types that we defined in the <code>types</code> section.   We'll use the <xspecref href="&w3c-designation-part2;#in-out">in-out</xspecref> pattern for this operation, because this is the most natural way to represent a simple request-response interaction.  We could have instead (for example) defined two separate operations using the <xspecref href="&w3c-designation-part2;#in-out">in-only</xspecref> and <xspecref href="&w3c-designation-part2;#out-only">out-only</xspecref> patterns (see <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PART2"/> section  2.2.1 <xspecref href="&w3c-designation-part2;#in-only">In-Only</xspecref> and section  2.2.5 <xspecref href="&w3c-designation-part2;#out-only">Out-Only</xspecref>), but that would just complicate matters for the client, bcause we would then have to separately indicate to the client developer that the two operations should be used together as a request-response pair.</p><p>In addition to the normal input and output messages, we also need to specify the fault message that we wish to use in the event of an error.  WSDL 2.0 permits fault messages to be declared within the <code>interface</code> element in order to facilitate reuse of faults across operations.   If a fault occurs, it terminates whatever message sequence was indicated by the message exchange pattern of the operation.  </p><p>Let's add these to our WSDL document.</p><example id="example-initial-interface">
  					<head>GreatH Interface Definition</head>
  					
***************
*** 299,309 ****
              </code></label><def><p>The <code>name</code> attribute defines a name for this fault.  The name is required so that when an operation is defined, it can reference the desired fault by name.  Fault names must be unique within an interface.</p></def></gitem><gitem><label><code>element = "ghns:invalidDataError"/&gt;</code></label><def><p>The <code>element</code> attribute specifies the schema type of the fault message, as previously defined in the <code>types</code> section.   </p></def></gitem><gitem><label><code>&lt;operation name="opCheckAvailability"</code></label><def><p>The <code>name</code> attribute defines a name for this operation, so that it can be referenced later when bindings are defined.  Operation names must also be unique within an interface.  (WSDL 2.0 uses separate symbol spaces for operation and fault names, so operation name "foo" is distinct from fault name "foo".)</p></def></gitem>
              
!             <gitem><label><code>pattern="http://www.w3.org/2005/05/wsdl/in-out" </code></label><def><p>This line specifies that this operation will use the <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">in-out</xspecref> pattern as described above.  WSDL 2.0 uses URIs to identify message exchange patterns in order to ensure that the identifiers are globally unambiguous, while also permitting future new patterns to be defined by anyone.  (However, just because someone defines a new pattern and creates a URI to identify it, that does <emph>not</emph> mean that other WSDL processors will automatically recognize or understand that pattern.  As with any other extension, it can be used among processors that <emph>do</emph> recognize and understand it.)</p></def></gitem>
  	
  	<gitem><label><code>style="http://www.w3.org/2005/05/wsdl/style/uri" </code></label><def><p>
! 	This line indicates that the XML schema defining the input message of this operation follows a set of rules as specified in <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#_operation_uri_style">URI Style</xspecref> that ensures the message can be serialized as an URI. 
  	</p></def></gitem>
              
!             <gitem><label><code>safe="true" &gt;</code></label><def><p>This line indicates that this operation will not obligate the client in any way, i.e., the client can safely invoke this operation without fear that it may be incurring an obligation (such as agreeing to buy something).  This is further explained in  <specref ref="more-interfaces-operations"/>.  </p></def></gitem><gitem><label><code>&lt;input messageLabel="In"</code></label><def><p>The <code>input</code> element specifies an input message.  Even though we have already specified which message exchange pattern the operation will use, a message exchange pattern represents a template for a message sequence, and in theory could  consist of multiple input and/or output messages.  Thus we must also indicate which potential input message in the pattern this particular input message represents.  This is the purpose of the <code>messageLabel</code> attribute.  Since the  <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#inout">in-out</xspecref> pattern that we've chosen to use only has one input message, it is trivial in this case: we simply fill in the message label "In" that was defined in <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PART2"/> section 2.2.3 <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">In-Out</xspecref> for the <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">in-out</xspecref> pattern.  However, if a new pattern is defined that involve multiple input messages, then the different input messages in the pattern  could then be distinguished by having different labels.</p></def></gitem><gitem><label><code>element="ghns:checkAvailability" /&gt;</code></label><def><p>This specifies the message type for this input message, as defined previously in the <code>types</code> section.</p></def></gitem><gitem><label><code>&lt;output messageLabel="Out" . . .</code></label><def><p>This is similar to defining an input message.</p></def></gite><gitem><label><code>&lt;outfault ref="tns:invalidDataFault" messageLabel="Out"/&gt;</code></label><def><p>This associates an output fault with this operation.  Faults are declared a little differently than normal messages.  The <code>ref</code> attribute refers to the name of a previously defined fault in this interface -- not a message schema type directly.  Since message exchange patterns could in general involve a sequence of several messages, a fault could potentially occur at various points within the message sequence.  Because one may wish to associate a different fault with each permitted point in the sequence, the messageLabel is used to indicate the desired point for this particular fault. It does so indirectly by specifying the message that will either trigger this fault or that this fault will replace, depending on the pattern.   (Some patterns use a <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#fault-trigger">message-triggers-fault rule</xspecref>; others use a <xspecef href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#fault-replacement">fault-replaces-message</xspecref> rule.  See <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PART2"/> section 2.1.2 <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#fault-trigger">Message Triggers Fault</xspecref> and section 2.1.1 <xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#fault-replacement">Fault Replaces Message</xspecref>.) </p></def></gitem></glist><p>Now that we've defined the abstract interface for the GreatH service, we're ready to define a binding for it.</p></div3></div2>
  
  			
--- 299,309 ----
              </code></label><def><p>The <code>name</code> attribute defines a name for this fault.  The name is required so that when an operation is defined, it can reference the desired fault by name.  Fault names must be unique within an interface.</p></def></gitem><gitem><label><code>element = "ghns:invalidDataError"/&gt;</code></label><def><p>The <code>element</code> attribute specifies the schema type of the fault message, as previously defined in the <code>types</code> section.   </p></def></gitem><gitem><label><code>&lt;operation name="opCheckAvailability"</code></label><def><p>The <code>name</code> attribute defines a name for this operation, so that it can be referenced later when bindings are defined.  Operation names must also be unique within an interface.  (WSDL 2.0 uses separate symbol spaces for operation and fault names, so operation name "foo" is distinct from fault name "foo".)</p></def></gitem>
              
!             <gitem><label><code>pattern="http://www.w3.org/2005/05/wsdl/in-out" </code></label><def><p>This line specifies that this operation will use the <xspecref href="&w3c-designation-part2;#in-out">in-out</xspecref> pattern as described above.  WSDL 2.0 uses URIs to identify message exchange patterns in order to ensure that the identifiers are globally unambiguous, while also permitting future new patterns to be defined by anyone.  (However, just because someone defines a new pattern and creates a URI to identify it, that does <emph>not</emph> mean that other WSDL processors will automatically recognize or understand that pattern.  As with any other extension, it can be used among processors that <emph>do</emph> recognize and understand it.)</p></def></gitem>
  	
  	<gitem><label><code>style="http://www.w3.org/2005/05/wsdl/style/uri" </code></label><def><p>
! 	This line indicates that the XML schema defining the input message of this operation follows a set of rules as specified in <xspecref href="&w3c-designation-part2;#_operation_uri_style">URI Style</xspecref> that ensures the message can be serialized as an URI. 
  	</p></def></gitem>
              
!             <gitem><label><code>safe="true" &gt;</code></label><def><p>This line indicates that this operation will not obligate the client in any way, i.e., the client can safely invoke this operation without fear that it may be incurring an obligation (such as agreeing to buy something).  This is further explained in  <specref ref="more-interfaces-operations"/>.  </p></def></gitem><gitem><label><code>&lt;input messageLabel="In"</code></label><def><p>The <code>input</code> element specifies an input message.  Even though we have already specified which message exchange pattern the operation will use, a message exchange pattern represents a template for a message sequence, and in theory could  consist of multiple input and/or output messages.  Thus we must also indicate which potential input message in the pattern this particular input message represents.  This is the purpose of the <code>messageLabel</code> attribute.  Since the  <xspecref href="&w3c-designation-part2;#in-out">in-out</xspecref> pattern tat we've chosen to use only has one input message, it is trivial in this case: we simply fill in the message label "In" that was defined in <emph>WSDL 2.0 Predefined Extensions</emph> <bibref ref="WSDL-PART2"/> section 2.2.3 <xspecref href="&w3c-designation-part2;#in-out">In-Out</xspecref> for the <xspecref href="&w3c-designation-part2;#in-out">in-out</xspecref> pattern.  However, if a new pattern is defined that involve multiple input messages, then the different input messages in the pattern  could then be distinguished by having different labels.</p></def></gitem><gitem><label><code>element="ghns:checkAvailability" /&gt;</code></label><def><p>This specifies the message type for this input message, as defined previously in the <code>types</code> section.</p></def></gitem><gitem><label><code>&lt;output messageLabel="Out" . . .</code></label><def><p>This is similar to defining an input message.</p></def></gitem><gitem><label><code>&lt;outfault ref="tns:invalidDataFault" messageLabel="Out"/&gt;</code></label<def><p>This associates an output fault with this operation.  Faults are declared a little differently than normal messages.  The <code>ref</code> attribute refers to the name of a previously defined fault in this interface -- not a message schema type directly.  Since message exchange patterns could in general involve a sequence of several messages, a fault could potentially occur at various points within the message sequence.  Because one may wish to associate a different fault with each permitted point in the sequence, the messageLabel is used to indicate the desired point for this particular fault. It does so indirectly by specifying the message that will either trigger this fault or that this fault will replace, depending on the pattern.   (Some patterns use a <xspecref href="&w3c-designation-part2;#fault-trigger">message-triggers-fault rule</xspecref>; others use a <xspecref href="&w3c-designation-part2;#fault-replacement">fault-replaces-message</xspecref> rule.  See <emph>WSDL 2.0 Predefined Extensios</emph> <bibref ref="WSDL-PART2"/> section 2.1.2 <xspecref href="&w3c-designation-part2;#fault-trigger">Message Triggers Fault</xspecref> and section 2.1.1 <xspecref href="&w3c-designation-part2;#fault-replacement">Fault Replaces Message</xspecref>.) </p></def></gitem></glist><p>Now that we've defined the abstract interface for the GreatH service, we're ready to define a binding for it.</p></div3></div2>
  
  			
***************
*** 410,414 ****
  		</xspecref>.)
  	</p>
! </def></gitem><gitem><label><code>wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response"&gt;</code></label><def><p>This attribute is also specific to WSDL 2.0's SOAP binding extension.    It specifies the SOAP message exchange pattern (MEP) that will be used to implement the abstract WSDL 2.0  message exchange pattern (<xspecref href="http://www.w3.org/TR/2004/WD-wsdl20-extensions-20040803/#in-out">in-out</xspecref>) that was specified when the <code>opCheckAvailability</code> operation was defined. </p>
  <p>When HTTP is used as the underlying transport protocol (as in this example) the <code>wsoap:mep</code> attribute also controls whether GET or POST will be used as the underlying HTTP method. In this case, the use of <code>wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response"</code> causes GET to be used by default. See  also  <specref ref="adv-get-vs-post"/>.</p></def></gitem><gitem><label><code>&lt;fault ref="tns:invalidDataFault"</code></label><def><p>As with a binding operation, this is not declaring a new fault; rather, it is referencing a fault (<code>invalidDataFault</code>) that was previously defined in the <code>opCheckAvailability</code> interface, in order to specify binding details for it.</p></def></gitem><gitem><label><code>wsoap:code="soap:Sender"/&gt;</code></label><def><p>This attribute is also specific to WSDL 2.0's SOAP binding extension.       This specifies the SOAP 1.2 fault code that will cause this fault message to be sent.   If desired, a list of subcodes can also be speified using the optional  <att>wsoap:subcodes</att> attribute.</p></def></gitem></glist></div3></div2><div2 id="basics-service"><head>Defining a Service</head><p>Now that our binding has specified <emph>how</emph> messages will be transmitted, we are ready to specify <emph>where</emph> the service can be accessed, by use of the <code>service</code> element.  </p><p>A WSDL 2.0 <emph>service</emph> specifies a single interface that the service will support, and  a list of <emph>endpoint</emph> locations where that service can be accessed.  Each endpoint must also reference a previously defined binding to indicate what protocols and transmission formats are to be used at that endpoint.  A service is only permitted to have one interface.   (See  <specref ref="adv-multiple-docs-describing-same-service"/> for further discussion of this limitation.) </p><p>Here is a definition for our GreatH service.</p><example id="example-initial-service">
  					<head>GreatH Service Definition</head>
--- 410,414 ----
  		</xspecref>.)
  	</p>
! </def></gitem><gitem><label><code>wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response"&gt;</code></label><def><p>This attribute is also specific to WSDL 2.0's SOAP binding extension.    It specifies the SOAP message exchange pattern (MEP) that will be used to implement the abstract WSDL 2.0  message exchange pattern (<xspecref href="&w3c-designation-part2;#in-out">in-out</xspecref>) that was specified when the <code>opCheckAvailability</code> operation was defined. </p>
  <p>When HTTP is used as the underlying transport protocol (as in this example) the <code>wsoap:mep</code> attribute also controls whether GET or POST will be used as the underlying HTTP method. In this case, the use of <code>wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response"</code> causes GET to be used by default. See  also  <specref ref="adv-get-vs-post"/>.</p></def></gitem><gitem><label><code>&lt;fault ref="tns:invalidDataFault"</code></label><def><p>As with a binding operation, this is not declaring a new fault; rather, it is referencing a fault (<code>invalidDataFault</code>) that was previously defined in the <code>opCheckAvailability</code> interface, in order to specify binding details for it.</p></def></gitem><gitem><label><code>wsoap:code="soap:Sender"/&gt;</code></label><def><p>This attribute is also specific to WSDL 2.0's SOAP binding extension.       This specifies the SOAP 1.2 fault code that will cause this fault message to be sent.   If desired, a list of subcodes can also be speified using the optional  <att>wsoap:subcodes</att> attribute.</p></def></gitem></glist></div3></div2><div2 id="basics-service"><head>Defining a Service</head><p>Now that our binding has specified <emph>how</emph> messages will be transmitted, we are ready to specify <emph>where</emph> the service can be accessed, by use of the <code>service</code> element.  </p><p>A WSDL 2.0 <emph>service</emph> specifies a single interface that the service will support, and  a list of <emph>endpoint</emph> locations where that service can be accessed.  Each endpoint must also reference a previously defined binding to indicate what protocols and transmission formats are to be used at that endpoint.  A service is only permitted to have one interface.   (See  <specref ref="adv-multiple-docs-describing-same-service"/> for further discussion of this limitation.) </p><p>Here is a definition for our GreatH service.</p><example id="example-initial-service">
  					<head>GreatH Service Definition</head>
***************
*** 501,505 ****
  				</ednote>
  
! Although the WSDL 2.0 schema does not indicate the required ordering of elements, the WSDL 2.0 specification (WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> "<xspecref href="&part1.latest;#Description_XMLRep">XML Representation of Description Component</xspecref>") clearly states a set of constraints about how the children elements of the <code>description</code> element should be ordered. Thus, the order of the WSDL 2.0 elements matters, in spite of what the WSDL 2.0 schema says. </p><p>The following is a pseudo-content model of <code>description</code>.</p>
  
  <eg xml:space="preserve">
--- 501,505 ----
  				</ednote>
  
! Although the WSDL 2.0 schema does not indicate the required ordering of elements, the WSDL 2.0 specification (WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> "<xspecref href="&w3c-designation-part1;#Description_XMLRep">XML Representation of Description Component</xspecref>") clearly states a set of constraints about how the children elements of the <code>description</code> element should be ordered. Thus, the order of the WSDL 2.0 elements matters, in spite of what the WSDL 2.0 schema says. </p><p>The following is a pseudo-content model of <code>description</code>.</p>
  
  <eg xml:space="preserve">
***************
*** 603,607 ****
  <div1 id="more-types"><head>More on Message Types</head>
  		<p>The WSDL 2.0 <code>types</code> element provides a mechanism for enclosing message schemas in a WSDL 2.0 document.  Because WSDL 2.0 directly supports schemas written in XML Schema
! <bibref ref="XMLSchemaP1"/>, we will focus here on the use of XML Schema to define message types.  Schemas written in other type definition languages must be defined using a WSDL 2.0 language extension.  For examples of other schema languages, see WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> Appendix E "<xspecref href="&part1.latest;#other-schemalang">Examples of Specifications of Extension Elements for Alternative Schema Language Support. (Non-Normative)</xspecref>".  
   <ednote><name>dbooth</name><date>2005-04-13</date><edtext>ToDo: Update the above reference to appendix E, as the WG decided to move it to a separate document.</edtext></ednote></p>
  		
--- 603,607 ----
  <div1 id="more-types"><head>More on Message Types</head>
  		<p>The WSDL 2.0 <code>types</code> element provides a mechanism for enclosing message schemas in a WSDL 2.0 document.  Because WSDL 2.0 directly supports schemas written in XML Schema
! <bibref ref="XMLSchemaP1"/>, we will focus here on the use of XML Schema to define message types.  Schemas written in other type definition languages must be defined using a WSDL 2.0 language extension.  For examples of other schema languages, see WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> Appendix E "<xspecref href="&w3c-designation-part1;#other-schemalang">Examples of Specifications of Extension Elements for Alternative Schema Language Support. (Non-Normative)</xspecref>".  
   <ednote><name>dbooth</name><date>2005-04-13</date><edtext>ToDo: Update the above reference to appendix E, as the WG decided to move it to a separate document.</edtext></ednote></p>
  		
***************
*** 626,630 ****
  				<head>Embedding XML Schema</head>
  				<p>We have already seen an example of using embedded schema definitions in section <specref ref="basics-types"/>, so we will merely add a few additional points here. </p><p>When XML Schema is embedded directly in a WSDL 2.0 document, it uses the existing top-level <code>xs:schema</code> element defined by XML Schema <bibref ref="XMLSchemaP1"/> to do so, as though the schema had been copied and pasted into the <code>types</code> element. The schema components defined in the embedded schema are then available to
! WSDL for reference by QName (see WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> "<xspecref href="&part1.latest;#qnameres">QName Resolution</xspecref>"). </p>
  				<p>Although WSDL 2.0 provides a <code>wsdl:import</code> mechanism (described in the next section), an embedded XML schema may also use XML Schema's native <code>xs:import</code> and <code>xs:include</code>
  elements  to refer to schemas either in separate files or embedded in the same
--- 626,630 ----
  				<head>Embedding XML Schema</head>
  				<p>We have already seen an example of using embedded schema definitions in section <specref ref="basics-types"/>, so we will merely add a few additional points here. </p><p>When XML Schema is embedded directly in a WSDL 2.0 document, it uses the existing top-level <code>xs:schema</code> element defined by XML Schema <bibref ref="XMLSchemaP1"/> to do so, as though the schema had been copied and pasted into the <code>types</code> element. The schema components defined in the embedded schema are then available to
! WSDL for reference by QName (see WSDL 2.0 Part 1 <bibref ref="WSDL-PART1"/> "<xspecref href="&w3c-designation-part1;#qnameres">QName Resolution</xspecref>"). </p>
  				<p>Although WSDL 2.0 provides a <code>wsdl:import</code> mechanism (described in the next section), an embedded XML schema may also use XML Schema's native <code>xs:import</code> and <code>xs:include</code>
  elements  to refer to schemas either in separate files or embedded in the same
***************
*** 729,738 ****
  </eg>
  				
! 				<p>The <code>interface</code> element has two optional attributes:  <att>styleDefault</att> and  <att>extends</att>.  The <att>styleDefault</att>  attribute can be used to define a default value for the <att>style</att> attributes of all operations under this interface (see WSDL 2.0 Part 1 "<xspecref href="&part1.latest;#Interface_styleDefault_attribute">styleDefault attribute information item</xspecref>").  The <att>extends</att>  attribute is for inheritance, and is explained next.   </p>
  				
  			</div2>
  	<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="&part1.latest;#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 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 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>
--- 729,738 ----
  </eg>
  				
! 				<p>The <code>interface</code> element has two optional attributes:  <att>styleDefault</att> and  <att>extends</att>.  The <att>styleDefault</att>  attribute can be used to define a default value for the <att>style</att> attributes of all operations under this interface (see WSDL 2.0 Part 1 "<xspecref href="&w3c-designation-part1;#Interface_styleDefault_attribute">styleDefault attribute information item</xspecref>").  The <att>extends</att>  attribute is for inheritance, and is explained next.   </p>
  				
  			</div2>
  	<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 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 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>
Received on Wednesday, 11 May 2005 03:32:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:31:37 UTC