Service Lookup via UDDI  Locate

WSO2 SOA Enablement Server for Java UDDI provides you with the ability to look up Web services registered in UDDI using UDDI Lookup Address (ULA). Service lookup via UDDI allows you to benefit from the features of the UDDI registry.

This type of lookup follows best practices and open recommendations. These principles can be used for any registry that support the Using WSDL in UDDI v2.0 best practice document.

[Important]Important

In order to be able to run WebServiceClient with UDDI lookup, one of these UDDI jar files must be added to classpath:

  • WASP_HOME/lib/uddi/uddiclient_api_v2.jar (when uddi-v2-key is used)

  • WASP_HOME/lib/uddi/uddiclient_api_v3.jar (when uddi-v3-key is used)

UDDI Lookup Address (ULA)  Locate

UDDI Lookup Address (ULA) has the following format:

wso2-uddi:[uddi-url]?(bindingKey|serviceKey)=uuidKey

where the following variables have been used:

Key to ULA format

  • wso2-uddi is a schema name.

  • uddi-url is the url of the inquiry port of a UDDI registry. If it is omitted, the default UDDI registry must be set in client configuration (see below), to be able to resolve the address.

  • The bindingKey or serviceKey keywords must be specified. The uuidKey is a replacement for the key of the bindingTemplate or businessService.

Examples of ULA:

  • wso2-uddi:?bindingKey=12345678-1234-1234-1234-123456789012

  • wso2-uddi:?serviceKey=12345678-1234-1234-1234-123456789012

  • wso2-uddi:http://www.wso2.com/uddi/inquiry?bindingKey=12345678-1234-1234-1234-123456789012

Additions to Client Code  Locate

In order for a client to use UDDI lookup, it must use ServiceClient directly, with dynamic proxy invocation (please see Overview: ServiceClient). It must also use the UDDI Lookup Address instead of a WSDL. The skeleton of such a client is shown in Example 83.

Example 83. UDDI Client Code

import org.systinet.wasp.webservice.ServiceClient; 

// UDDI Lookup Address instead of WSDL
address String url =
   "wso2-uddi:http://www.wso2.com/uddi/inquiry" + 
   "?bindingKey=4b72ead0-aca6-11d7-8552-b8a03c50a862";

// create factory of service proxies 
ServiceClient sc = ServiceClient.create(url); 

// create the proxy for the HelloService 
HelloService proxy = (HelloService)sc.createProxy(HelloService.class); 

// invoke service method
System.out.println( proxy.hello("World")); 

Changing the Default UDDI Server Address  Locate

If you want to change the default address of the UDDI server, you need to edit the UDDI transport deployment descriptor. The descriptor is located in the package.xml file of the package WASP_HOME/lib/uddi_transport.jar. Example 84 is such a UDDI transport deployment descriptor, with default values.

Example 84. UDDI Transport Deployment Descriptor

<transport name="uddi_transport"
               scheme="wso2-uddi"
               implementation-class="com.systinet.wasp.transport.uddi.UDDITransport"
               preload="false"
               xmlns:conf="http://wso2.com/wasp/uddi_transport">
    <conf:defaultUDDIInquiryUrl>
        http://www.wso2.com/uddi/inquiry
    </conf:defaultUDDIInquiryUrl>
</transport>