You can use the Jython or Jacl scripting language to query for web services properties 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.
The wsadmin administrative scripting program supports two scripting languages, Jacl and Jython. The Jacl syntax is deprecated. Examples written only in the Jython scripting language are included.
Before you can complete the procedure for the commands in the WebServicesAdmin group, you must launch the wsadmin tool.
Use the following commands to query for web services and web service attributes. If you receive a NoItemFoundException error, the specified application, module, service, or endpoint cannot be found. Verify that all parameters are correct.
You can optionally specify the client parameter for any command in the WebServicesAdmin command group. The client parameter indicates whether to return service providers or service clients. Specify false to request service providers and true to request service clients.
AdminTask.listWebServices()
This
command returns all installed web services. The command also returns
the application name, module name, service name, and service type
for each web service.'[ [service {http://www.ibm.com}service1] [client false] [application
application1] [module webapp1.war] [type JAX-WS] ]'
AdminTask.listWebServices('[–application application_name -client false]')
This
command returns all installed web services for the application_name that
you specify. The command also returns the application name, module
name, service name, and service type for each web service.'[ [service {http://www.ibm.com}service1] [client false] [application
application1] [module webapp1.war] [type JAX-WS] ]'
AdminTask.getWebService('[–application application_name
-module module_name -service webservice_name -client false]')
The
command returns the web service name and web service type.'[ [service {http://www.ibm.com}service1] [client false] [type JAX-WS] ]'
AdminTask.listWebServiceEndpoints('[–application application_name
-module module_name -service webservice_name -client false]')
This
command returns the port on which the web service is installed.'[logicalEndpoint QuotePort01]'
AdminTask.listWebServiceOperations('[–application application_name -module module_name
-service webservice_name -logicalEndpoint endpoint_name -client false]')
This
command returns all web service operations.'[operation ivt_app_op1] [operation ivt_app_op2]'
The listServices command provides generic query functions. Use the following command to display information about service providers, endpoints, and operations for enterprise applications and Web Services Notification (WSN) clients. Each parameter is optional. If you do not specify the queryProps parameter, the command returns each service provider in your configuration. If you do not specify the expandResources parameter, the command does not return the logical endpoints or operations for each service.
AdminTask.listServices('-queryProps "[[CompositionUnit=myApplication][client=false]" -expandResources endpoint']
AdminTask.listServices('[-queryProps "[[serviceType JAX-WS][client false]]"]')
This
command returns the service providers that match the search query.'[ [service {http://www.ibm.com}EchoService] [assetType [J2EE Application]] [client false]
[application WSSampleServicesSei]
[module SampleServicesSei.war] [serviceType JAX-WS] ]
[ [service {http://www.ibm.com}EchoService12] [assetType [J2EE Application]] [client false]
[application WSSampleServicesSei]
[module SampleServicesSei.war] [serviceType JAX-WS] ]
[service {http://www.ibm.com}PingService] [assetType [J2EE Application]] [client false]
[application WSSampleServicesSei]
[module SampleServicesSei.war] [serviceType JAX-WS] ]
[ [service {http://www.ibm.com}PingService12] [assetType [J2EE Application]] [client false]
[application WSSampleServicesSei]
[module SampleServicesSei.war] [serviceType JAX-WS]]'
Use the listServices command to learn about service references. You can use the serviceRef property with the queryProps parameter with the listServices command to query all service references or a specific service reference. This parameter is only applicable for service clients. If you specify an asterisk (*) as a wildcard as the name of the service reference, all of the service references for the matching service client are returned. You can also query a specific service reference by specifying the name of the service reference that you want. To return detailed service reference information for endpoints and operations, specify the expandResource property.
AdminTask.listServices('[-queryProps [[client true] [serviceRef *]]]')
This
command returns the service references that match the search query.'[ [service {http://www.ibm.com}EchoService] [assetType [J2EE Application]] [client true]
[application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
[ [service {http://www.ibm.com}EchoService12] [assetType [J2EE Application]] [client true]
[application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
[ [service {http://www.ibm.com}TestService] [assetType [J2EE Application]] [client true]
[application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
[ [serviceRef testRef] [assetType [J2EE Application]] [service {http://www.ibm.com}TestService]
[client true] [application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
[ [service {http://www.ibm.com}TestService2] [assetType [J2EE Application]] [client true]
[application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
[ [serviceRef testRef2] [assetType [J2EE Application]] [service {http://www.ibm.com}TestService2]
[client true] [application JaxWSServicesSamples] [module SampleClientSei.war] [serviceType JAX-WS] ]
AdminTask.listServices('[-queryProps [[client true] [application JaxWSServicesSamples]
[module SampleClientSei.war] [serviceRef testRef] -expandResource logicalEndpoint]')
This
command returns the specified service references for testRef and
the serviceRef property is included in each properties object; for
example: '[ [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] ]'
AdminTask.listServices('[-queryProps "[[serviceType [JAX-WS (WSN)]][clie
nt true]]" -expandResource logicalEndpoint]')
This command returns the service providers that match
the search query.'[ [service {http://www.ibm.com/websphere/wsn/out/remote-publisher}OutboundRemotePublisherService] [assetType [WSN Service]] [client true]
[bus bus1] [WSNService wsn1] [serviceType [JAX-WS (WSN)]] ]
[ [assetType [WSN Service]] [service {http://www.ibm.com/websphere/wsn/out/remote-publisher}OutboundRemotePublisherService]
[bus bus1] [client true] [WSNService wsn1] [serviceType [JAX-WS (WSN)]] [logicalEndpoint OutboundRemotePublisherPort] ]
[ [service {http://www.ibm.com/websphere/wsn/out/notification}OutboundNotificationService] [assetType [WSN Service]] [client true]
[bus bus1] [WSNService wsn1] [serviceType [JAX-WS (WSN)]] ]
[ [assetType [WSN Service]] [service {http://www.ibm.com/websphere/wsn/out/notification}OutboundNotificationService]
[bus bus1] [client true] [WSNService wsn1] [serviceType [JAX-WS (WSN)]] [logicalEndpoint OutboundNotificationPort] ]'