Publishing WSDL files using a URL
Overview
Before you can publish a Web Services Description Language (WSDL) file using a URL, the Web services-enabled application should be installed and running.
The files referenced by the <wsdl-file> element in the webservices.xml deployment descriptor file can or cannot import other WSDL or XML schema definition (XSD) files. Typically, all WSDL or XSD files are originally placed into the META-INF/wsdl directory when using enterprise JavaBeans (EJBs) or the WEB-INF/wsdl directory when using Java beans. If your WSDL or XSD files are not placed in one of these directories, the file referenced by the <wsdl-file> element and its imported files are located at the same directory and copied to the wsdl/ directory for publishing purposes.
Note: EJB-based Web service applications must have an HTTP router or a Web module. Only HTTP URLs are supported for publishing.
Overview
To publish a WSDL file using a URL:
- Retrieve the outer-most WSDL file.The outer-most WSDL file is the WSDL file defined by the <wsdl-file> element in the webservices.xml deployment descriptor file.
Each Web service has an endpoint address, for example, http://example.com/services/stockquote. You can retrieve the outer-most WSDL file by appending the string with /wsdl or /wsdl/ to the endpoint address, for example,http://example.com/services/stockquote/wsdl.
You get a WSDL back that supports all SOAP protocols, including HTTP and JMS. EJB bindings are not included. To access WSDL files that include EJB bindings, use the /extwsdl URL suffix.
Note: If the WSDL file contains EJB bindings only, the /wsdl suffix URL displays an error message announcing there are no SOAP ports to publish.
- Retrieve the imported WSDL files.When the outer-most 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 outer-most WSDL file. This is also true for WSDL files that import other files. This process is similar to the use of relative hyperlinks in HypterText Markup Language (HTML) documents. 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 /* the <wsdl-file> element points to "WEB-INF/wsdl/fooImpl.wsdl"*/ web.xml ibm-webservices-bnd.xml wsdl/ fooImpl.wsdl /* imports foo.wsdl which is an interface wsdl */ foo.wsdl /* type definition for the interface */
If the SOAP address for the foo service is http://examples.com:9080/services/foo, the simple way to retrieve the foo service's outer-most WSDL is with the following form: http://examples.com:9090/services/foo/wsdl or http://examples.com:9090/services/foo/wsdl/. The URL is redirected to http://examples.com:9090/services/foo/wsdl/fooImpl.wsdl, where fooImpl.wsdl is the name of the outer-most WSDL file.
Since the fooImpl.wsdl file has the import <import namespace="http://examples.com/foo" location="a/b/foo.wsdl>, use the URL http://examples.com:9090/services/foo/wsdl/a/b/foo.wsdl to obtain the foo.wsdl file.
Developing a WSDL file
Publishing WSDL files using the administrative console
Publishing WSDL files using the wsadmin tool