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.
See the following topics try a custom WSDL for a proxy service:
Let's set up a sample proxy service in WSO2 Integration Studio.
- Install WSO2 Integration Studio. For instructions, see Installing WSO2 Integration Studio.
- Click this link to download the sample proxy service (StockQuoteProxy.xml).
Adding a custom WSDL to the proxy service
Follow the steps given below to add a custom WSDL to your proxy service.
- Open the proxy service from your tooling project.
- In the Properties tab, the WSDL type is set to NONE by default.
To publish a custom WSDL for this proxy service, select one of the WSDL types.
WSDL Type Description INLINE Enter the WSDL definition in the WSDL XML field. SOURCE_URL
Enter the URI of the WSDL in the text box, and then click Test URI to ensure it is available. A URI consists of a URL and URN. The URL defines the host address of the network resource (can be omitted if resources are not network homed), and the URN defines the resource name in local "namespaces."
If the WSDL is saved as a registry entry, select this option and choose the reference key of that registry entry from the governance Registry or configuration Registry.
If your WSDL has dependencies with other resources (schemas or other WSDL documents), you can link them using the Wsdl Resources property shown below. Click the browse icon and enter the registry key and the location of the dependent resource: The location is available in the WSDL. When you have the location, you can find registry key corresponding to the location from the registry.
In the following example, the WSDL imports a metadata schema from the metadata.xsd file. Therefore, the location is metadata.xsd.
In the following example, the WSDL is retrieved from the registry using the key
my.wsdl. This WSDL imports another WSDL from
. This dependent WSDL is retrieved from the registry using the
Go to the Service Parameters section in the Properties tab.
Following are additional service parameters you can use to configure the service WSDL.
If this parameter is set to
true, the original WSDL published via the
publishWSDLparameter is used instead of the custom WSDL.
If true (default), the port addresses will be modified to the current host. Effective only with
ApplicationXMLBuilder.allowDTD If this parameter is set to true, it enables data type definition processing for the proxy service.
Data type definition processing is disabled in the Axis2 engine due to security vulnerability. This parameter enables it for individual proxy services.
If this parameter is set to
truewhen deploying a proxy service, even though the WSDL is not available, you can prevent the proxy service from being faulty. However, the deployed proxy service will be inaccessible since the WSDL is not available.
This is only applicable when you publish the WSDL (i.e., via the
publishWSDLproperty) either as a URI or as an endpoint.
showAbsoluteSchemaURL If this parameter is set to
true, the absolute path of the referred schemas of the WSDL is shown instead of the relative paths.
showProxySchemaURL If this parameter is set to
true, the full proxy URL will be set as the prefix to the schema location of the imports in proxy WSDL.
Testing the custom WSDL
To test the custom WSDL:
- Deploy the proxy service in the ESB profile.
Copy the URL shown below to your browser: