[From http://www.alphaworks.ibm.com/tech/be4ws, distribution.]


How to Write USML?

1. USML Introduction

USML is an aggregation of different search queries that searches the UDDI registries for multiple criteria. A search could be made for Businesses, Service and Service Types matching the different criteria specified by a user. Service Type is called tModel in UDDI. A tModel specifies information such as the tModel name, the name of the organization that published the tModel, a list of categories that describe the service type, and pointers to technical specifications for the service type such as interface definitions, message formats, message protocols, and security protocols. tModel is essentially a technical “fingerprint” unique to a particular specification. USML sample has the following structure:

UDDISearch.xml

 

<?xml version="1.0"?>

<!DOCTYPE Search SYSTEM "UDDISearch.dtd">

<Search>

                <Query>

                                <Source>Public UDDI</Source>

                                <SourceURL>http://www-3.ibm.com/services/uddi/inquiryapi</SourceURL>

                                <BusinessName>IBM</BusinessName>

                                <FindBy>Business</FindBy>

                </Query>

                <Query>

                <Source>Public UDDI</Source>

                                <SourceURL>http://uddi.microsoft.com/inquire</SourceURL>

                                <ServiceTypeName>uddi</ServiceTypeName>

                                <FindBy>ServiceType</FindBy>

                </Query>

                <Query>

                                <Source>Public UDDI</Source>

                                <SourceURL>http://uddi.microsoft.com/inquire</SourceURL>

                                <BusinessName>Microsoft</BusinessName>

                                <ServiceName>UDDI</ServiceName>

                                <FindBy>Service</FindBy>

                </Query>

            <AggOperator>AND</AggOperator>

            <RequestTypeName>Business</RequestTypeName>

 </Search>

 

 

UDDISearch.dtd

 

<!ELEMENT UDDISearch (Query+,AggOperator, RequestTypeName)>

<!ELEMENT Query (Source,SourceURL?,BusinessName?,Identifier?,Category?, ServiceName?,ServiceTypeName?,DiscoveryURL?, FindBy)>

 

<!ELEMENT Source (#PCDATA)>

<!ELEMENT SourceURL (#PCDATA)>

<!ELEMENT FindBy (#PCDATA)>

<!ELEMENT Keyword (#PCDATA)>

<!ELEMENT Identifier (#PCDATA)>

<!ATTLIST Identifier type (D-U-N-S|ThomasRegister) #REQUIRED>

 

<!ELEMENT Category (#PCDATA)>

<!ATTLIST Category type (NAICS|UNSPSC|GEO|UDDITYPE|SIC) #REQUIRED>

 

<!ELEMENT ServiceName (%PCDATA)>

<!ELEMENT ServiceTypeName (#PCDATA)>

<!ELEMENT DiscoveryURL (#PCDATA)>

 

<!ELEMENT AggOperator (#PCDATA)>

 

<!ELEMENT RequestTypeName (#PCDATA)>

Document Type Definition (DTD) is a structural description of an XML document. It defines the elements an XML document can have, their attributes, their values and so on. A valid XML document must conform to the specified DTD.

Thus we can search by Businesses, Services and Service Types. We specify the source UDDI and the associated URL to be searched into. In case the URL is not specified, default URL associated with the Source name is taken from the configuration file where the Source UDDI names are mapped with their URLs. Configuration file helps in storing large number of URLs associated with various UDDI Registries. New registries can be easily added in this file at later stages without the need to modify rest of the code using this file.

config.xml

Config.dtd

<?xml version="1.0"?>

<!DOCTYPE Registries SYSTEM "config.dtd">

<Registries>

     <Registry>

                <Name>Microsoft UDDI</Name>                    <URL>http://uddi.microsoft.com/inquire</URL>

     </Registry>

     <Registry>

                <Name>Private UDDI</Name>                          <URL>http://127.0.0.1/servlet/uddi</URL>

     </Registry>

     <Registry>

                <Name>Public UDDI</Name>

                <URL>http://www-w3.ibm.com/services/uddi/testregistry/inquiryapi</URL>

                </Registry>

</Registries>

<!ELEMENT Registries (Registry*)>

<!ELEMENT Registry (Name,URL)>

<!ELEMENT Name (#PCDATA)>

<!ELEMENT URL (#PCDATA)>

1.1 Search for Business   

We can search for Businesses using any combination of Keyword, Identifier, Locator, Service Type, and Discovery URL. Only businesses that match ALL of the criteria specified are returned. At least one of the search criteria should be mentioned.

1.1.1 Searching by BusinessName

Specify the name of the business you are looking for in the “BusinessName” tag. The businesses with names that start with the characters you entered will be returned. In the USML sample above, search is for the Businesses that start with IBM and hence IBM is written in the BusinessName tag. 

1.1.2                Searching by Identifier

 A UDDI Registry allows entities to be annotated with information that uniquely identifies them. Formal identifiers such as Dun & Bradstreet numbers and Thomas Register numbers are fully supported. To search using an identifier, specify the type of identifier in the attribute of the “Identifier” tag and write a value for the identifier.

1.1.3                Searching by Category

A UDDI Registry allows entities to be classified using categorization taxonomies such as North American Industry Classification System (NAICS), Universal Standard Products and Services Classification (UNSPSC), and Geographic (GEO). These classification taxonomies are generically known as 'Locators'. To search using a locator, first specify the type of locator in the attribute of the “Category” tag and then write a value for the category.

1.1.4                Searching by Discovery URL

A Discovery URL represents the address of URL-addressable discovery documents that contain information about a business registered in the UDDI Registry. To search using a discovery URL, specify a value into the “DiscoveryURL” tag. Businesses with discovery URLs that start with the characters you entered will be returned.

1.2 Search for Service

We can search for Service using combination of ServiceName and Category. Only services that match ALL of the criteria specified are returned. At least one of the search criteria should be given. Since business services depend on business entities, it is virtually impossible to search business services without specifying business names. If searching for business services without business names is necessary, there is a need to retrieve ALL business entities registered with a public UDDI or private UDDI, a task taking too much time. Based on the above consideration, users must also specify the business names for business service search.

1.2.1                Searching by ServiceName

Specify the name of the service you are looking for in the “ServiceName” tag. The business services with names that start with the characters you entered will be returned.

1.2.2                Searching by Category

 In order to search the services using a category, first specify the type of category in the attribute of the “Category” tag and write a value for the “Category” element.

1.3 Search for Service Type

Search for Service Types using any combination of ServiceTypeNameand Category is provided. Only Service Types that match ALL of the specified criteria are returned. At least one of the search criteria should be given.

1.3.1                Searching by ServiceTypeName

Specify the name of the service type you are looking for in the “ServiceTypeName” tag. The service types with names that start with the characters you entered will be returned.

1.3.2                Searching by Category

In order to search using a category, first specify the type of category in the attribute of the “Category” tag and write a value for the category. For example, if you want to search for service type that start with S and having category as “NAICS”, you must put “NAICS” in the “type” attribute of the Category tag in the USML, and the value “S” for the tag.

 

2. USML Construction

UDDISearch.dtd specifies the search criteria. The following is the description of each XML element.

There are three basic types of searches for one query: search by name (BusinessName, ServiceName, or ServiceTypeName. The name search is partial match (meaning that the name beginning with the specified value is matched), search by identifier, and search by category. It is possible to combine these basic types. The relationship among these basic types is "AND" if more than one types are specified.

"AggOperator" specifies the logic relationship among queries. "AggOperator" has two values in the current design and implementation: "OR" or "AND". If "OR" is specified, all information specified in "FindBy" of each Query is returned. Unlike "AND", "OR" allows as many queries as possible. If "AND" is specified, only information related to the data type specified in RequestTypeName is returned. No more than 3 queries (one query for one data type) are allowed.

"RequestTypeName": Specify the data type name to be returned.

 

3. Aggregation Operators

 

The “AggOperator” can take different values such as AND, OR or it may be a function which involves a script to perform a task. Currently, only “AND” and “OR” are supported. The Script operator will be supported in the next release. The results from different UDDI registries maybe be required to be aggregated depending on these operators. If the response contains redundant information, it can be filtered by the use of such operators.

Every Business is associated with a business key and every Service has a service key. Thus these operators help to combine the results of different keys and eliminate the repetitive information based on the same key.

 

3.1 OR Search Criteria

 

If we have to search in the UDDI Registry for any business say starting with “IBM” and any service starting with “Web”, we have to make 2 separate requests: one for the business and one for the service.  A part of the response received after one call could be:

 

<?xml version="1.0"?>

<!DOCTYPE USMLResponse SYSTEM "USMLResponse.dtd">

<USMLResponse>

                <Business>

                                <BusinesName>IBM Corporation</BusinessName>

                                <BusinessKey>d2033110-3aaf-11d5-80dc-002035229c64d2033110-3aaf-11d5-80dc-002035229c64</BusinessKey>

                                <Description>At IBM, we strive to lead in the creation, development and manufacture of the industry's most advanced information technologies, including computer systems, software, networking systems, storage devices and microelectronics.</Description>

                                <URL>http://www.ibm.com/services/uddi/uddiget?businessKey=D2033110-3AAF-11D5-80DC-002035229C64</URL>

                                <URL>http://www-3.ibm.com/services/uddi/uddiget?businessKey=D2033110-3AAF-11D5-80DC-002035229C64</URL>

                                <Operator>www.ibm.com/services/uddi</Operator>

                </Business>

                <Business>

                                <BusinesName>IBM WSTK Tutorial</BusinessName>

                                <BusinessKey>fdfdbba0-a7d3-11d5-a30a-002035229c64fdfdbba0-a7d3-11d5-a30a-002035229c64</BusinessKey>

                                <Description>IBM WSTK Tutorial</Description>

                                <URL>http://www-3.ibm.com/services/uddi/uddiget?businessKey=FDFDBBA0-A7D3-11D5-A30A-002035229C64</URL>

                                <Operator>www.ibm.com/services/uddi</Operator>

                </Business>

                . . .

                <Service>

                                <ServiceName>Web Services</ServiceName>

                                <ServiceKey>B4EEE181-6BEF-43B6-BAA1-D760610EF2AB</ServiceKey>

                                <Description>Create,  Maintain, and Host Websites</Description>

                                <URL>mailto:dksibert@webdks.com</URL>

                                <AccessPoint>mailto</AccessPoint>

                                <Operator>www.ibm.com/services/uddi</Operator>

                </Service>

                <Service>

                                <ServiceName>Web design and hosting</ServiceName>

                                <ServiceKey>DF9BD28F-39CC-492C-9E1A-F4E12E77457C</ServiceKey>

                                <Description>Web site design and hosting in France</Description>

                                <URL>www.noname.fr</URL>

                                <AccessPoint>http</AccessPoint>

                                <Operator>www.ibm.com/services/uddi</Operator>

                </Service>

                . . .

</USMLResponse>

 

 

 

Request for a service type or another service or a business would require different calls, thus increasing the searching time and effort.

 

3.2 AND Search Criteria

 

With the help of USML we can combine our search criteria into one request and thus get efficiency in our system by just making one call for all the desired criteria. If we search for the service types starting with “Web” and these service types must be used by businesses whose names starting with “White”, we are able to specify two queries: one for service type and one for business. We use “AND” as the AggOperator tag and requires the Service Type to be returned. We would get the required result as:

 

<?xml version="1.0"?>

<!DOCTYPE USMLResponse SYSTEM "USMLResponse.dtd">

<USMLResponse>

                <ServiceType>

                                <ServiceTypeName>Web home page</ServiceTypeName>

                                <ServiceTypeKey>uuid:2140e3bd-5640-4bd7-936b-d09d67455ec2</ServiceTypeKey>

                                <Description></Description>

                                <OverviewURL></OverviewURL>

                                <Operator>Microsoft Corporation</Operator>

                </ServiceType>

                <ServiceType>

                                <ServiceTypeName>Web home page</ServiceTypeName>

                                <ServiceTypeKey>uuid:2140e3bd-5640-4bd7-936b-d09d67455ec2</ServiceTypeKey>

                                <Description></Description>

                                <OverviewURL></OverviewURL>

                                <Operator>Microsoft Corporation</Operator>

                </ServiceType>

                <ServiceType>

                                <ServiceTypeName>Web home page</ServiceTypeName>

                                <ServiceTypeKey>uuid:2140e3bd-5640-4bd7-936b-d09d67455ec2</ServiceTypeKey>

                                <Description></Description>

                                <OverviewURL></OverviewURL>

                                <Operator>Microsoft Corporation</Operator>

                </ServiceType>

                <ServiceType>

                                <ServiceTypeName>Web home page</ServiceTypeName>

                                <ServiceTypeKey>uuid:2140e3bd-5640-4bd7-936b-d09d67455ec2</ServiceTypeKey>

                                <Description></Description>

                                <OverviewURL></OverviewURL>

                                <Operator>Microsoft Corporation</Operator>

                </ServiceType>

                <ServiceType>

                                <ServiceTypeName>Web home page</ServiceTypeName>

                                <ServiceTypeKey>uuid:2140e3bd-5640-4bd7-936b-d09d67455ec2</ServiceTypeKey>

                                <Description></Description>

                                <OverviewURL></OverviewURL>

                                <Operator>Microsoft Corporation</Operator>

                </ServiceType>

                <ServiceType>

                                <ServiceTypeName>Web home page</ServiceTypeName>

                                <ServiceTypeKey>uuid:2140e3bd-5640-4bd7-936b-d09d67455ec2</ServiceTypeKey>

                                <Description></Description>

                                <OverviewURL></OverviewURL>

                                <Operator>Microsoft Corporation</Operator>

                </ServiceType>

</USMLResponse>

 

 

 

Thus the “AND” operator is an indicator to aggregate the resulst obtained from the user’s multiple criteria requests. The above example is the “AND” of two data types: Service Type and Business.

 

According to the UDDI specification, there are three core data types that can be queried against: business, service, and service type (tModel). If the aggregation operator is “AND”, the user is required to fill in the value for “RequestTypeName” that specifies one of the three core data types to be returned.  For example, if “RequestTypeName” is business, and three queries are specified in an XML document: one for business, one for service, and one for service type, only business information that meets all the requirements specified in these three queries is returned.

 

There are nine possible combinations of “AND” query. If we use “Type” to refer to “Service Type”, and the first part of the following names as “RequstTypeName”, we should have: 

The semantics of “AND” is easy to understand. For each “AND” query, the intersection of keys got from subqueries must not be empty. For example, if we use the combination “TypeBusiness”, the returned service type must be used by at least one business specified in the query for “Business”.