Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. On the Main tab in the Management Console, click Proxy Service.
    There are several templates available for creating a proxy service.
  2. Click Custom Proxy.
    The proxy service creation wizard appears.
    custom proxy service setup
  3. For the proxy service name, enter StockQuoteProxy.
  4. In the Publishing WSDL drop-down list, select Specify Source URL, enter the URL of the WSDL as file:./repository/samples/resources/proxy/sample_proxy_1.wsdl, and then click Test URI to validate the path.
    In the future, you can determine the WSDL of a running service using the ?wsdl operation.
    Publish WSDL
  5. Select the transports needed to expose the proxy service in the Transport Settings panel at the bottom of the page. For this example, leave the defaults set to make this proxy service available on both HTTP and HTTPS.
    Transport settings
    Note that you can also add service parameters to the proxy service. When the ESB starts, it initiates all proxy services that may need to fetch WSDLs associated with proxy services. If the ESB cannot locate those WSDLs during startup, it ignores them and continues.
  6. Click Next.
    You will now add a target endpoint to handle request messages.
  7. Under Define Endpoint, click Define Inline, and then click the Create button that appears.In sequence and endpoint options
  8. Click Address Endpoint.
    This will allow us to configure the endpoint by typing the URL of the service.
    Address endpoint
  9. Type the EPR of the target endpoint in the Address field as http://localhost:9000/services/SimpleStockQuoteService , leave the other fields unchanged, and click Save to add the endpoint to the proxy service.
    Configure address endpoint
  10. Back in the Step 2 screen, leave the In sequence empty and click Next.
    You will now add an Out sequence that will send the response messages back to the client.
  11. Under Define Out Sequence, click Define Inline, and then click the Create button that appears.
    define out sequence
  12. In the sequence editor, add the send mediator by clicking Add Child -> Core -> Send.
    Sequence editor
  13. Click Save, and then click Finish to save and quit the wizard.

    The newly created proxy service now appears on the Deployed Services screen. You can click the service's name to view its dashboard.

    Image Modified
  14. Click Enable Statistics so that you can collect statistics for this proxy service and view them in the next lesson.

You have finished configuring the sample and are ready to test the mediation.

Start the server
Anchor
StartServer2
StartServer2

...

This command sends a stock quote request to the provided transport endpoint (http://localhost:8280/services/StockQuoteProxy).The request passes through the proxy service to the backend server. Then, the backend server processes the request and sends the response back to the proxy service. The proxy service receives the message and uses the send mediator to forward it the response message back to the serverclient. The response from the server is displayed in on the console as follows: 

Standard :: Stock price = $165.32687331383468

You have now learned how to create a proxy service that intercepts messages and uses mediators to manipulate the messages before sending them to the server. In the next lesson, you will learn how to monitor the mediation and the ESB.