Examples of finding web services by specific geography, interface version, or organization
Web services are published to the Web Services Registry in BMC Helix CMDB. Client applications can query the registry for the list of services and retrieve the services' endpoints. In some cases, a query of the same service can return more than one service endpoint, such as installations of the same service at multiple sites.
To address this problem, the WSRegistryAPI supports criteria to disambiguate services:
- With the
publishService()
method, publish a service with criteria to disambiguate services endpoints. - With the
findServices()
method, query for services endpoints using disambiguation criteria.
These criteria can include one or more of the following types of information, which you can use in any combination.
- Geography — Physical location of the service's implementation, such as Singapore.
- Organization — Owner of the implementation, such as the R&D Department.
- QoS — Quality of Service of the service implementations, such as "best performing".
- Description — Descriptive information specified by the user that can help to disambiguate services, such as "implementation has bugs but generally works."
Note
The WSRegistryAPI uses the uddi-org:general_keywords
tModel in the UDDI Registry for storing the disambiguating criteria. You must assign a unique key name in the tModel for each criteria. For example, the predefined key name for the Geography criterion in the WSRegistryAPI is bmc.com:categorization:geography
.
The WSRegistryAPI comes with a test driver TestUDDIRegistry in the com.bmc.webservices.uddiapi.test
package.
You can use this test driver to publish and find service endpoints with disambiguating criteria.
To publish a service with disambiguation criteria, use the following syntax:
publish _BusinessName_ _ApplicationName_ _ServiceName_ _ServiceVersion ServiceInterfaceVersion_
" _ServiceDescription_
" _AccessPointUrl_ _WSDLUrl_ _CriteriaList_
The CriteriaList parameter is a list of comma-separated name-value pairs that is enclosed in parens ( ).
For example, you can specify the geography and organization criteria when you publish a service to the registry.
publish BMC_INC CMDB_APP CMDB_Service 1.1 1.0 "My CMDB Service"
http://myhost:8080/cmdbws/server/cmdbws
http://myhost:8080/cmdbws/server/cmdbws?wsdl=
(bmc.com:categorization:geography,Sunnyvale) (bmc.com:categorization:organization,ITSM)
To find a service with disambiguation criteria, use the follow syntax:
findsvc _BusinessName_ _ApplicationName_ _ServiceName_ _ServiceVersion
ServiceInterfaceVersion ApproximateMatch_ _CriteriaList_
The following example specifies the geography and organization criteria. For geography, the query includes only the letter S while a wildcard is used for the organization. If the service had more than one location that started with an S, then a more unique value is needed, such as Su.
findsvc BMC CMDB_APP CMDB_Service .* 1.* Y
(bmc.com:categorization:geography,S.) (bmc.com:categorization:organization,.*)
Examples of how to differentiate among multiple endpoints that implement the same interface of a given web service are explained as follows:
Example of finding web services by geography
In the following query, the geography criterion specifies Dublin and the organization criterion uses a wildcard to find all organizations.
$JAVA_HOME%\bin\java - Dbmc.wsregistry.uddiapi.home="%CLIENT_HOME%"
-Dbmc.wsregistry.username="admin" -Dbmc.wsregistry.password="admin"
-cp -.;%CLASSPATH%" com.bmc.webservices.uddiapi.test.TestUDDIRegistry
findsvc BMC ATRIUM_CORE atrium_business.* .* .* Y (bmc.com:categorization:geography,Dublin)
(bmc.com:categorization:organization,.*)
The results include only one service that is located in Dublin for one organization.
findServices() return
[com.bmc.webservices.uddiapi.impl.ServiceImpl@4ccfdd]
serviceArrayList[0]:
businessName = BMC
applicationName = ATRIUM_CORE
serviceName = atrium_businessobjects
serviceVersion = 8.1.00
serviceInterfaceVersion = 2.0
key = uddi:bmc.com:06f8d54e-a8dd-4254-94bc-7c9e1ad733dc
accessPointURL = http://dublinsrv:9090/ atriumbusinessobjects_porttype
wsdlAccessPointURL = http://dublinsrv:9090/atriumbusinessobjects_porttype?wdsl
criteriaList =
0:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:geography Dublin
1:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:organization BEM
Example of finding web services by interface version
The following query searches for all services with an interface version of 1.0 for all organization across all locations.
$JAVA_HOME%\bin\java - Dbmc.wsregistry.uddiapi.home="%CLIENT_HOME%"
-Dbmc.wsregistry.username="admin" -Dbmc.wsregistry.password="admin"
-cp -.;%CLASSPATH%" com.bmc.webservices.uddiapi.test.TestUDDIRegistry
findsvc BMC ATRIUM_CORE atrium_business.* .* 1.0 Y (bmc.com:categorization:geography,.*)
(bmc.com:categorization:organization,.*)
The results include two services with a 1.0 interface version for two locations, Houston and Sunnyvale.
findServices() return [com.bmc.webservices.uddiapi.impl.ServiceImpl@4ccfdd
com.bmc.webservices.uddiapi.impl.ServiceImpl@30d82d]
serviceArrayList[0]:
businessName = BMC
applicationName = ATRIUM_CORE
serviceName = atrium_businessobjects
serviceVersion = 7.5.00
serviceInterfaceVersion = 1.0
key = uddi:bmc.com:ab9b857c-ed08-497a-a4dc-83cf6f61ca42
accessPointURL = http://houstonsrv1:9090/ atriumbusinessobjects_porttype
wsdlAccessPointURL = http://houstonsrv1:9090/atriumbusinessobjects_porttype?wdsl
criteriaList =
0:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:geography Houston
1:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:organization REMEDY
serviceArrayList[1]:
businessName = BMC
applicationName = ATRIUM_CORE
serviceName = atrium_businessobjects
serviceVersion = 7.5.00
serviceInterfaceVersion = 1.0
key = uddi:bmc.com:c616c900-43f4-406c-a530-3b60f90ed0ef
accessPointURL = http://houstonsrv1:9090/ atriumbusinessobjects_porttype
wsdlAccessPointURL = http://houstonsrv1:9090/atriumbusinessobjects_porttype?wdsl
criteriaList =
0:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:geography Sunnyvale
1:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:organization REMEDY
Example of finding web services by organization
The following query searches for all services for the Remedy organization across all locations, as specified by a wildcard.
$JAVA_HOME%\bin\java - Dbmc.wsregistry.uddiapi.home="%CLIENT_HOME%"
-Dbmc.wsregistry.username="admin" -Dbmc.wsregistry.password="admin"
-cp -.;%CLASSPATH%" com.bmc.webservices.uddiapi.test.TestUDDIRegistry
findsvc BMC ATRIUM_CORE atrium_business.* .* .* Y (bmc.com:categorization:geography,.*)
(bmc.com:categorization:organization,REMEDY)
The results include two services for Remedy for two locations, Houston and Sunnyvale.
findServices() return [com.bmc.webservices.uddiapi.impl.ServiceImpl@4ccfdd
com.bmc.webservices.uddiapi.impl.ServiceImpl@30d82d]
serviceArrayList[0]:
businessName = BMC
applicationName = ATRIUM_CORE
serviceName = atrium_businessobjects
serviceVersion = 7.5.00
serviceInterfaceVersion = 1.0
key = uddi:bmc.com:ab9b857c-ed08-497a-a4dc-83cf6f61ca42
accessPointURL = http://houstonsrv1:9090/ atriumbusinessobjects_porttype
wsdlAccessPointURL = http://houstonsrv1:9090/atriumbusinessobjects_porttype?wdsl
criteriaList =
0:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:geography Houston
1:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:organization REMEDY
serviceArrayList[1]:
businessName = BMC
applicationName = ATRIUM_CORE
serviceName = atrium_businessobjects
serviceVersion = 7.5.00
serviceInterfaceVersion = 1.0
key = uddi:bmc.com:c616c900-43f4-406c-a530-3b60f90ed0ef
accessPointURL = http://houstonsrv1:9090/ atriumbusinessobjects_porttype
wsdlAccessPointURL = http://houstonsrv1:9090/atriumbusinessobjects_porttype?wdsl
criteriaList =
0:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:geography Sunnyvale
1:uddi:uddi.org:categorization:general_keywords bmc.com:categorization:organization REMEDY
Comments
Log in or register to comment.