Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

New SOA Capabilities in BizTalk Server 2009: UDDI Services (part 3) - Dynamic endpoint resolution via UDDI

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/20/2011 3:00:42 PM

Dynamic endpoint resolution via UDDI

Speaking of resolving, how do we actually call into a UDDI directory from code and discover information (including the endpoint) about a service? Let's take a look.

From within our command-line client application, we need to add a reference to the Microsoft.Uddi.dll. You should find this at C:\Program Files\Microsoft UDDI Services\SDK\Microsoft.Uddi.dll>. We'll first look at the scenario where you already know the service key for the service. What is the service key and how do you find that? On the Details page of your service in the directory, there is a More Details link which opens up a window containing both the UDDI V2 and V3-compatible keys.

Armed with this exciting piece of information, we're ready to look up our service. In the code below, you should see that I have a reference to the UDDI library, and have created a connection that points to the query service URI provided by the UDDI Services. Next, I ask for the details of the service based on the key and connection I've provided.

using Microsoft.Uddi3;
UDDIdynamic endpoint resolutionusing Microsoft.Uddi3.Extensions;
using Microsoft.Uddi3.Services;
...
UddiConnection conn =
new UddiConnection("http://localhost/uddi/inquire.asmx");
GetServiceDetail getDetails =
new GetServiceDetail("uddi:f1032d83-9469-4d3b-8a03-93fe606cd34f ");
ServiceDetail details = getDetails.Send(conn);


Once we have the service details in response, we are capable of discovering all sorts of things about our service.

//add pointer to target service
BusinessService service = details.BusinessServices[0];
Console.WriteLine("Service Name: " + service.Names[0].Text);
Console.WriteLine("Access Point: " +
service.BindingTemplates[0].AccessPoint.Text);
KeyedReferenceCollection categories =
service.BindingTemplates[0].CategoryBag.KeyedReferences;
Console.WriteLine("** Categories **");
foreach (KeyedReference catKey in categories)
{
Console.WriteLine("Category Name: " + catKey.KeyName);
Console.WriteLine("Category Value: " + catKey.KeyValue);
}
Console.ReadLine();

The result of this block of code reveals all of the entries we added to our UDDI directory just a short time ago.

Now what if we don't know the service key? Fortunately for us, the UDDI service API also provides a query interface. If we want to search by service name, or by a set of categories we can.

Console.WriteLine("Calling UDDI query lookup service");
UddiConnection conn =
new UddiConnection("http://localhost/uddi/inquire.asmx");
FindService serviceQuery =
new FindService("BatchMasterService");
ServiceList queryResult = serviceQuery.Send(conn);

string key = queryResult.ServiceInfos[0].ServiceKey;
Console.WriteLine("Service key: " + key);
Console.ReadLine();

When this code runs, we get back a key corresponding to our service in the registry.

The query scenario is useful if you want to do runtime resolution of a service within a given environment (say, production) and enable the UDDI administrators to re-point users to available services if the primary service is down. An administrator could perform this task by simply changing UDDI category values.

Other -----------------
- Active Directory Domain Services 2008 : Reset the Credentials That Are Cached on a Read-only Domain Controller
- Active Directory Domain Services 2008 : Pre-populate the Password Cache for Read-only Domain Controller
- Active Directory Domain Services 2008 : Automatically Move Accounts That Have Been Authenticated by an RODC to the Allowed List
- Active Directory Domain Services 2008 : Review Accounts That Have Been Authenticated on a Read-only Domain Controller
- Windows Server 2008 R2 : Server-to-Client Remote Access and DirectAccess - VPN Protocols
- Windows Server 2008 R2 : Authentication Options to an RRAS Systema
- VPN in Windows Server 2008 R2
- Routing with Windows Server 2003 : Configuring Demand-Dial Routing (part 2) - Deploying a Demand-Dial Router-to-Router Configuration & Troubleshooting Demand-Dial Routing
- Routing with Windows Server 2003 : Configuring Demand-Dial Routing (part 1) - Configuring Demand-Dial Interfaces
- Exchange Server 2010 : Troubleshooting DNS Problems
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server