Inquiry v2 UDDI v2

Prerequisites and Preparatory Steps: Code We expect, that you have already installed the Oracle Service Registry registry and set the REGISTRY_HOME environment variable to its installation location. To run the Oracle Service Registrys 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 the local level. The global properties are located in the file: REGISTRY_HOME\demos\env.properties Windows: REGISTRY_HOMEdemosenv.properties UNIX: The values set during the installation of the Oracle Service Registry work out of 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 the file env.properties in the directory where run.bat run.sh is located. Local level properties for BasicInquiry demos are loaded in the file: REGISTRY_HOME\demos\basic\inquiry\v2\env.properties Windows: REGISTRY_HOMEdemosbasicinquiryv2env.properties UNIX: Table 3. Properties Used in Demos Description Default Value Name limit of data returned from registry 5 uddi.demos.result.max_rows the inquiry Web service port URL http:localhost:8888registryuddiinquiry uddi.demos.url.inquiry Presentation and Functional Presentation This section describes the programing pattern used in all demos using the FindTModel demo as an example. You can find its source code in the file: REGISTRY_HOME\demos\basic\inquiry\v2\src\demo\uddi\v2\inquiry\FindTModel.java Windows: REGISTRY_HOMEdemosbasicinquiryv2srcdemouddiv2inquiryFindTModel.java UNIX: The main method is straightforward. It gathers users input tModel name, calls a method to initialize the Find_tModel object, executes the find_tModel UDDI call, and displays the list of found tModels: String name = UserInput.readStringEnter name, demo; Find_tModel find_tModel = createFindByTModelname, findQualifier; TModelList result = findTModelfind_tModel; printTModelListresult; The createFindTModel method is used to create new instance of the Find_tModel class and initialize it with values from parameters: public static Find_tModel createFindByTModelString name throws InvalidParameterException { System.out.printlnname = + name; Find_tModel find = new Find_tModel; find.setNamenew Namename; Page 650 Presentation and Functional Presentation find.setMaxRowsnew IntegerMAX_ROWS; find.setGenericConstants.GENERIC_2_0; return find_tModel; } The helper method getInquiryStub returns the UDDI Inquiry stub of the web service listening at the URL specified in the URL_INQUIRY property. public static UDDI_Inquiry_PortType getInquiryStub throws SOAPException { you can specify your own URL in property - uddi.demos.url.inquiry String url = DemoProperties.getPropertyURL_INQUIRY, http:localhost:8888registryuddiinquiry; System.out.printUsing Inquiry at url + url + ..; UDDI_Inquiry_PortType inquiry = UDDIInquiryStub.getInstanceurl; System.out.println done; return inquiry; } The UDDI API call find_tModel is performed in the method findTModel: public static TModelList findTModelFind_tModel find_tModel throws UDDIException, SOAPException { UDDI_Inquiry_PortType inquiry = getInquiryStub; System.out.printSearch in progress ..; TModelList tModelList = inquiry.find_tModelfind_tModel; System.out.println done; return tModelList; } The list of found tModels is printed with the method printTModelList. One interesting aspect of the Oracle Service Registry client API is that each UDDIObject contains method toXML, which returns a human-readable, formatted listing of its XML representation. public static void printTModelListTModelList tModelList { System.out.println; TModelInfoArrayList tModelInfoArrayList = tModelList.getTModelInfoArrayList; if tModelInfoArrayList==null { System.out.printlnNothing found; return; } int position = 1; for Iterator iterator = tModelInfoArrayList.iterator; iterator.hasNext; { TModelInfo tModelTemplate = TModelInfo iterator.next; System.out.printlnTModel +position+ : +tModelTemplate.getTModelKey; System.out.printlntModelTemplate.toXML; System.out.println; System.out.println; position++; } } Page 651 Presentation and Functional Presentation Building and Running Demos This section shows how to build and run the Oracle Service Registry Basic Inquiry demo set. Our example continues with the FindTModel 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: REGISTRY_HOME\demos\basic\inquiry\v2 Windows: REGISTRY_HOMEdemosbasicinquiryv2 UNIX: 3. Build all demos using: run.bat make Windows: .run.sh make UNIX: Note 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 run.bat help Windows: .run.sh help UNIX: 5. Run a selected demo by executing the run command with the name of the demo as a parameter. For example, to run the FindTModel demo, invoke run.bat FindTModel Windows: .run.sh FindTModel UNIX: The output of this demo will resemble the following: Running FindTModel demo... Enter name [demo]: name = demo Using Inquiry at url http:mycomp.com:8888registryuddiinquiry .. done Search in progress .. done TModel 1 : uuid:13aee5be-8531-343c-98f8-d2d3a9308329 tModelInfo tModelKey=uuid:13aee5be-8531-343c-98f8-d2d3a9308329 xmlns=urn:uddi- org:api_v2 namedemo:departmentIDname tModelInfo Page 652 Building and Running Demos TModel 2 : uuid:8af5f49e-e793-3719-92f3-6ab8998eb5a9 tModelInfo tModelKey=uuid:8af5f49e-e793-3719-92f3-6ab8998eb5a9 xmlns=urn:uddi- org:api_v2 namedemo:hierarchyname tModelInfo TModel 3 : uuid:5c1d5d80-a4d4-11d8-91cd-5c1d367091cd tModelInfo tModelKey=uuid:5c1d5d80-a4d4-11d8-91cd-5c1d367091cd xmlns=urn:uddi- org:api_v2 nameDemo identifiername tModelInfo 6. To rebuild demos, execute run.bat clean .run.sh clean to delete the classes directory and run.bat make .run.sh make to rebuild the demo classes.

1.2.2. Publishing v2

The Oracle Service Registry basic publishing demo set demonstrates the Oracle Service Registry application programming interfaces capabilities and teaches how to use this API to perform basic publishing calls to a UDDI registry. The Oracle Service Registry basic publishing demos cover the publication aspect of the UDDI Version 2 Specification [http:www.oasis-open.orgcommitteesuddi-specdoctcspecs.htmuddiv2]. You will learn how to use the Oracle Service Registry client API to publish information to a UDDI registry over a SOAP interface. There is one demo for each UDDI call, from add_publisherAssertion through get_registeredInfo to save_business. The Oracle Service Registry basic publishing demo set contains the following demos. They will assist you in learning the Oracle Service Registry client API. AddAssertion Demonstrates how to construct and fill the Add_publisherAssertion object, get a Publishing stub for the UDDI registry, get an authToken, and perform the add_publisherAssertion call. DeleteAssertion Demonstrates how to construct and fill the Delete_publisherAssertion object, get a Publishing stub for the UDDI registry, get an authToken, and perform the delete_publisherAssertion call. DeleteBinding Demonstrates how to construct and fill the Delete_binding object, get a Publishing stub for the UDDI registry, get an authToken, and perform the delete_binding call. DeleteBusiness Demonstrates how to construct and fill the Delete_business object, get Publishing stub for the UDDI registry, get an authToken, and perform the delete_business call. DeleteService Demonstrates how to construct and fill the Delete_service object, get Publishing stub for the UDDI registry, get an authToken, and perform the delete_service call. DeleteTModel Demonstrates how to construct and fill the Delete_tModel object, get a Publishing stub for the UDDI registry, get an authToken, and perform the delete_tModel call. GetAssertionStatusReport Demonstrates how to construct and fill the Get_assertionStatusReport object, get a Publishing stub for the UDDI registry, get an authToken, and perform the get_assertionStatusReport call. GetPublisherAssertions Demonstrates how to construct and fill the Get_publisherAssertions object, get a Publishing stub for the UDDI registry, get an authToken, and perform the get_publisherAssertions call. Page 653

1.2.2. Publishing v2

GetRegisteredInfo Demonstrates how to construct and fill the Get_registeredInfo object, get a Publishing stub for the UDDI registry, get an authToken, and perform the get_registeredInfo call. SaveBinding Demonstrates how to construct and fill the Save_binding object, get a Publishing stub for the UDDI registry, get an authToken, and perform the save_binding call. SaveBusiness Demonstrates how to construct and fill the Save_business object, get a Publishing stub for the UDDI registry, get an authToken, and perform the save_business call. SaveService Demonstrates how to construct and fill the Save_service object, get a Publishing stub for the UDDI registry, get an authToken, and perform the save_service call. SaveTModel Demonstrates how to construct and fill the Save_tModel object, get a Publishing stub for the UDDI registry, get an authToken, and perform the save_tModel call. SetAssertions Demonstrates how to construct and fill the Set_publisherAssertions object, get a Publishing stub for the UDDI registry, get an authToken, and perform the set_publisherAssertions call. Prerequisites and Preparatory Steps: Code We expect that you have already installed the Oracle Service Registry and set the REGISTRY_HOME environment variable to its installation location. To run the Oracle Service Registrys demos, your registry must be running. It is neccessary to configure the demos. The configuration system has two levels: global and local. The properties defined at the global level may be overwritten at the local level. The global properties are located in the file: REGISTRY_HOME\demos\env.properties Windows: REGISTRY_HOMEdemosenv.properties UNIX: The values set during the installation of the Oracle Service Registry work out of the box, and their modification affects all demos. If you need to redefine a propertys value for a single demo that is, at the local level, edit the file env.properties in the directory where run.sh run.bat is located. Local level properties for the BasicInquiry demos are loaded from the file: REGISTRY_HOME\demos\basic\publishing\v2\env.properties Windows: REGISTRY_HOMEdemosbasicpublishingv2env.properties UNIX: Table 4. Properties Used in the Demos Description Default Value Name First users name demo_john uddi.demos.user.john.name First users password demo_john uddi.demos.user.john.password Second users name demo_jane uddi.demos.user.jane.name Second users password demo_jane uddi.demos.user.jane.password The publication Web service port URL http:localhost:8888registryuddipublishing uddi.demos.url.publishing The security Web service port URL http:localhost:8888registryuddisecurity uddi.demos.url.security Page 654 Prerequisites and Preparatory Steps: Code