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.
The getWebService command retrieves the attributes for a web service. This command applies to enterprise applications only.
Target object
None.
Required parameters
Optional parameters
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')
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
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. |
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. |
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. |
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. |
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')
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
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')
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
Optional parameters
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')
The listWebServiceOperations command returns a list of web service operations. This command applies to enterprise applications only.
Target object
None.
Required parameters
Optional parameters
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')