WebServicesAdmin command group for the AdminTask object
You can use the Jython or Jacl scripting languages to configure security with the wsadmin tool. Use the commands in the WebServicesAdmin group to list all web services, service references and attributes, find attributes of a specific web service, determine the web service endpoint, and determine the operation name of a Web service.
Use the commands in the WebServicesAdmin group to query information for installed web services. For more information about the AdminTask object, see the Commands for the AdminTask object information.
getWebService
The getWebService command retrieves the attributes for a web service. This command applies to enterprise applications only.
Target object
None.
Required parameters
- -application
- Specifies the name of the deployed enterprise application. (String, required)
- -module
- Specifies the name of the module. (String, required)
- -service
- Specifies the name of the web service. (String, required)
Optional parameters
- -client
- Specifies whether the web service is a provider or a client. The default value is false (service provider). When set to true, the command only returns web service clients. (Boolean, optional)
Return value
Returns a list of attributes, including service name, whether the service is a provider or client, and service type. The service type attribute is only applicable for service providers.
Batch mode example usage
AdminTask.getWebService('[-application application_name -module module_name -service webservice_name
-client false]')
'[[service {http://www.ibm.com}service1][type JAX-WS][client false]]'
Interactive mode example usage
AdminTask.getWebService ('-interactive')
listServices
The listServices command queries the configuration for services, endpoints, and operations. This command provides more generic query functions than the rest of commands in this command group. It is applicable to Java™ applications as well as other assets such as Web Services Notification (WSN) clients.
Target object
None.
Optional parameters
- -queryProps
- Specifies properties used to locate the service provider or client
of interest. For example, if you specify [[type=JAX-WS][client=true]],
the command returns each JAX-WS client reference in the enterprise
applications. (Properties, optional)The -queryProps parameter accepts several properties. You can use one or multiple properties to specify your query criteria. Do not mix the query properties between different asset types. For example, if you specify application and bus, the command reports an error.
- Specify the following properties with the -queryProps parameter
to query enterprise applications:
Table 1. Properties for the -queryProps parameter for enterprise applications . Use these properties to query enterprise applications. Property and value Description assetType=J2EE Application Queries each Java EE application. application=application_name Queries a specific Java EE application. module=module_name Queries a specific Java EE application module. You must specify the application and module properties to query for application modules. - Specify the following properties with the -queryProps parameter
to query for WSN clients:
Table 2. Properties to query WSN clients . Use these properties to query WSN clients. Property and value Description assetType=WSN Service Queries each WSN service client. bus=bus_name Queries a specific bus. WSNService=WSN_service_name Queries a specific WSN service. You must specify the bus and WSNService properties to query for a specific WSN service. - Specify the following properties with the -queryProps parameter
to query all assets:
Table 3. Properties for the -queryProps parameter to query all assets . Use these properties to query all assets. Property and value Description serviceType=service_type Queries by service type. Specify JAX-WS to query for Java™ API for XML-Based Web Services assets. Specify JAX-WS (WSN) to query for Web Services Notification assets. client=Boolean Queries for clients or providers. Specify true to query for clients. Specify false to query for providers. service=service_name Queries for the logical endpoints and operations for a specific service. - Specify the following properties with the
-queryProps parameter to query all service references or a specific
service reference when
client=true
:Table 4. Properties for the -queryProps parameter to query service references . Use these properties to query all service references for service clients. Property and value Description serviceRef=serviceref_name Queries for a specific service reference.
You can also use an asterisk (*) as a wildcard character to specify to return all the service references under the matching service client.
- Specify the following properties with the -queryProps parameter
to query enterprise applications:
- -expandResource
- Specifies whether to return service names only or services and detailed resource information. Specify logicalEndpoint or operation. If you specify the logicalEndpoint value, the command returns the matching services and each endpoint in the services. If you specify the operation value, the command returns the matching services and the corresponding endpoints and operations. (String, optional)
Return value
The command returns a list of properties for each service, as well as detailed endpoint and operation information if you query for endpoints and operations.
Batch mode example usage
[ [service {http://www.ibm.com}EchoService] [assetType [J2EE Application]]
[client false] [application MyWSApplication] [module ServicesModule.war] [serviceType JAX-WS] ]
[ [assetType [J2EE Application]] [service {http://www.ibm.com}EchoService]
[client false] [application MyWSApplication] [module ServicesModule.war] [serviceType JAX-WS]
[logicalEndpoint EchoServicePort] ]
[ [service {http://www.ibm.com}PingService] [assetType [J2EE Application]]
[client false] [application MyWSApplication] [module ServicesModule.war] [serviceType JAX-WS] ]
[ [assetType [J2EE Application]] [service {http://www.ibm.com}PingService]
[client false] [application MyWSApplication] [module ServicesModule.war] [serviceType JAX-WS]
[logicalEndpoint PingServicePort] ]
AdminTask.listServices('[-queryProps [[application MyWSApplication][client false]] -expandResource
logicalEndpoint]')
AdminTask.listServices(['-queryProps', '[[application myApplication][client false]]', '-expandResource',
'logicalEndpoint'])
The following examples query each service client under the myBus bus. The examples do not return logical endpoints or operations for each service client because it does not specify the -expandResource parameter.
AdminTask.listServices('[-queryProps [[bus myBus][client true]] ]')
AdminTask.listServices(['-queryProps', '[[bus myBus][client true]]'])
The following examples query service references
with the name testRef
for each service client for
the JaxWSServicesSamples application. The examples return detailed
resource information for the logical endpoints or operations for each
service reference because the -expandResource parameter is specified.
AdminTask.listServices('[-queryProps [[client true] [application JaxWSServicesSamples] [module SampleClientSei.war]
[serviceRef testRef] -expandResource logicalEndpoint]')
AdminTask.listServices(['-queryProps', '[[application JaxWSServicesSamples][client true][module SampleClientSei.war]
[serviceRef testRef]', '-expandResource', 'logicalEndpoint'])
'[ [serviceRef testRef] [service {http://www.ibm.com}TestService] [assetType [J2EE Application]] [client true]
[application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
[ [serviceRef testRef] [module SampleClientSei.war] [serviceType JAX-WS] [client true]
[service {http://www.ibm.com}TestService] [assetType [J2EE Application]] [logicalEndpoint portA]
[application JaxWSServicesSamples] ]
[ [serviceRef testRef] [module SampleClientSei.war] [serviceType JAX-WS] [client true]
[service {http://www.ibm.com/}TestService] [assetType [J2EE Application]] [logicalEndpoint portB]
[application JaxWSServicesSamples] ]'
Interactive mode example usage
AdminTask.listServices('-interactive')
listWebServices
The listWebServices command retrieves a list of available web services for one or all applications. If an application name is not supplied, the command lists all of the web services. This command applies to enterprise applications only.
Target object
None.
Required parameters
None.
Optional parameters
- -application
- Specifies the name of the deployed enterprise application. If you do not specify this parameter, the command returns all web services in the cell. (String, optional)
- -client
- Specifies whether the web service is a provider or a client. The default value is false (service provider). When set to true, the command only returns web service clients. (Boolean, optional)
Return value
All web services for the application specified. For each web service, the command returns the following attributes and corresponding values: application name, module name, service name, whether the web service is a service provider or client, and service type. The service type is only specified if the web service is a service provider.
Batch mode example usage
AdminTask.listWebServices('[-application application1 -client false]')
AdminTask.listWebServices(['-application', 'application1', '-client', 'false'])
'[[service {http://www.ibm.com}service1][application application1][module webapp1.war][type JAX-WS][client false]]'
Interactive mode example usage
AdminTask.listWebServices('-interactive')
listWebServiceEndpoints
The listWebServiceEndpoints command returns a list of logical endpoints for a web service. The logical endpoint name is the port name in the Web Services Description Language (WSDL) document. This command applies to enterprise applications only.
Target object
None.
Required parameters
- -application
- Specifies the name of the deployed enterprise application. (String, required)
- -module
- Specifies the name of the module. (String, required)
- -service
- Specifies the name of the web service. (String, required)
Optional parameters
- -client
- Specifies whether the web service is a provider or a client. The default value is false (service provider). When set to true, the command only returns web service clients. (Boolean, optional)
Return value
Returns the logical endpoint name for the web service specified.
Batch mode example usage
AdminTask.listWebServiceEndpoints('[-application application_name -module module_name
-service webservice_name -client false]')
AdminTask.listWebServiceEndpoints(['-application', 'application_name', '-module', 'module_name',
'-service', 'webservice_name', '-client', 'false'])
'[[logicalEndpoint QuotePort01]]'
Interactive mode example usage
AdminTask.listWebServiceEndpoints('-interactive')
listWebServiceOperations
The listWebServiceOperations command returns a list of web service operations. This command applies to enterprise applications only.
Target object
None.
Required parameters
- -application
- Specifies the name of the deployed enterprise application. (String, required)
- -module
- Specifies the name of the module. (String, required)
- -service
- Specifies the name of the web service. (String, required)
- -logicalEndpoint
- The port name in the Web Services Description Language (WSDL) document. (String, required)
Optional parameters
- -client
- Whether the web service is a provider or a client. The default value is false (service provider). When set to true, the command only returns web service clients. (Boolean, optional)
Return value
Returns the operation name for the web service specified.
Batch mode example usage
AdminTask.listWebServiceOperations('[-application application_name -module
module_name -service webservice_name -client false
-logicalEndpoint endpoint_name]')
AdminTask.listWebServiceOperations(['-application', 'application_name', '-module',
'module_name', '-service', 'webservice_name', '-client',
'false', '-logicalEndpoint', 'endpoint_name'])
'[[operation ivt_app_op1][operation ivt_app_op2]]'
Interactive mode example usage
AdminTask.listWebServiceOperations('-interactive')