< previous
index

WSDL: basic types

next >

The following three files (pages) are taken from the W3C WSDL spec. Usually, those three components are combined in one. The first file defines the types: a normal schema (path in $xsd)

   <?xml version="1.0"?>
   <schema
     targetNamespace="http://example.com/stockquote/schemas"
     xmlns="http://www.w3.org/2001/XMLSchema">
          
     <element name="TradePriceRequest">
       <complexType>
         <all>
           <element name="tickerSymbol" type="string"/>
         </all>
       </complexType>
     </element>

     <element name="TradePrice">
       <complexType>
         <all>
           <element name="price" type="float"/>
         </all>
       </complexType>
     </element>

   </schema>

This schema defines element named TradePriceRequest and TradePrice, which will be used as base for the query and answer message. This is still a normal schema.

The message structures look like:

   <TradePriceRequest>
     <tickerSymbol>
        IBM
     </tickerSymbol>
   </TradePriceRequest>

   <TradePrice>
     <price>
        12.45
     </price>
   </TradePrice>

(Of course, this is an extreme simplification of the messages. In reality, you should be able to combine the query of multiple symbols in one message for performance reasons. Also, you would like a currency in the price. These exchanged messages can become very complex.)


YAPC::EU 2007 Vienna, Presentation of XML::Compile second part, by Mark Overmeer.