Hi,

I have two separate business entities, each with services registered to them.

I am trying to project the service from one business into the other business using Java 1.5, uddi4j and jUDDI as my registry.

<code>
public static void createServiceProjection(String businessKey,
String defaultName, String serviceBusinessKey, String serviceKey)
   {
       // Get services on the business
       // Add service to existing business
       // Save details back in uddi registry
       try
       {
           BusinessDetail bd = proxy.get_businessDetail(businessKey);
BusinessEntity be = (BusinessEntity) bd.getBusinessEntityVector().get(0);
           BusinessServices services = be.getBusinessServices();
           BusinessService projectedService = new BusinessService();
           projectedService.setBusinessKey(serviceBusinessKey);
           projectedService.setServiceKey(serviceKey);
           Name serviceName = new Name();
           serviceName.setText(defaultName);
           projectedService.setDefaultName(serviceName);
           services.add(projectedService);
           // save the updated business in registry
           Vector<BusinessEntity> vSave = new Vector<BusinessEntity>();
           vSave.add(be);
proxy.save_business(authInfo, vSave); <<<<<< Exception Thrown Here
       }
<snip/> }
</code>

Error message from the jUDDI logs when executing the code:

2006-01-19 12:59:49,722 [http-8080-Processor23] ERROR org.apache.juddi.function.SaveBusinessFunction - java.sql.SQLException: Duplicate entry '6E95DD90-881F-11DA-BB33-9375C1C9EBDA' for key 1 2006-01-19 12:59:49,722 [http-8080-Processor23] ERROR org.apache.juddi.registry.AbstractService - java.sql.SQLException: Duplicate entry '6E95DD90-881F-11DA-BB33-9375C1C9EBDA' for key 1

The duplicate entry relates to the Service Key


If my understanding of uddi version 2 is correct, to project a service from another business, I need to pass the serviceKey, and the businessKey of the owning businessEntity when creating the service projection (I can pass other variables too, but the juddi documentation states that 'When saving a businessEntity containing a service reference, the content of the businessService provided in the save_business (except for the businessKey and the serviceKey attributes) is ignored.')

Has someone got an example of this working somewhere or an idea of what I need to do to get this working?

Thanks,

Christina

--
Christina Cunningham
Belfast eScience Centre (BeSC)
Queen's University, Belfast
e: christina.cunningham [at] qub.ac.uk
w: www.qub.ac.uk/escience
t: +44 (0)28 9097 4809

Reply via email to