if (! PublisherManager.createPublisher("saveBindingPublisher","saveBindingPublisher", config)) {
fail("Unable to create publisher");
return;
}
AuthToken _bindingToken = null;
try {
_bindingToken = proxy.get_authToken("saveBindingPublisher", "password");
}
catch (TransportException ex1) {
fail(ex1.toString());
}
catch (UDDIException ex1) {
fail(ex1.toString());
}
BusinessEntity bEntity = new BusinessEntity();
bEntity.setDefaultName(new Name("saveBindingBusiness"));
Vector busVector = new Vector();
busVector.add(bEntity);
Vector victor = null;
try {
BusinessDetail busDetail = proxy.save_business(token.getAuthInfoString(),
busVector);
victor = busDetail.getBusinessEntityVector();
assertEquals(victor.size(), 1);
}
catch (TransportException ex) {
fail(ex.toString());
return;
}
catch (UDDIException ex) {
fail(ex.toString());
return;
}
BusinessEntity returnedBusinessEntity = (BusinessEntity)victor.elementAt(0);
BusinessService service = new BusinessService();
service.setBusinessKey(returnedBusinessEntity.getBusinessKey());
Name name = new Name("saveBindingService");
service.setDefaultName(name);
java.util.Vector servicesVector = new Vector();
servicesVector.add(service);
try {
proxy.save_service(_bindingToken.getAuthInfoString(), servicesVector);
ServiceDetail detail = proxy.save_service(token.getAuthInfoString(), servicesVector);
servicesVector = detail.getBusinessServiceVector();
assertEquals(servicesVector.size(), 1);
_businessService = (BusinessService)servicesVector.elementAt(0);
assertNotNull(_businessService);