WSDL for Request-Callback Message Exchange - 6.1

Talend ESB Service Developer Guide

EnrichVersion
6.1
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
Installation and Upgrade
EnrichPlatform
Talend ESB

The Request-Callback message exchange is described in WSDL as two separate one-way exchanges.

The WSDL starts with a "Types" section followed by "message definitions". Additionally, it contains two "portType" definitions - one for the request from the consumer to the provider (Library) and one for the response from the provider (LibraryConsumer). The second callback portType contains two operations - one for a regular callback response and one for a callback fault response. Both operations (in LibraryConsumer) declare the Library portType operation as a "partnerOperation" element.

The WSDL used in this message exchange pattern additionally has a "partnerLink" definition, which declares the first portType (Library) as a "service" and the second (LibraryConsumer) as a "callback".

In the following WSDL, the request operation is called seekBookInBasement and that callback operation is called seekBookInBasementResponse:

Example of WSDL with request-callback exchange

<?xml version="1.0" encoding="UTF-8"?>
<definitions
  targetNamespace="http://services.talend.org/demos/Library/1.0"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:err="http://types.talend.org/demos/GeneralObjects/ErrorHandling/1.0"
  xmlns:jms="http://schemas.xmlsoap.org/wsdl/jms/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:svn="http://types.talend.org/demos/Library/Common/1.0"
  xmlns:tns="http://services.talend.org/demos/Library/1.0"
  xmlns:tmep="http://types.talend.com/mep/1.0"
  xmlns:sdx="http://types.talend.org/service/ServiceDescription/2.0"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <types>
        <!-- Refer to the Library example for the complete WSDL -->
        ......
        ......
    </types>
    <message name="seekBookRequest">
        <part element="svn:SearchFor" name="body" />
    </message>
    <message name="seekBookInBasementRequest">
        <part element="svn:SearchInBasementFor" name="body" />
    </message>
    <message name="seekBookResponse">
        <part element="svn:ListOfBooks" name="body" />
    </message>
    <message name="seekBookError">
        <part element="err:Exceptions" name="Exception" />
    </message>
     
 
    <portType name="Library">
        <operation name="seekBook">
            <input message="tns:seekBookRequest" />
            <output message="tns:seekBookResponse" />
            <fault message="tns:seekBookError" name="error" />
        </operation>
         
        <operation name="seekBookInBasement">
            <input message="tns:seekBookInBasementRequest" />
        </operation>
    </portType>
 
    <portType name="LibraryConsumer">
        <operation name="seekBookInBasementResponse"
            sdx:partnerOperation="seekBookInBasement">
            <input message="tns:seekBookResponse" />
        </operation>
        <operation name="seekBookInBasementFault"
            sdx:faultOperation="true" sdx:partnerOperation="seekBookInBasement">
            <input message="tns:seekBookError" />
        </operation>
    </portType>
 
    <plnk:partnerLinkType name="CallbackPartnerLink"
        xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
        <plnk:role name="service">
            <plnk:portType name="tns:Library" />
        </plnk:role>
        <plnk:role name="callback">
            <plnk:portType name="tns:LibraryConsumer" />
        </plnk:role>
    </plnk:partnerLinkType>
            
    <service name="LibraryProvider">
        <port binding="tns:LibraryJmsSoap" name="LibraryJmsPort">
            <soap:address
location="jms:jndi:dynamicQueues/library.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&jnd
iConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:61616" />
        </port>
    </service>
 
    <binding name="LibraryJmsSoap" type="tns:Library">
        <soap:binding style="document" 
                transport="http://www.w3.org/2010/soapjms/" />
        <operation name="seekBook">
            <soap:operation soapAction="seekBook" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
            <fault name="error">
                <soap:fault name="error" use="literal" />
            </fault>
        </operation>
     
        <operation name="seekBookInBasement">
            <soap:operation soapAction="seekBookInBasement" />
            <input>
                <soap:body use="literal" />
            </input>
        </operation>
    </binding>
 
    <service name="LibraryConsumer">
        <port binding="tns:LibraryConsumerJmsSoap" name="LibraryConsumerPort">
            <soap:address
location="jms:jndi:dynamicQueues/libraryconsumer.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&jnd
iConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:61616" />
        </port>
    </service>
 
    <binding name="LibraryConsumerJmsSoap" type="tns:LibraryConsumer">
        <soap:binding style="document" 
                transport="http://www.w3.org/2010/soapjms/" />
        <operation name="seekBookInBasementResponse">
            <soap:operation soapAction="seekBookInBasementResponse" />
            <input>
                <soap:body use="literal" />
            </input>
        </operation>
        <operation name="seekBookInBasementFault">
            <soap:operation soapAction="seekBookInBasementFault" />
            <input>
                <soap:body use="literal" />
            </input>
        </operation>
    </binding>
 
</definitions>

The LibraryConsumer service waits for callback responses from the service provider (listening to the ActiveMQ queue). The operations involved in the message exchange are: seekBookInBasement, seekBookInBasementResponse and seekBookInBasementFault.