Ruddi uses the notion of "UDDI profile" in order to define the context of execution of an UDDI client/server interaction. An UDDI profile is basically a set of name/value pairs that instruct the Ruddi runtime on how it has to behave. The following code sample shows a typical Ruddi profile to interact with the UDDI registry of Microsoft using the UDDI 2.0 protocol:
UDDIProfile profile = new UDDIProfile();
profile.setProperty("inspireit.uddi.inquiry.url","http://uddi.microsoft.com/inquire");
profile.setProperty("inspireit.uddi.publishing.url","https://uddi.microsoft.com/publish");
profile.setProperty("inspireit.uddi.publishing.username","myusername");
profile.setProperty("inspireit.uddi.publishing.password","mypassword");
profile.setProperty("inspireit.uddi.version","2.0");
Note that different URLs are used for the publishing and discovery of services. When publishing new information or updating existing information, a username and password are required to authenticate to the UDDI registry, and HTTPS is used in order to encrypt the client/server interactions.
Once an UDDI profile has been created, an UDDIQuerier or an UDDIPublisher object can be obtained depending on whether a querying or a publishing operation will be performed:
UDDIQuerier querier = UDDIQuerier.getQuerier(profile);
UDDIPublisher publisher = UDDIPublisher.getPublisher(profile);
Name businessName = ... // the name of the business to search for
BusinessList businessList = querier.findBusiness(name);
BusinessEntity businessEntity = ... // the business entity to publish
BusinessDetail businessDetail = publisher.saveBusiness(businessEntity);
An UDDI registry response to a query or publish operation comes in the form of a data structure defined by the UDDI specification. For example, the response to a business entity search is a businessList UDDI data structure; the response to a business entity publication is a businessDetail UDDI data structure. Ruddi defines a dedicated Ruddi response class for each possible type of UDDI response data structure.
|
|
(c) INSPIRE IT, 2003 | Send us your feedback: developers@ruddi.biz