Publishing WSDL files using wsadmin.sh
The WSDL files in each web services-enabled module are published to the file system location we specify. We can provide these WSDL files in the development and configuration process of web services clients so that they can invoke the web services.
Before publishing a WSDL file, we 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 WSDL file we need an enterprise application, also known as an EAR file, containing a Web services-enabled module and has been deployed into WebSphere Application Server. To learn more, see the deploying web services applications onto application servers information.
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, we might need WSDL files containing the updated endpoint information. We can obtain the updated WSDL files by publishing them to the file system. If we are a client developer or a system administrator, we 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.
Tasks
- Start the wsadmin tool from the command prompt using the following commands:
- (Windows) profile_root\bin\wsadmin
- (Linux) (iSeries) (ZOS) profile_root/bin/wsadmin
- At the wsadmin command prompt, enter one of the two commands:
- $AdminApp publishWSDLapp_name path_name
- $AdminApp publishWSDLapp_name path_name soapAddressPrefixes
where:
- app_name is the application name
- path_name is the absolute path to the compressed file containing the published WSDL files. The compressed file is saved on the machine that runs WAS, therefore, if the server is running on a different machine, we need to obtain the compressed file from that machine. The directory structure of the resulting compressed 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.- soapAddressPrefixes is a parameter of the form {{module {{binding partial-url}}}}. This parameter describes the partial URL information for each binding on a per-module basis for the application.
- module identifies the name of the module
- binding is either http or jms (both are in lowercase)
- partial-url 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=cforjms:/topic?destination=dest&connectionFactory=cf
Use the $AdminApp publishWSDL app_Name path_Name command to publish WSDL files with default endpoint URL addresses. To modify the SOAP address prefixes of the WSDL file, use the other form of the command.
Use the $AdminApp publishWSDL app_Name path_Name {{module {{binding partial-url}}}} command to customize the WSDL SOAP address for each module. We can specify a different address prefix for each SOAP binding.
The WSDL files from web services are published to a specified compressed file. The compressed file can be used to create a web service client that accesses the deployed service. The published WSDL files do not contain 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 compressed 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
Develop a web services client or configure the endpoint information for an existing web service.
Configure a service provider to share its policy configuration Developing a WSDL file for JAX-RPC applications Deploy web services applications onto application servers Making deployed web services applications available to clients Publishing WSDL files Configure endpoint URL information for HTTP bindings Configure endpoint URL information for JMS bindings Configure endpoint URL information to directly access enterprise beans