WebServicesAdmin (AdminTask)
WebServicesAdmin commands can 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 (AdminTask) information.
getWebService
Retrieve the attributes for a web service. This command applies to enterprise applications only.
Target object: None.
Required parameters
- -application
- Name of the deployed enterprise application. (String, required)
- -module
- Name of the module. (String, required)
- -service
- Name of the web service. (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 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
Jython string...
AdminTask.getWebService('[-application application_name -module module_name -service webservice_name -client false]')Sample output:
'[[service {http://www.ibm.com}service1][type JAX-WS][client false]]'
Interactive mode
Using Jython:
AdminTask.getWebService ('-interactive')
listServices
Query 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 specified [[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. We can use one or multiple properties to specify your query criteria. Do not mix the query properties between different asset types. For example, if specified application and bus, the command reports an error.
- Specify the following properties with the -queryProps parameter to query enterprise applications:
-queryProps parameter for enterprise applications. Use
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. Specify the application and module properties to query for application modules.
- Specify the following properties with the -queryProps parameter to query for 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. 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:
to query all assets. Use these properties to query all
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:
for the -queryProps parameter to query service references. Use
Property and value Description serviceRef=serviceref_name Queries for a specific service reference.
We can also use an asterisk (*) as a wildcard character to specify to return all the service references under the matching service client.
- -expandResource
- Whether to return service names only or services and detailed resource information. Specify logicalEndpoint or operation. If we specify the logicalEndpoint value, the command returns the matching services and each endpoint in the services. If we specify the operation value, the command returns the matching services and the corresponding endpoints and operations. (String, optional)
- We can use the expandResource parameter to return detailed resource information for the endpoints and operations under the service reference.
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
The following examples query each service provider in the myApplication application. The examples return the logical endpoints for each service because the -expandResources parameter is set as logicalEndpoint, as the following example output demonstrates:
[ [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] ]Jython string...
AdminTask.listServices('[-queryProps [[application MyWSApplication][client false]] -expandResource logicalEndpoint]')Jython list:
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.
Using Jython string:
AdminTask.listServices('[-queryProps [[bus myBus][client true]] ]')
Using Jython list:
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.
Jython string...
AdminTask.listServices('[-queryProps [[client true] [application JaxWSServicesSamples] [module SampleClientSei.war] [serviceRef testRef] -expandResource logicalEndpoint]')Jython list:
AdminTask.listServices(['-queryProps', '[[application JaxWSServicesSamples][client true][module SampleClientSei.war] [serviceRef testRef]', '-expandResource', 'logicalEndpoint'])Sample output:
'[ [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
Using Jython:
AdminTask.listServices('-interactive')
listWebServices
Retrieve 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
- Name of the deployed enterprise application. If not specified, the command returns all web services in the cell. (String, optional)
- -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
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
Jython string:
AdminTask.listWebServices('[-application application1 -client false]')
Using Jython list:
AdminTask.listWebServices(['-application', 'application1', '-client', 'false'])
Sample output:
'[[service {http://www.ibm.com}service1][application application1][module webapp1.war][type JAX-WS][client false]]'
Interactive mode
Using Jython:
AdminTask.listWebServices('-interactive')
listWebServiceEndpoints
Return 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
- Name of the deployed enterprise application. (String, required)
- -module
- Name of the module. (String, required)
- -service
- Name of the web service. (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 logical endpoint name for the web service specified.
Batch mode example
Jython string:
AdminTask.listWebServiceEndpoints('[-application application_name -module module_name -service webservice_name -client false]')
Using Jython list:
AdminTask.listWebServiceEndpoints(['-application', 'application_name', '-module', 'module_name', '-service', 'webservice_name', '-client', 'false'])
Sample output:
'[[logicalEndpoint QuotePort01]]'
Interactive mode
Using Jython:
AdminTask.listWebServiceEndpoints('-interactive')
listWebServiceOperations
Return a list of web service operations. This command applies to enterprise applications only.
Target object: None.
Required parameters
- -application
- Name of the deployed enterprise application. (String, required)
- -module
- Name of the module. (String, required)
- -service
- Name of the web service. (String, required)
- -logicalEndpoint
- The port name in the 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
Jython string:
AdminTask.listWebServiceOperations('[-application application_name -module module_name -service webservice_name -client false -logicalEndpoint endpoint_name]')Using Jython list:
AdminTask.listWebServiceOperations(['-application', 'application_name', '-module', 'module_name', '-service', 'webservice_name', '-client', 'false', '-logicalEndpoint', 'endpoint_name'])
Sample output:
'[[operation ivt_app_op1][operation ivt_app_op2]]'
Interactive mode
Using Jython:
AdminTask.listWebServiceOperations('-interactive')
Related tasks
Use the wsadmin scripting AdminTask object for scripted administration Querying web services Commands (AdminTask)