Annotated RDF WSDL Examples

This document contains the SOAP and WSDL/RDF protocol exchanges. It is intended to help nail down the mapping from WSDL to an object model. Uche Ogbuji's snowboard example but I changed a lot in validating and, I think, clarifying, the model. Please see the WSDL Rdf Mapping paper.

SOAP request

<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <m:GetEndorsingBoarder xmlns:m="http://namespaces.snowboard-info.com">
      <manufacturer>K2</manufacturer>
      <model>Fatbob</model>
    </m:GetEndorsingBoarder>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

SOAP response

<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <SOAP-ENV:Body>
    <m:GetEndorsingBoarderResponse xmlns:m="http://namespaces.snowboard-info.com">
      <endorsingBoarder>Chris Englesmann</endorsingBoarder>
    </m:GetEndorsingBoarderResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

RDF encoding of WSDL description

See also, the raw RDF, and the DLG of the snowboard example data.

<?xml version="1.0"?>

 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:es="http://www.snowboard-info.com/EndorsementSearch.wsdl"
  xmlns:esxsd="http://schemas.snowboard-info.com/EndorsementSearch.xsd"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <!-- wsdl:message elements describe potential transactions -->

  <!-- request GetEndorsingBoarderRequest is of type GetEndorsingBoarder -->
  <wsdl:message rdf:about="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderRequest">
    <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#GetEndorsingBoarderRequest"/>
    <wsdl:hasPart>
     <wsdl:part>
      <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#body"/>
      <wsdl:element rdf:resource="http://schemas.snowboard-info.com/EndorsementSearch.xsd#GetEndorsingBoarder"/>
     </wsdl:part>
    </wsdl:hasPart>
  </wsdl:message>

  <!-- response GetEndorsingBoarderResponse is of type GetEndorsingBoarderResponse -->
  <wsdl:message rdf:about="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderResponse">
    <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#GetEndorsingBoarderResponse"/>
    <wsdl:hasPart>
     <wsdl:part>
      <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#body"/>
      <wsdl:element rdf:resource="http://schemas.snowboard-info.com/EndorsementSearch.xsd#GetEndorsingBoarderResponse"/>
     </wsdl:part>
    </wsdl:hasPart>
  </wsdl:message>

  <!-- wsdl:portType describes messages in an operation -->
  <wsdl:portType rdf:about="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderPortType">
   <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#GetEndorsingBoarderPortType"/>
   <wsdl:hasOperation>
    <!-- the value of wsdl:operation eludes me -->
    <wsdl:operation>
      <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#GetEndorsingBoarder"/>
      <wsdl:input rdf:resource="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderRequest"/>
      <wsdl:output rdf:resource="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderResponse"/>
      <wsdl:fault rdf:resource="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderFault"/>
    </wsdl:operation>
   </wsdl:hasOperation>
  </wsdl:portType>

  <!-- wsdl:binding states a serialization protocol for this service -->
  <wsdl:binding rdf:about="http://www.snowboard-info.com/EndorsementSearch.wsdl#EndorsementSearchSoapBinding">
    <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#EndorsementSearchSoapBinding"/>
    <wsdl:type rdf:resource="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderPortType"/>

    <!-- leverage off soap:binding document style @@@(no wsdl:foo pointing at the soap binding) -->
   <wsdl:hasBinding>
      <soap:binding>
        <soap:style rdf:resource="http://schemas.xmlsoap.org/wsdl/soap/document"/>
        <soap:transport rdf:resource="http://schemas.xmlsoap.org/soap/http"/>
      </soap:binding>
   </wsdl:hasBinding>

   <wsdl:hasOperation>
    <!-- semi-opaque container of network transport details classed by soap:binding above @@@ -->
    <wsdl:operation rdf:about="GetEndorsingBoarder">

      <!-- again bind to SOAP? @@@ -->
      <soap:operation>
        <rdf:Description>
          <soap:soapAction rdf:resource="http://www.snowboard-info.com/EndorsementSearch"/>
        </rdf:Description>
      </soap:operation>

      <!-- furthur specify that the messages in the wsdl:operation "GetEndorsingBoarder" use SOAP? @@@ -->
      <wsdl:input>
        <soap:body>
	  <soap:use rdf:resource="http://schemas.xmlsoap.org/wsdl/soap/literal"/>
          <soap:namespace rdf:resource="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>
        </soap:body>
      </wsdl:input>
      <wsdl:output>
        <soap:body>
	  <soap:use rdf:resource="http://schemas.xmlsoap.org/wsdl/soap/literal"/>
          <soap:namespace rdf:resource="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>
        </soap:body>
      </wsdl:output>
      <wsdl:fault>
        <soap:body>
	  <soap:use rdf:resource="http://schemas.xmlsoap.org/wsdl/soap/literal"/>
          <soap:namespace rdf:resource="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>
        </soap:body>
      </wsdl:fault>
    </wsdl:operation>
   </wsdl:hasOperation>
  </wsdl:binding>

  <!-- wsdl:service names a new service "EndorsementSearchService" -->
  <wsdl:service rdf:about="http://www.snowboard-info.com/EndorsementSearch.wsdl#EndorsementSearchService">
    <wsdl:name rdf:resource="http://namespaces.snowboard-info.com#EndorsementSearchService"/>
    <wsdl:documentation>snowboarding-info.com Endorsement Service</wsdl:documentation> 

    <!-- connect it to the binding "EndorsementSearchSoapBinding" above -->
   <wsdl:hasPort>
    <wsdl:port rdf:about="http://www.snowboard-info.com/EndorsementSearch.wsdl#GetEndorsingBoarderPort">

      <wsdl:binding rdf:resource="http://www.snowboard-info.com/EndorsementSearch.wsdl#EndorsementSearchSoapBinding"/>

      <!-- give the binding an network address -->
      <soap:address>
        <soap:location rdf:about="http://www.snowboard-info.com/EndorsementSearch"/>
      </soap:address>
    </wsdl:port>
   </wsdl:hasPort>
  </wsdl:service>

 </rdf:RDF>

Note: two sets of wsdl:hasOperation and one set of wsdl:hasPort properties were added to enable this RDF to validate. The wsdl:binding is a description by virtue of being immediately inside the (see the basic syntax and the wsdl:operation appears to also be a description as it has and RDF:about.

Modifications

added propertElts around operation and port
chagned rdf:IDs to rdf:abouts with absolute URIs
wanted this document to come from anywhere, not just the targetNamespace location.
moved literals that were probably supposed to be interpreted withing the targetNamespace into full resources

Unmodified, decorated snowboard example

Following is Uche Ogbuji's original snowboard example, with none of the above modifacations.

<?xml version="1.0"?>

<!-- root element wsdl:definitions defines set of related services -->
<wsdl:definitions wsdl:name="EndorsementSearch"
  xmlns:es="http://www.snowboard-info.com/EndorsementSearch.wsdl"
  xmlns:esxsd="http://schemas.snowboard-info.com/EndorsementSearch.xsd"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

  <!-- wsdl:types encapsulates schema definitions of communication types; here using xsd -->
  <wsdl:types>

    <!-- all type declarations are in a chunk of xsd -->
    <xsd:schema targetNamespace="http://namespaces.snowboard-info.com"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">

      <!-- xsd definition: GetEndorsingBoarder [manufacturer string, model string] -->
      <xsd:element name="GetEndorsingBoarder">
	<xsd:complexType>
	  <xsd:sequence>
	    <xsd:element name="manufacturer" type="string"/>
            <xsd:element name="model" type="string"/>
	  </xsd:sequence>
	</xsd:complexType>
      </xsd:element>

      <!-- xsd definition: GetEndorsingBoarderResponse [... endorsingBoarder string ...] -->
      <xsd:element name="GetEndorsingBoarderResponse">
	<xsd:complexType>
	  <xsd:all>
	    <xsd:element name="endorsingBoarder" type="string"/>
	  </xsd:all>
	</xsd:complexType>
      </xsd:element>

      <!-- xsd definition: GetEndorsingBoarderFault [... errorMessage string ...] -->
      <xsd:element name="GetEndorsingBoarderFault">
	<xsd:complexType>
	  <xsd:all>
	    <xsd:element name="errorMessage" type="string"/>
	  </xsd:all>
	</xsd:complexType>
      </xsd:element>

    </xsd:schema>
  </wsdl:types>

 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!-- wsdl:message elements describe potential transactions -->

  <!-- request GetEndorsingBoarderRequest is of type GetEndorsingBoarder -->
  <wsdl:message wsdl:name="GetEndorsingBoarderRequest"
                rdf:ID="GetEndorsingBoarderRequest">
    <wsdl:part wsdl:name="body" wsdl:element="esxsd:GetEndorsingBoarder"/>
  </wsdl:message>

  <!-- response GetEndorsingBoarderResponse is of type GetEndorsingBoarderResponse -->
  <wsdl:message wsdl:name="GetEndorsingBoarderResponse"
                rdf:ID="GetEndorsingBoarderResponse">
    <wsdl:part wsdl:name="body" wsdl:element="esxsd:GetEndorsingBoarderResponse"/>
  </wsdl:message>

  <!-- wsdl:portType describes messages in an operation -->
  <wsdl:portType wsdl:name="GetEndorsingBoarderPortType"
                rdf:ID="GetEndorsingBoarderPortType">

    <!-- the value of wsdl:operation eludes me -->
    <wsdl:operation wsdl:name="GetEndorsingBoarder">
      <wsdl:input rdf:resource="es:GetEndorsingBoarderRequest"/>
      <wsdl:output rdf:resource="es:GetEndorsingBoarderResponse"/>
      <wsdl:fault rdf:resource="es:GetEndorsingBoarderFault"/>
    </wsdl:operation>
  </wsdl:portType>

  <!-- wsdl:binding states a serialization protocol for this service -->
  <wsdl:binding wsdl:name="EndorsementSearchSoapBinding"
                wsdl:type="es:GetEndorsingBoarderPortType"
                rdf:ID="EndorsementSearchSoapBinding">

    <!-- leverage off soap:binding document style @@@(no wsdl:foo pointing at the soap binding) -->
    <soap:binding soap:style="document"
                  soap:transport="http://schemas.xmlsoap.org/soap/http"/>

    <!-- semi-opaque container of network transport details classed by soap:binding above @@@ -->
    <wsdl:operation rdf:about="GetEndorsingBoarder">

      <!-- again bind to SOAP? @@@ -->
      <soap:operation soap:soapAction="http://www.snowboard-info.com/EndorsementSearch"/>

      <!-- furthur specify that the messages in the wsdl:operation "GetEndorsingBoarder" use SOAP? @@@ -->
      <wsdl:input>
        <soap:body soap:use="literal"
		   soap:namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body soap:use="literal"
		   soap:namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>
      </wsdl:output>
      <wsdl:fault>
        <soap:body soap:use="literal"
		   soap:namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>
      </wsdl:fault>
    </wsdl:operation>
  </wsdl:binding>

  <!-- wsdl:service names a new service "EndorsementSearchService" -->
  <wsdl:service wsdl:name="EndorsementSearchService"
                rdf:ID="EndorsementSearchService">
    <wsdl:documentation>snowboarding-info.com Endorsement Service</wsdl:documentation> 

    <!-- connect it to the binding "EndorsementSearchSoapBinding" above -->
    <wsdl:port rdf:about="GetEndorsingBoarderPort">

      <wsdl:binding rdf:resource="EndorsementSearchSoapBinding"/>

      <!-- give the binding an network address -->
      <soap:address soap:location="http://www.snowboard-info.com/EndorsementSearch"/>
    </wsdl:port>
  </wsdl:service>

 </rdf:RDF>
 </wsdl:definitions>

See Also

WSDL Rdf Mapping
presented at the 8 April 2002 Web Services Architecture face to face.
Using WSDL in SOAP applications
Uche Ogbuji's description of WSDL working with SOAP.
Semantic Web Web Services
A survey of Semantic Web web service papers.
annotated conventional WSDL examples
an earlier look at Uche's model.

Valid XHTML q.0!

Eric Prud'hommeaux

Last modified: Tue Nov 20 15:59:08 EST 2001