businessVector.addElement(business1);
businessVector.addElement(business2);
// create a SaveBusiness request & invoke the server
SaveBusiness sbReq = new SaveBusiness();
sbReq.setAuthInfo(new AuthInfo(authInfo));
sbReq.setBusinessEntityVector(businessVector);
BusinessDetail detail = (BusinessDetail)(new SaveBusinessFunction(reg).execute(sbReq));
Vector detailVector = detail.getBusinessEntityVector();
BusinessEntity b1 = (BusinessEntity)detailVector.elementAt(0);
BusinessEntity b2 = (BusinessEntity)detailVector.elementAt(1);
// create a new PublisherAssertion
String fromKey = b1.getBusinessKey();
String toKey = b2.getBusinessKey();
KeyedReference keyedReference = new KeyedReference ("Partner Company","peer-peer");
keyedReference.setTModelKey(TModel.RELATIONSHIPS_TMODEL_KEY);
PublisherAssertion assertion = new PublisherAssertion(fromKey,toKey,keyedReference);
// create a PublisherAssertion Vector
Vector assertionVector = new Vector();
assertionVector.addElement(assertion);
// create an AddPublisherAssertions request & invoke the server
AddPublisherAssertions apaReq = new AddPublisherAssertions();
apaReq.setAuthInfo(new AuthInfo(authInfo));
apaReq.setPublisherAssertionVector(assertionVector);
DispositionReport dspRpt1 = (DispositionReport)(new AddPublisherAssertionsFunction(reg).execute(apaReq));
System.out.println("errno: "+dspRpt1.toString());
DispositionReport dspRpt2 = (DispositionReport)(new AddPublisherAssertionsFunction(reg).execute(apaReq));
System.out.println("errno: "+dspRpt2.toString());
// create an DeletePublisherAssertions request & invoke the server
DeletePublisherAssertions dpaReq = new DeletePublisherAssertions();
dpaReq.setAuthInfo(new AuthInfo(authInfo));
dpaReq.setPublisherAssertionVector(assertionVector);
DispositionReport response = (DispositionReport)(new DeletePublisherAssertionsFunction(reg).execute(dpaReq));
System.out.println("errno: "+response.toString());
}
catch (Exception ex)