• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding Business Key given Business Entity Name in OpenUDDI

 
Arun Adiththan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am working with OpenUDDI to publish and invoke the Web service descriptions. I would like to invoke the published service descriptions (through the unique business key of each business entity) by providing the Inquiry URL and Business Entity name. Could any one please point me to the programming logic to achieve this?

I attach the code found at Sourceforge site for retrieving the service descriptions given the business key and Inquiry URL (Bold Lines). But I would like to retrieve using business entity name rather than business key. Please help me.


________________________________________________________________________________________________________________________________________________________________

import java.io.IOException;
import dk.itst.uddi.client.ConnectionInfo;
import dk.itst.uddi.client.UDDIClient;
import dk.itst.uddi.client.query.FindServiceQuery;
import dk.itst.uddi.client.query.FindServiceResult;
import dk.itst.uddi.client.types.core.AccessPoint;
import dk.itst.uddi.client.types.core.BindingTemplate;
import dk.itst.uddi.client.types.core.BindingTemplates;
import dk.itst.uddi.client.types.core.BusinessService;

public class Main
{

/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException
{

ConnectionInfo ci = new ConnectionInfo();
ci.setInquiry("http://10.6.8.13:8080/uddi/services/inquiry");
UDDIClient client = new UDDIClient(ci);
//set Business key here
FindServiceQuery q = client.getInquiry().findService().setBusinessKey("uddi:mydomain.com:2bf81ecd-1b24-43d0-8580-41a28a5000bf");
FindServiceResult services = q.execute();
String serviceKey = null;
for (int i = 0; i < services.getCount(); i++)
{
serviceKey = services.getServiceInfos()[i].getServiceKey();
System.err.println("Service key found at: " + serviceKey);
}

BusinessService service = client.getInquiry().getService(serviceKey);
BindingTemplates bt = service.getBindingTemplates();
for (int i = 0; i < bt.sizeOfBindingTemplateArray(); i++)
{
BindingTemplate bindingTemplateFound = bt.getBindingTemplateArray(i);
System.err.println("BindingKey :" + bindingTemplateFound.getBindingKey());
AccessPoint ap = bindingTemplateFound.getAccessPoint();
System.out.println("Web Service Endpoint is at: \n" + ap.getStringValue());
}

}
}

_______________________________________________________________________________________________________________________________________________________________

Awaiting for your reply ASAP.

Thank you.[color=black]
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UDDIQuery might help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!