Publishing WSDL files using the wsadmin tool
The Web Services Description Language (WSDL) files in each Web services-enabled module are published to the file system location you specify. You can provide these WSDL files in the development and configuration process of Web services clients so that they can invoke your Web services.
Overview
Before you publish a WSDL file, you can configure Web services to specify endpoint information in the form of URL fragments to enable full URL specification of WSDL ports. Refer to the tasks describing configuring endpoint URL information.
To publish a Web Services Description Language (WSDL) file you need an enterprise application, also known as an enterprise archive (EAR) file, that contains a Web services-enabled module and has been deployed into WebSphere Application Server. See Deploying Web services based on Web Services for Java 2 platform, Enterprise Edition (J2EE).
Overview
The purpose of publishing the WSDL file is to provide clients with a description of the Web service, including the URL identifying the location of the service.
After installing a Web services application, and optionally modifying the endpoint information, you might need WSDL files containing the updated endpoint information. You can obtain the updated WSDL files by publishing them to the file system. If you are a client developer or a system administrator, you can use WSDL files to enable clients to connect to a Web service.
The wsadmin tool can publish the WSDL files in either local, for example, -conntype NONE, or remote mode. However, in local mode, locate the target application at the same node where the wsadmin command is invoked.
The following steps assume that the application has been deployed and that the application server is running.
To publish a WSDL file with the wsadmin tool:
- From a command prompt, start install_root\bin\wsadmin if you are using Windows or install_root/bin/wsadmin if you are using a UNIX or Linux system.
- At the wsadmin command prompt, enter one of the two commands:
where:
- $AdminApp publishWSDLapp_name path_name
- $AdminApp publishWSDLapp_name path_name {{module {{binding url-prefix}}}}
- app_name is the application name
- path_name is the absolute path to the zip file that contains the published WSDL files. The zip file is saved on the machine that runs WebSphere Application Server, therefore, if the server is running on a different machine, you need to obtain the zip file from that machine. The directory structure of the resulting zip file is based on the following information:
Application_file_name/module_file_name/META-INF/ or WEB-INF/wsdl/WSDL_file_nameSee the usage scenario for an example of this directory structure.
- binding is either http or jms (both are in lower case)
- url-prefix is the partial SOAP address for the associated SOAP binding. For an HTTP binding, the form is http://host:port/ or https://host:port.
For Java Message Service (JMS) bindings, the form is
jms:/queue?destination=dest&connectionFactory=cfor
jms:/topic?destination=dest&connectionFactory=cf
Use the $AdminApp publishWSDL app_Name path_Name command to update the WSDL SOAP address prefixes using the default values. If you want to modify the SOAP address prefixes of the WSDL file, use the other command, instead of the default values.
Use the $AdminApp publishWSDL app_Name path_Name {{module {{binding url-prefix}}}} command to customize the WSDL SOAP address for each module. You can specify a different address prefix for each SOAP binding.
Results
The WSDL files from Web services are published to a specified zip file. The zip file can be used to create a Web service client that accesses the deployed service. The published WSDL files do not contain enterprise JavaBean (EJB) binding information.
Example
The command to publish WSDL files for a Web service named WebServicesSamples can be $AdminApp publishWSDL WebServicesSamples c:/temp/samplesWsdl.zip
or
$AdminApp publishWSDL WebServicesSamples c:/temp/sampleswsdl.zip { {AddressBookJ2WB.war {{http http://localhost:9080}}} {StockQuote.jar {{http https://localhost:9443}}} }
The directory structure for this created zip file is
WebServicesSamples.ear/StockQuote.jar/META-INF/wsdl/StockQuoteFetcher.wsdl WebServicesSamples.ear/AddressBookW2JE.jar/META-INF/wsdl/AddressBookW2JE.wsdl WebServicesSamples.ear/AddressBookJ2WE.jar/META-INF/wsdl/AddressBookJ2WE.wsdl WebServicesSamples.ear/AddressBookJ2WB.war/WEB-INF/wsdl/AddressBookJ2WB.wsdl WebServicesSamples.ear/AddressBookW2JB.war/WEB-INF/wsdl/AddressBookW2JB.wsdl
What to do next
Apply security to the Web service.
Developing a WSDL file
Deploying Web services based on Web Services for J2EE
Publishing WSDL files
Publishing WSDL files using the administrative console
Configuring endpoint URL information for HTTP bindings
Configuring endpoint URL information for JMS bindings
Configuring endpoint URL information to directly access enterprise beans