This documentation is for WSO2 ESB version 4.5.1. View documentation for the latest release.

Sample 56: WSDL endpoint

Objective: Demonstrate the use of WSDL endpoints

<definitions xmlns="http://ws.apache.org/ns/synapse">
    <sequence name="main">
        <in>
            <send>
                <!-- get epr from the given wsdl -->
                <endpoint>
                    <wsdl uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl" 
						  service="SimpleStockQuoteService" port="SimpleStockQuoteServiceSOAP11port_http"/>
                </endpoint>
            </send>
        </in>
        <out>
            <send/>
        </out>
    </sequence>
</definitions>

Prerequisites:

  • Start the Synapse configuration numbered 56: i.e. wso2esb-samples.sh -sn 56
  • Deploy the SimpleStockQuoteService and start the sample Axis2 server.

This sample uses a WSDL endpoint inside the send mediator. WSDL endpoints can extract endpoint's address from the given WSDL. As WSDL documents can have many services and many ports inside each service, the service and port of the required endpoint has to be specified. As with address endpoints, QoS parameters for the endpoint can be specified inline in the configuration. An excerpt taken from the sample_proxy_1.wsdl containing the specified service and port is listed below.

<wsdl:service name="SimpleStockQuoteService">
    <wsdl:port name="SimpleStockQuoteServiceSOAP11port_http"
               binding="axis2:SimpleStockQuoteServiceSOAP11Binding">
        <soap:address location="http://localhost:9000/services/SimpleStockQuoteService"/>
    </wsdl:port>
    <wsdl:port name="SimpleStockQuoteServiceSOAP12port_http"
               binding="axis2:SimpleStockQuoteServiceSOAP12Binding">
        <soap12:address location="http://localhost:9000/services/SimpleStockQuoteService"/>
    </wsdl:port>
</wsdl:service>

Specified service and port refers to the endpoint address "http://localhost:9000/services/SimpleStockQuoteService" according to the above WSDL. Now run the client using the following command.

ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280