A proxy service defines virtual services hosted on the ESB that can accept requests, mediate them, and deliver them to an actual service. Proxy Services could perform transport or interface switching and expose different semantics than the actual service: WSDL, policies, and QoS aspects like WS-RM, WS-Security, etc. It can mediate the messages before they are delivered to the actual endpoint, and the responses before they reach the client. It is possible to list a combination of tasks to be performed on the messages received for the Proxy Service, and terminate the flow or send a message back to the client even without sending it to the actual service.
Follow the instructions below to add a new Proxy Service.
1. Sign in. Enter your user name and password to log on to the ESB Management Console.
2. Click on "Main" in the left menu to access the "Manage" menu.
3. In the "Manage" menu, click on "Proxy Service" under "Web Services."
4. The "Create Proxy Service from Template" page appears.
5. Select a template that suits your mediation requirements.
Tip
If you are looking to create an advanced Proxy Service or if none of the available templates matches your requirements, select the Custom Proxy option at the end of the templates list. This will launch the Proxy Service creation wizard, which enables you to customize all aspects of the proxy service including the sequences, endpoints, transport settings, WSDL options and other QoS settings.
The "Create Proxy Service from Template" page provides you the following set of built-in templates for creating and setting up Proxy Services:
- Pass Through Proxy - Allows to create a simple Proxy Service on a specified endpoint. The Proxy Service does not perform any processing on the messages that pass through the Proxy.
- Secure Proxy - Allows to create a Proxy Service with WS-Security engaged. The service will process WS-Security on incoming requests and forward them to an unsecured backend service.
- WSDL Based Proxy - Allows to create a Proxy Service out of a WSDL of an existing Web Service. Endpoint information is extracted from a remotely hosted WSDL of an actual service.
- Logging Proxy - Allows to create a Proxy Service which logs all the incoming requests and forwards them to a given endpoint. If the necessary responses coming back from the backend service can be logged before routing them to the client.
- Transformer Proxy - Allows to create a Proxy Service, which transforms all the incoming requests using XSLT and then forwards them to a given endpoints. If required responses coming back from the backend service can be transformed as well.
- Custom Proxy - Launches the Proxy Service creation wizard and creates a new Proxy Service from the scratch. Customize each and every aspect of the proxy including sequences, endpoints, transport and other QoS settings.
For example, if you wish to expose an existing service with WS-Security, you can choose the "Secure Proxy" option to create a Proxy Service with WS-Security enabled with a specified security policy. If you implement a scenario, where an existing service is exposed over a different schema (message format), you can make use of the "Transformer Proxy" option to setup easily a Proxy Service, which can transform requests and responses based on specified XSLT configurations.
Tip
Each template will show a limited set of controls, which allows the user to setup a Proxy Service easily. On successfully creating a Proxy Service, the user will be directed to the "Deployed Services" page.
6. Specify the options of a selected template. For the detailed information about specific options of Proxy Services see:
- Pass Through Proxy Template
- Secure Proxy Template
- WSDL Based Proxy Template
- Logging Proxy Template
- Transformer Proxy Template
- Custom Proxy Template
7. Specify common for all Proxy Service templates options. They are:
Publish WSDL Options
1. Select one of the "Publishing WSDL" options:
Specify in-line
If this option was chosen, you need to enter "Inline WSDL Definition."
Specify Source URL
If this option was chosen, you need to specify the source URI. URI consists of URL and URN. URL defines host address of network resource (can be omitted if resources are not network homed) and URN defines the resource name in local "namespaces."
For example: URL =ftp://ftp.dlink.ru/pub/ADSL
where: URL =ftp://ftp.dlink.ru URN = pub/ADSL
Tip
You can test the URI using the "Test URI" button.
If the URI was tested successfully, click "OK" in the "WSO2 Carbon" window to continue.
Pick From Registry
If this option was chosen, you need to choose a "Reference Key" from the Governance Registry or the Configuration Registry. For more information on the registry, see Registry.
2. Enter "Location" of the source and "Key" of a WSDL Resource. "Key" can be chosen from the Configuration Registry or the Governance Registry. For more information on the registry, see Registry.
2.1. To add a WSDL Resource, click on the "Add Resource" link and the Resource appears in the list below.
2.2. You can delete a WSDL Resource using the "Delete" button in the "Action" column.
Using publishWSDL option with auto generated jaxws web service WSDL
WSDLs auto generated via JAX-WS have an empty SOAPAction value. Therefore, message dispatching does not work when using such WSDLS. This issue has been solved in ESB 4.8.0 and later versions. You can do one of the following to overcome this in ESB 4.7.0 and ESB 4.6.0.
- Append the operation name to the endpoint URL when sending messages to the proxy service (e.g., http://serverName/app/serviceName/operationName).
- Modify the client level code to send the expected SOAPAction value.
- If the WSDL of the back end service has
""
as the SOAPAction value, you should modify the back end service to have a value other than""
for each operation. Note that there is a violation of the service contract by the client if the WSDL of the back end service has a SOAPAction value different to""
when the client sends""
as the SOAPAction value. This should be fixed on client level.
Transports
The "Transports" panel allows to select transports for a Proxy Service to use.
Note
Only enabled transports appear in the "Transports" list. For the detailed information see Transports.
See also WSO2 Carbon Transports.
8. Click on the "Create" button at the bottom of the page to create a new Proxy Service for all build-in templates.
Or click "Finish" to create a new custom Proxy Service.
9. A new Proxy Service appears in the "Proxy Service" list on the "Deployed Services" screen.