Publish Web Services Description Language files through a URL

The files that are referenced by the <wsdl-file> element in the webservices.xml deployment descriptor file can or cannot import other Web Services Description Language (WSDL) or XML schema definition (XSD) files. Typically, all WSDL or XSD files are originally placed into the WEB-INF/wsdl directory when using Java beans. If your WSDL or XSD files are not placed in this directory, the file that is referenced by the <wsdl-file> element and its imported files are located in the same directory and copied to the wsdl directory for publishing purposes.

To publish a WSDL file through a URL, follow these steps:
  1. Retrieve the outermost WSDL file.
    The outermost WSDL file is the WSDL file defined by the <wsdl-file> element in the webservices.xml file.

    Each Web service has an endpoint address, such as http://example.com/services/stockquote, for example. You can retrieve the outermost WSDL file (defined by the <wsdl-file> element within the webservices.xml file) by appending the endpoint address with /wsdl or /wsdl/, for example, http://example.com/services/stockquote/wsdl.

  2. Retrieve the imported WSDL files.
    When the outermost WSDL file imports other WSDL or XSD files, these imported files can be retrieved by appending the relative path to the URL, which is used to retrieve the outermost WSDL file. This is also true for WSDL files that import other files. This process is similar to typical HTTP protocol. If an HTML document contains a hyperlink to other documents, the relative path is appended to create the URL to access the hyperlinked documents.

Example

Suppose you have an application with the following directory structure:

module-root/
  WEB-INF/
    webservices.xml
    web.xml
    ibm-webservices-bnd.xml
    jaxrpc-mapping-file
  wsdl/
    myServiceImpl.wsdl
    myService.wsdl
    myServiceTypes.xsd

If the SOAP address for the myService service is http://examples.com:9080/services/myService, you can retrieve the outermost WSDL with the this URL:

http://examples.com:9090/services/myService/wsdl

The URL is redirected to http://examples.com:9090/services/myService/wsdl/myServiceImpl.wsdl.

In this example, the myServiceImpl.wsdl file includes this <import> element:

<import namespace="http://examples.com/myService" location="a/b/myService.wsdl>

To obtain the myService.wsdl file, use this URL:

http://examples.com:9090/services/myService/wsdl/a/b/myService.wsdl