Discovering UDDI Services Sites

Note: The Microsoft UDDI SDK is not supported by or included in Microsoft Windows versions after Microsoft Windows Server 7. The Microsoft UDDI V3 SDK is included with Microsoft BizTalk Server. For more information about the Microsoft UDDI V3 SDK, see Microsoft BizTalk Server documentation

When using UDDI Services, it is possible to leverage Active Directory to discover the access points for the UDDI Services installations on your network. Subject to adequate permissions, these are automatically registered by UDDI Services during installation.

Accessing these details is possible using standard Active Directory query mechanisms, but the Find methods on the static UddiSiteDiscovery object provide a much simpler mechanism for retrieving these registrations, resulting in an array of UddiSiteLocation objects. Each UddiSiteLocation object includes the access points along with their authentication style and a description for the site.

Example Code

The following example shows you how to use the C# programming language to use the UddiSiteDiscovery class to execute the same FindBusiness request across all the registered UDDI Services sites.

try
{
    UddiConnection myConn;
    FindBusiness fb;
    BusinessList bizList;

// Discover all  the UDDI Services sites.
    UddiSiteLocation[] uSiteArray = UddiSiteDiscovery.Find();

// Go through the list of sites.
    foreach( UddiSiteLocation uddiSite in uSiteArray)
    {
// Create a connection to the current UDDI Services site.
        myConn = new UddiConnection(uddiSite.InquireUrl);

// Create an object to find a business.
        fb = new FindBusiness("Fabrikam");

// Send the FindBusiness request over the connection.
        bizList = fb.Send(myConn);

// Report the summary result.
        Console.WriteLine("Found {0} businesses at {1}",
            bizList.BusinessInfos.Count.ToString(),
            uddiSite.Description);
    }
}
catch (Microsoft.Uddi.UddiException e)
{Console.WriteLine("UDDI error: " + e.Message);}
catch (Exception gen)
{Console.WriteLine("General exception: {0}", gen.Message);}

By default, only the Windows authenticated access points will be retrieved. Also, by default and for performance reasons, only the inquiry and publish access points will be retrieved. Use of the AuthenticationMode and UddiSiteUrlType enumerations provides a greater level of control over the details that will be retrieved.

Example Code

The following example shows you how to use the C# programming language to retrieve the full set of access points for all registered sites that use the UDDI authentication, and then create a UddiConnection object with the authentication style and all of the access points set.

// Discover all of the UDDI Services sites.
UddiSiteLocation[] uSiteArray = UddiSiteDiscovery.Find(
UddiSiteUrlType.All,
AuthenticationMode.UddiAuthentication);

// Use the first set of locations to create a connection.
UddiConnection myConn = new UddiConnection(uSiteArray[0]);

Send comments about this topic to Microsoft.