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.Â
See the following topics try a custom WSDL for a proxy service:
Prerequisites
Let's set up a sample proxy service in WSO2 EI tooling.
- Install WSO2 EI Tooling. For instructions, see Installing Enterprise Integrator Tooling.
- 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 WSO2 EI 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."
For example URI =
 ftp://ftp.dlink.ru/pub/ADSL, w
here URL =Âftp://ftp.dlink.ru
 and URN =Âpub/ADSL Â
REGISTRY_KEY 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.
ENDPOINT - 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.
<xsd:import namespace=http://www.wso2.org/test/10 schemaLocation="metadata.xsd" />
In the following example, the WSDL is retrieved from the registry using the keyÂ
my.wsdl
. This WSDL imports another WSDL fromÂhttp://www.standards.org/standard.wsdl
. This dependent WSDL is retrieved from the registry using theÂstandard.wsdl
 registry key.<publishWSDL key="my.wsdl"> <resource location="http://www.standards.org/standard.wsdl" key="standard.wsdl"/> </publishWSDL>
Go to the Service Parameters section in the Properties tab.
Following are additional service parameters you can use to configure the service WSDL.
Parameter
Description
useOriginalwsdl
If this parameter is set to
true
, the original WSDL published via thepublishWSDL
parameter is used instead of the custom WSDL.modifyUserWSDLPortAddress
If true (default), the port addresses will be modified to the current host. Effective only with
useOriginalwsdl=true
.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. enablePublishWSDLSafeMode
If this parameter is set to
true
when 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
publishWSDL
property) 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: