The files referenced by the <wsdl-file> element in the webservices.xml file can or cannot import other Web Services Description Language (WSDL) or 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 referenced by the <wsdl-file> and its imported files are located at the same directory and copied to the wsdl/ directory for publishing purposes.
To publish a WSDL file through a URL, follow these steps: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, like http://example.com/services/stockquote. You can retrieve the outermost WSDL file (defined by the <wsdl-file> element within the webservices.xml file) by appending the string "/wsdl" or "/wsdl/" to the endpoint address, for example,http://example.com/services/stockquote/wsdl.
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