WSDL2UDDI v3  Locate

The Oracle Service Registry WSDL2UDDI demo set is used to demonstrate the Oracle Service Registry WSDL2UDDI application programming interface's capabilities and to show how to use this API. The Oracle Service Registry WSDL2UDDI demos cover the UDDI Version 3.01 Specification. You will learn how to query and publish a WSDL to a UDDI registry over a SOAP interface.

The Oracle Service Registry WSDL2UDDI demo set contains following demos to assist you in learning the WSDL2UDDI client API.

PublishWSDL Demonstrates how to construct and fill the Publish_wsdl object, get the WSDL2UDDI stub for the UDDI registry, get an authToken, and perform the publish_wsdl call.

UnPublishWSDL Demonstrates how to construct and fill the Unpublish_wsdl object, get WSDL2UDDI stub for the UDDI registry, get an authToken, and perform the unpublish_wsdl call.

FindWSDL Demonstrates how to construct and fill the Find_wsdlServiceInfo object, get the WSDL2UDDI stub for the UDDI registry, get an authToken, and perform the find_wsdlServiceInfo call.

GetWSDL Demonstrates how to construct and fill the Get_wsdlServiceInfo object, get the WSDL2UDDI stub for the UDDI registry, get an authToken, and perform the get_wsdlServiceInfo call.

Prerequisites and Preparatory Steps: Code  Locate

We expect that you have already installed the Oracle Service Registry and set the REGISTRY_HOME environment variable to the registry's installation location.

To run the Oracle Service Registry's demos, your registry must be running.

It is necessary to configure the demos. The configuration system has two levels: global and local. The properties defined at the global level may be overwritten at local level. The global properties are located in the file:

Windows: %REGISTRY_HOME%\demos\

The values set during installation of the Oracle Service Registry work out of the box, and their modification affects all demos. If you need to redefine the value of some property for a single demo (that is, at the local level), edit This file is located in the same directory as the file (run.bat). Local level properties for the WSDL2UDDI demos are loaded from the file:

Windows: %REGISTRY_HOME%\demos\basic\wsdl\v3\
UNIX: $REGISTRY_HOME/demos/basic/wsdl/v3/

Table 17. Properties Used in Demos

NameDefault ValueDescription
uddi.demos.user.john.namedemo_johnfirst user's name
uddi.demos.user.john.passworddemo_johnfirst user's password
uddi.demos.url.wsdl2uddihttp://localhost:8888/registry/uddi/wsdl2uddithe wsdl2uddi Web service port URL
uddi.demos.url.securityhttp://localhost:8888/registry/uddi/securitythe security Web service port URL

Presentation and Functional Presentation  Locate

This section describes programming pattern used in all demos using the PublishWSDL demo as an example. You can find its source code in file

Windows: %REGISTRY_HOME%\demos\resources\wsdl\v3\src\demo\uddi\v3\wsdl2uddi\
UNIX: $REGISTRY_HOME/demos/resources/wsdl/v3/src/demo/uddi/v3/wsdl2uddi/

The main method is very short. After gathering the user's input, it gets the security stub and authorizes the user. The resulting authInfo string is a secret key passed to the Publish request, which is created and initialized in the createPublish() method.

The user's choice of WSDL is published to the selected businessEntity within the publishWSDL() method.

When successful, the WsdlDetail object is returned from the UDDI registry and printed.

The last step is to discard the authInfo string, so that no malicious user can use it to compromise another user's account.

String businessKey = UserInput.readString("Enter businessKey", "");
String url = UserInput.readString("Enter WSDL URL", "http://localhost:8888/registry/uddi/doc/demos/EmployeeList.wsdl");

UDDI_Security_PortType security = getSecurityStub();
String authInfo = getAuthInfo(user, password, security);
Publish_wsdl publish = createPublish(businessKey, url, authInfo);
WsdlDetail result = publishWSDL(publish);
discardAuthInfo(authInfo, security);

The helper method getSecurityStub() returns the UDDI Security stub of the Web service listening at the URL specified by the URL_SECURITY property.

public static UDDI_Security_PortType getSecurityStub()
 throws SOAPException {
    // you can specify your own URL in property -
    String url = DemoProperties.getProperty(URL_SECURITY, "http://localhost:8888/registry/uddi/security");
    System.out.print("Using Security at url " + url + " ..");
    UDDI_Security_PortType security = UDDISecurityStub.getInstance(url);
    System.out.println(" done");
    return security;

Similarly, the helper method getWsdl2uddiStub() returns the WSDL2UDDI stub of the Web service listening at URL specified by the URL_WSDL2UDDI property.

public static Wsdl2uddiApi getWsdl2uddiStub() throws SOAPException {
    // you can specify your own URL in property - uddi.demos.url.wsdl2uddi
    String url = DemoProperties.getProperty(URL_WSDL2UDDI, "http://localhost:8888/registry/uddi/wsdl2uddi");
    System.out.print("Using WSDL2UDDI at url " + url + " ..");
    Wsdl2uddiApi inquiry = Wsdl2uddiStub.getInstance(url);
    System.out.println(" done");
    return inquiry;

The getAuthInfo() method is used to authorize the user against the UDDI registry and to get the secret authInfo key.

public static String getAuthInfo(String userName, String password, UDDI_Security_PortType security)
  throws InvalidParameterException, UDDIException {
    System.out.print("Logging in ..");
    AuthToken authToken = security.get_authToken(new Get_authToken(userName, password));
    System.out.println(" done");
    return authToken.getAuthInfo();

The discardAuthInfo() method invalidates the secret authInfo key, so that it cannot be reused.

public static void discardAuthInfo(String authInfo, UDDI_Security_PortType security)
  throws InvalidParameterException, UDDIException {
    System.out.print("Logging out ..");
    security.discard_authToken(new Discard_authToken(authInfo));
    System.out.println(" done");

The createPublish() method is used to create a new instance of the Publish class and initialize it with values from parameters:

public static Publish_wsdl createPublish(String businessKey, String url, String authInfo)
  throws InvalidParameterException {
    System.out.println("businessKey = " + businessKey);
    System.out.println("url = " + url);

    WsdlMapping wsdlMapping = new WsdlMapping();
    Wsdl wsdl = new Wsdl(url);
    WsdlDetail wsdlDetail = new WsdlDetail(wsdl, wsdlMapping);
    Publish_wsdl publish = new Publish_wsdl(wsdlDetail, authInfo);
    return publish;

The WSDL2UDDI API call Publish_wsdl is performed in the method publishWSDL().

public static WsdlDetail publishWSDL(Publish_wsdl save)
  throws UDDIException, SOAPException {
    Wsdl2uddiApi publishing = getWsdl2uddiStub();
    System.out.print("Save in progress ...");
    WsdlDetail wsdlDetail = publishing.publish_wsdl(save);
    System.out.println(" done");
    return wsdlDetail;

The returned WsdlDetail is displayed by the printWsdlDetail() method.

One interesting aspect of Oracle Service Registry client API is that each UDDIObject contains the toXML() method, which returns a human-readable formatted listing of its XML representation.

public static void printWsdlDetail(WsdlDetail wsdlDetail) {

Building and Running Demos  Locate

This section shows, how to build and run the Oracle Service Registry Basic Publishing demo set. Let's continue with our SaveBusiness demo.

  1. Be sure that the demos are properly configured and the Oracle Service Registry is up and running.

  2. Change your working directory to

    Windows %REGISTRY_HOME%\demos\basic\wsdl\v3
    UNIX $REGISTRY_HOME/demos/basic/wsdl/v3

  3. Build all demos using:

    Windows: run.bat make
    UNIX: ./ make


    When compiling demos on Windows platforms, you may see the following text:

    A subdirectory or file ..\..\common\.\build\classes already exists.

    This is expected and does not indicate a problem.

  4. To get list of all available demos, run

    Windows: run.bat help
    UNIX: ./ help

  5. The selected demo can be executed via the run command using the name of the demo as a parameter. For example, to run the PublishWSDL demo, invoke

    Windows: run.bat PublishWSDL
    UNIX: ./ PublishWSDL

    The output of this demo will resemble the following:

    Running PublishWSDL demo...
    Enter businessKey []:
    Enter WSDL URL [http://localhost:8888/registry/uddi/doc/demos/EmployeeList.wsdl]:
    Using Security at url .. done
    Logging in .. done
    businessKey =
    url = http://localhost:8888/registry/uddi/doc/demos/EmployeeList.wsdl
    Using WSDL2UDDI at url .. done
    Save in progress ... done
    <wsdlDetail xmlns="">
        <businessKey xmlns="urn:uddi-org:api_v3"></businessKey>
            <service name="EmployeeList" namespace=""
            <serviceKey xmlns="urn:uddi-org:api_v3">uddi:dde19a70-af1a-11d8-b9bf-eb2d7e20b9bf</serviceKey>
                    <port name="EmployeeList" publishingMethod="rewrite">
                        <bindingKey xmlns="urn:uddi-org:api_v3">uddi:dde85130-af1a-11d8-b9bf-eb2d7e20b9bf</bindingKey>
            <binding name="EmployeeList_binding" namespace=""
                <tModelKey xmlns="urn:uddi-org:api_v3">uddi:ddc84610-af1a-11d8-b9bf-eb2d7e20b9bf</tModelKey>
            <portType name="EmployeeList_portType" namespace=""
                <tModelKey xmlns="urn:uddi-org:api_v3">uddi:ddbc3820-af1a-11d8-b9bf-eb2d7e20b9bf</tModelKey>
    Logging out .. done
  6. To rebuild demos, execute run.bat clean (./ clean) to delete the classes directory and run.bat make (./ make) to rebuild the demo classes.