WAS v8.5 > Reference > Commands (wsadmin scripting)

WebServicesAdmin command group for AdminTask

We can use the Jython or Jacl scripting languages to configure security with wsadmin. 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 AdminTask information.

The following commands are available for the WebServicesAdmin group of AdminTask:


getWebService

The getWebService command retrieves 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. Default 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

Jython string:

AdminTask.getWebService('[–application application_name -module module_name -service webservice_name
 -client false]')

Sample output:

Interactive mode example usage

Jython:


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 we 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. 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 we specify application and bus, the command reports an error.

  • Specify the following properties with the -queryProps parameter to query enterprise applications:

    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. Specify the application and module properties to query for application modules.

  • Specify the following properties with the -queryProps parameter to query for WSN clients:

    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. 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:

    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:

    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.

    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 usage

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.

Jython string:

Jython list:

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 example usage

Jython:


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

Name of the deployed enterprise application. If we do not specify this parameter, the command returns all web services in the cell. (String, optional)

-client

Whether the web service is a provider or a client. Default 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.

Jython string:

Jython list:

Sample output:

Interactive mode example usage

Jython:


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

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. Default 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.

Jython string:

AdminTask.listWebServiceEndpoints('[–application application_name -module module_name 
-service webservice_name -client false]')

Jython list:

AdminTask.listWebServiceEndpoints(['–application', 'application_name', '-module', 'module_name',
 '-service', 'webservice_name', '-client', 'false'])

Sample output:

Interactive mode example usage

Jython:


listWebServiceOperations

The listWebServiceOperations command returns 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 Web Services Description Language (WSDL) document. (String, required)

Optional parameters

-client

Whether the web service is a provider or a client. Default 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.

Jython string:

AdminTask.listWebServiceOperations('[–application application_name -module 
module_name -service webservice_name -client false
 -logicalEndpoint endpoint_name]')

Jython list:

AdminTask.listWebServiceOperations(['–application', 'application_name', '-module', 
'module_name', '-service', 'webservice_name', '-client',
 'false', '-logicalEndpoint', 'endpoint_name'])

Sample output:

Interactive mode example usage

Jython:


Related


Use the wsadmin scripting AdminTask object for scripted administration
Querying web services using wsadmin.sh


Reference:

Commands for AdminTask using wsadmin.sh


+

Search Tips   |   Advanced Search