Previous Page Arrow Next Page Arrow

4.5 Service Operation and Named Query Definitions

Here is a typical service operation definition from our example schema:

  <xs:element name="productComputeSimplePrice" 
              type="tns:productComputeSimplePrice--type"
              sme:role="serviceOperation"
              sme:path="products/$service/computeSimplePrice"
              sme:invocationMode="sync" />
  <xs:complexType name="productComputeSimplePrice--type">
    <xs:all>
      <xs:element name="request" type="tns:simplePriceRequest--type" minOccurs="0"/>
      <xs:element name="response" type="tns:simplePriceResponse--type" minOccurs="0"/>
    </xs:all>
  </xs:complexType>
 
  <xs:complexType name="simplePriceRequest--type">
    <xs:all>
      <xs:element name="productID" type="xs:string" sme:label="Product ID" />
      <xs:element name="customerID" type="xs:string" sme:label="Customer ID" />
      <xs:element name="quantity" type="xs:decimal" sme:label="Quantity" />
    </xs:all>
  </xs:complexType>
 
  <xs:complexType name="simplePriceResponse--type">
    <xs:all>
      <xs:element name="unitPrice" type="xs:decimal" sme:label="Unit Price" />
      <xs:element name="quantityPrice" type="xs:decimal" sme:label="Quantity Price" />
      <xs:element name="discount" type="xs:decimal" sme:label="Discount" />
      <xs:element name="tax" type="xs:decimal" sme:label="Tax" />
    </xs:all>
  </xs:complexType>

The sme:role attribute is set to serviceOperation to indicate that the element defines a service operation.

The rest of the markup is specific to service operations and is described in details in the Operations Metadata section.

The schema may also contain definitions for named queries, as decribed in the Named Query Metadata section.

Providers that expose service operations MUST provide service definitions that conform to these rules in their schemas.

Previous Page Arrow Next Page Arrow