The Department Directory Use Case Using <wsdl:reference>

I posted a sample use case that described a Department Directory [1] which 
used services references to refer to departments that reported to the 
current department service endpoint. I gave a WSDL 1.1 description there. 
I then described why the service reference counterproposal [2] could not 
support this use case since it required putting binding information in the 
interface, thereby making the interface non abstract and non reusable for 
multiple bindings. 

Here I give the proposed WSDL 2.0 description of the Department Directory 
using the <wsdl:reference> element. Here the interface is fully abstract 
and reusable for both of the bindings.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Department" targetNamespace="http://example.w3c.org/Department" 
        xmlns:tns="http://example.w3c.org/Department" 
        xmlns:wsdl="http://www.w3.org/@@@@/@@/wsdl" 
        xmlns:soap="http://www.w3.org/@@@@/@@/wsdl/soap" 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <wsdl:types>
                <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://example.w3c.org/Department">
                        <xsd:element name="getDepartmentsResponse">
                                <xsd:complexType>
                                        <xsd:sequence>
                                                <xsd:element name="Department" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"></xsd:element>
                                        </xsd:sequence>
                                </xsd:complexType>
                        </xsd:element>
                        <xsd:element name="getDepartmentsRequest">
                                <xsd:complexType></xsd:complexType>
                        </xsd:element>

                </xsd:schema>
        </wsdl:types>
        <wsdl:interface name="DepartmentInterface">
                <wsdl:operation name="getDepartments">
                        <wsdl:input body="tns:getDepartmentsRequest"></wsdl:input>
                        <wsdl:output body="tns:getDepartmentsResponse">
                                <wsdl:reference type="xsd:anyURI" interface="tns:DepartmentInterface"/>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:interface>
        <wsdl:binding name="DepartmentSOAPHTTPBinding" type="tns:DepartmentInterface">
                <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
                <wsdl:operation name="getDepartments">
                        <soap:operation soapAction="http://example.w3c.org/Department/getDepartments" />
                        <wsdl:input>
                                <soap:body use="literal" />
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal" />
                                <wsdl:reference type="xsd:anyURI" binding="tns:DepartmentSOAPHTTPBinding"/> 
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:binding name="DepartmentSOAPJMSBinding" type="tns:DepartmentInterface">
                <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/jms" />
                <wsdl:operation name="getDepartments">
                        <soap:operation soapAction="http://example.w3c.org/Department/getDepartments" />
                        <wsdl:input>
                                <soap:body use="literal" />
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal" />
                                <wsdl:reference type="xsd:anyURI" binding="tns:DepartmentSOAPJMSBinding"/> 
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="DepartmentService">
                <wsdl:endpoint name="SOAPHTTPPort" binding="tns:DepartmentSOAPHTTPBinding">
                        <soap:address location="http://www.w3c.org/Department/D001" />
                </wsdl:endpoint>
                <wsdl:endpoint name="SOAPJMSPort" binding="tns:DepartmentSOAPJMSBinding">
                        <soap:address location="jms:/queue?destination=jms/queue&amp;connectionFactory=jms/qcf&amp;targetService=Department/D001" 
/>
                </wsdl:endpoint>
        </wsdl:service>
</wsdl:definitions>

Arthur Ryman

[1] http://lists.w3.org/Archives/Public/www-ws-desc/2003Nov/0037.html
[2] http://lists.w3.org/Archives/Public/www-ws-desc/2003Nov/0041.html

Received on Wednesday, 5 November 2003 12:49:29 UTC