Skip to content

Publishing a Custom WSDL

When you create a proxy service, a default WSDL is automatically generated. You can access this WSDL by suffixing the service URL with ?wsdl. See the example given below, where the proxy service name is 'sample_service' and IP is localhost:


However, this default WSDL only shows the mediate operation. This can be a limitation because your proxy service may be exposing a back-end service that expects additional information such as the message format. Therefore, the proxy service should be able to publish a custom WSDL based on the back-end service's WSDL or a modified version of that WSDL. For example, if the back-end service expects a message that includes the name, department, and permission level, and you want the proxy service to inject the permission level as it processes the message, you could publish a WSDL that includes just the name and department without the permission level parameter.

Synapse configuration

Following is a sample proxy service configuration that we can used to implement this scenario. See the instructions on how to build and run this example.

<proxy name="StockQuoteProxy" startOnLoad="true" transports="http https" xmlns="">
            <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
    <publishWSDL uri="file:/path/to/sample_proxy_1.wsdl"/>

Build and run

The wsdl file sample_proxy_1.wsdl can be downloaded from sample_proxy_1.wsdl. The wsdl uri needs to be updated with the path to the sample_proxy_1.wsdl file

Set up the back-end service:

  1. Download the back-end service.
  2. Extract the downloaded zip file.
  3. Open a terminal, navigate to the axis2Server/bin/ directory inside the extracted folder.
  4. Execute the following command to start the axis2server with the SimpleStockQuote back-end service:


Create the artifacts:

  1. Set up WSO2 Integration Studio.
  2. Create an integration project with an ESB Configs module and an Composite Exporter.
  3. Create the proxy service with the configurations given above.
  4. Deploy the artifacts in your Micro Integrator.

Set up the SOAP client:

  1. Download and install SoapUI to run this SOAP service.
  2. Create a new SOAP project in the SoapUI using the following wsdl file:
  1. Use the getQuote operation.
  2. Enter the following payload. This will return a response containing the last sales price for the stock.

    <soapenv:Envelope xmlns:soapenv="" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
          <ser:getQuote xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">

You will receive the following response:

HTTP/1.1 200 OK
server: ballerina
content-encoding: gzip
content-type: application/xml
Transfer-Encoding: chunked
Connection: Keep-Alive

<soapenv:Envelope xmlns:soapenv="" xmlns:ns="http://services.samples" xmlns:ax21="http://services.samples/xsd">
         <ax21:name>IBM Company</ax21:name>