Web Service Description and Discovery Using UDDI, Part II
October 17, 2001
In our previous column, we had a visit from Karsten Januszewski of the Microsoft® UDDI team. Karsten gave an overview of what UDDI is, why it exists, and how to use it. In this article, we are going to show what we had to do to register the Cold Rooster Favorites Service with the Microsoft UDDI registry. Because we had never registered with UDDI before, we had to start at the very beginning.
Registering Yourself with UDDI
We had never registered Cold Rooster with the Microsoft UDDI site, so our first order of business was to create an account on that site. Account registration requires you to log in using Passport. Once you log in, you have the option of setting the UDDI contact e-mail address to the one tied to your Passport account, or to something else. I opted to tie this to the email@example.com address, since I would not be the only person utilizing UDDI on my team. We had already created this e-mail account for some other e-mail needs for Cold Rooster Consulting, so this seemed the logical choice.
Figure 1. UDDI administration page
Add Your Business to UDDI
After establishing our account on the Microsoft UDDI site, the next task was to add Cold Rooster Consulting to the UDDI registry. We could register our business through the Web page or through the UDDI API using the .NET SDK or the COM SDK. I chose to use the UI, because I intended to register everything only once. If we someday got into the habit of changing bits of the interface on a regular basis, we would automate this process to reduce the chance for errors. Adding the business to the registry enables users to find us based on what we do and the types of Web Services we provide. To add Cold Rooster Consulting to the UDDI registry, we went to the "Add a new business" link on the administration page (Figure 1). The first page asks for the Business name and description. For Cold Rooster, I entered:
Name: Cold Rooster Consulting
Description: Fictional company used by MSDN Architectural Samples Team
With the business added to the UDDI registry, I could now add more information:
- Contacts: People to contact who can help out with anything provided by the business. We added various members of the MSDN Architectural Samples team to the list of contacts.
- Services: The tModels (WSDL files) that this company exposes. We added the Account, Logon, and Report tModels to our UDDI entry.
- Identifiers: Pieces of data unique to this business, such as a company register listing number. Since Cold Rooster does not have one of these, we did not fill this out.
- Business classifications: These identify the location of the business, as well as what the business does. Cold Rooster Consulting is located in the state of Washington within the United States.
- Discovery URLs: This provides a location where details about the business can be found.
We will do the simpler items first and save the services for last.
Adding Contacts to UDDI
This is pretty simple. Like any other address form, you just fill in the general details for the various contacts. Based on the description and usage notes, potential users refer to this information to contact your company to license the Web Service, obtain support, or contact you about other business-related items. Figure 2 shows how the form looks for my contact information.
Figure 2. Contact details page
Classifying the Business
Most businesses can be classified by what they do. When classifying entities, a number of taxonomies are available for UDDI classification. You can use the following:
- North American Industry Classification System (NAICS-1997)
- Universal Standard Products and Services Codes (UNSPSC-7.03)
- ISO 3166 Geographic Taxonomy
- Standard Industrial Classification (SIC-1987)
- GeoWeb Geographic Classification
- UDDI Types Taxonomy
- We registered Cold Rooster under all of these taxonomies except for UDDI types. We did not register the business under the UDDI types taxonomy, because that particular taxonomy exists to classify tModel and service information.
- To know what we want to register, we have to look at what Cold Rooster does and where it is located. Cold Rooster Consulting is based in Redmond, Washington, USA. It provides project-based and supplemental staffing computer consulting services. Furthermore, it specializes in Windows and Internet-based development. Knowing all of this, we needed to appropriately classify the business in each of the six classification schemes. Table 1 shows how we classified the business for each scheme.
Classification Scheme Classification NAICS
- 541511: Custom Computer Programming Services
- 541512: Computer Systems Design Services
- 81.11.16.07.00: Programming for C or C++
- 81.11.16.03.00: Programming for HTML
- 81.11.16.01.00: Programming for Microsoft® Visual Basic®
- 188.8.131.52.00: Programming or Proprietary Languages (we do C# too)
- 81.11.21.06.00: Application Service Providers (we host Web Services)
- 81.11.21.03.00: World Wide Web (WWW) site design services
- US-WA (Washington, USA, World)
- 7371: Computer programming services
- 7372: Information retrieval services
GeoWeb Geographic Classification
- 518816 (Redmond, Washington, USA, North America, World)
Table 1. Sample UDDI classifications
Our business is now fully classified. The next step is to add the three tModels.
Adding the tModels
Just in case you missed last week's article, a tModel is a type model. For Web Services, tModels are typically synonymous with WSDL files. As such, they define the types used by the Web Service, as well as the message and operation definitions for the Web Service. Given a tModel, I know what Web Service operations are implemented by an entity implementing that tModel, and how to access those operations. You register your WSDL files as tModels because there may eventually be multiple implementations of these tModels.
The Server Side Favorites Web Service is composed of three Web Services: Logon, Account, and Report. The Logon Web Service allows a licensee to login and get a token. Using that token, the licensee can access the other methods in the Account and Report Web Services. To add the WSDL files, you need them deployed on a server that is reachable over the public Internet. This is also where you use the UDDI classification.
To add a tModel, just click on "Add a new tModel" from the administration page (Figure 1). You then need to add some basic information for the tModel: its name, a description, and where to locate the WSDL document. Once you do that, you then classify the tModel as a WSDL document and publish the information to the UDDI registry. It's all pretty simple. Figure 3 shows the details filled in for the Logon tModel.
Figure 3. Logon tModel details
On the next screen, you can add service classifications and business identifiers. This is the same data you could enter for the business information. As a service classification, we only used the UDDI classification. You will click through a series of links to specify this information:
- These types are used for tModels
- Specification for a Web Service
- Specification for a Web Service described in WSDL
- In registering Cold Rooster Favorites Service, I followed these steps for Logon.WSDL, Account.WSDL, and Report.WSDL. The UDDI registration was then completed and the information available in the registry.
Defining the Services
Once the tModels are in place, you still have to add the services to declare that these services exist. To do this, go back to the administration page and, this time, you will see your business listed under "Add a new business" (Figure 1). Select your business and scroll down to "Services." Here, click "Add a Service." On the first page you will fill in the Service detail. For the Logon Web Service, I filled in the following:
- Name: Logon
- Description: Validates licensee and provides an access token
Once that was done, I classified the Service once again as a "Specification for a Web Service described in WSDL." I then bound the Service to the Logon tModel that was already registered. In "Define a new binding," I filled in the fields as shown below:
- Access point: https://Coldrooster.com/SSF/Logon.asp
- URL type: http
- Description: Cold Rooster Consulting Logon Web Service endpoint
To finish this, I had to associate the Service with the Favorites Web Service: Logon tModel. Under Specification Signatures, select "Add specification signature." To look the model up by name, enter "Favorites Web Service." This will bring up all three of the tModels saved for the Favorites Service. Select "Favorites Web Service: Logon" and press "Continue." A Web page then appears on which you need to edit some more information about the endpoint. I filled in those fields as follows:
- Edit specification signature; Description: Cold Rooster implementation of the Favorites Web Service: Logon tModel
- Instance details; Parameters: http://msdn.microsoft.com/library/?url=/library/en-us/dncold/html/ssfapiref.asp?frame=true
- Instance details; Description: API Reference document
- Overview document; Document location: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncold/html/ssf1sec.asp
- Overview document; Description: Server Side Favorites Security information
With that filled in, I clicked "Continue" once more. I could then review all the information entered about the Logon service before returning to the main Business view of the data and publishing everything to the UDDI registry. I then repeated this process for both the Account and Report Web Services.
Finding the Data
Today (October 8, 2001) only one company is listed in Redmond according to the GeoWeb Taxonomy: Cold Rooster Consulting. I did another search, this time by ISO 3166 classification. This time, nine companies appeared. Other classifications brought up other totals. For the other classification schemes, I typically wound up with several pages of results.
Because the data is now discoverable, people interested in Web Services that store favorite URLs will theoretically flock to the Cold Rooster solution to use it. For those using Microsoft® Visual Studio® .NET, using UDDI to find the Web Service and add it to their project will be simple.
When you first go to the Add Web Reference dialog (ProjectAdd Web Reference), you are presented with a dialog that allows you to look for a Web Reference (also known as a WSDL file) through the Microsoft UDDI server. The endpoint used for Visual Studio is http://uddi.microsoft.com/visualstudio/. When I tell that endpoint to search for all businesses starting with "cold," it only finds the three Web Services I registered: Account, Logon, and Report. To add a Web Reference to the Logon Web Service, I just click "Logon" to expand the node, and then "Favorites Web Service: Logon" to view the WSDL. At this point, I click "Add Reference" and I am ready to Logon to the Favorites Web Service.
If you have been following along up to this point, but do not have a Favorites license, just go to the Favorites Service Admin Console and sign up for one. You should get your password sent back to you within 15-30 minutes. To connect to the Logon Web Service using Visual Basic, the code is this simple:
Sub Main() Dim svc As New com.coldrooster.www.Logon() System.Console.WriteLine(svc.Logon("LicenseeName", "Password")) System.Console.WriteLine("Press return to exit") System.Console.ReadLine() svc.Dispose() End Sub
This code prints out the GUID token used to gain access to the other methods available to the Favorites Web Service. The code for any of the other methods will be equally easy to write.
By registering your business, custom tModels, and Web Services with UDDI, you help developers all over the world to find your Web Services. The UDDI registry allows you to expose much more than Web Service endpoints and business data. The people using UDDI can also use the interface to find Web Service documentation and samples. Usage of the Microsoft UDDI registry is free. You are encouraged to register your Web Services and business in this registry. Please take some time and familiarize yourself with http://uddi.microsoft.com. You might try to find the Cold Rooster Consulting information and browse it to see all the information that is available. Finally, now would be a great time to use Visual Studio .NET to attach to the Favorites Service and do some experimenting of your own.
Next time, we will have a guest column from Allen Wagner. Allen will be discussing techniques for handling large SOAP messages.
At Your Service