A client port type can be configured with ports that have different qualities of service. You can use the WebServicesClientBindPreferredPort command-line option to specify which port you want to use.
If you have not deployed the enterprise archive (EAR) file yet, you need to have it ready or already Deploying Web services applications onto application servers into WebSphere Application Server.
For more information about wsadmin options, review the Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands article.
You can use Jacl or Jython scripts, but this task assumes you are using Jacl. For more information about using scripting see the Getting started with scripting article.
For each port type that is configured, one or more ports are available that implement that port type. When a Web service client calls a getPort method, the preferred port mapping determines which port to use. This determination occurs when more than one port can satisfy the getPort method call, such as, a getPort call that specifies the port type, but not the port. For example, suppose the Web service client is configured to use both Java Message Service (JMS) and an HTTP implementation. During installation or management, you can use the WebServicesClientBindPreferredPort command to configure the preferred port of the application to use the transport of choice.
To configure the preferred port mapping with the wsadmin tool proceed with the following steps:
$AdminApp install app_name {-usedefaultbindings -deployejb -WebServicesClientBindPreferredPort {{module_name EJB_name Web_service port_type port_name}}The example shows multiple modules and URL endpoints, because you can edit multiple URL fragments where:
$AdminApp install MultiEjbJar.ear {-WebServicesClientBindPreferredPort {{ejbclientonly.jar Exchange service/StockQuoteService {http://stock.multiejbjar.test.wsfvt.ws.ibm.com}StockQuote {http://stock.multiejbjar.test.wsfvt.ws.ibm.com}StockQuote}...}}
The port type information that drives the creation of the WebServicesClientBindPreferredPort option data resides in the client WSDL file. Because valid preferred port mappings are restricted to ports that implement the interface of the port type, validation requires the implementation type of each port. The client WSDL file must be accessed to determine both the type and the implementation information.
The client WSDL file name is in the ServiceRef attribute of the Web service client deployment descriptor. Depending on the module type and version, the client deployment descriptor is located in either the application-client.xml file; the web.xml file, or the ejb-jar.xml file. If you are using J2EE 1.3, the client deployment descriptor information is located in the webservices.xml file.