Name n = new Name();
n.setValue("JUDDI_712_SaveService3WithSignature");
be.getName().add(n);
be.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
sb.getBusinessEntity().add(be);
BusinessDetail saveBusiness = null;
try {
saveBusiness = publicationJoe.saveBusiness(sb);
} catch (Exception ex) {
logger.info("UnExpected failure: ", ex);
Assert.fail();
}
SaveService ss = new SaveService();
ss.setAuthInfo(authInfoJoe);
BusinessService bs = new BusinessService();
bs.setBusinessKey(TckBusiness.JOE_BUSINESS_KEY);
bs.setServiceKey(TckBusinessService.JOE_SERVICE_KEY);
bs.setBindingTemplates(new BindingTemplates());
BindingTemplate bt = new BindingTemplate();
bt.setBindingKey(TckBusinessService.JOE_BINDING_KEY_1);
bt.setServiceKey(null);
bt.setAccessPoint(new AccessPoint("http://localhost", "wsdl"));
bs.getBindingTemplates().getBindingTemplate().add(bt);
bs.getName().add(new Name("Joe's bs", null));
DigSigUtil ds = GetDigSig();
bs = ds.signUddiEntity(bs);
be.setBusinessServices(new BusinessServices());
be.getBusinessServices().getBusinessService().add(bs);
sb.getBusinessEntity().add(be);
try {
publicationJoe.saveService(ss);
Assert.fail("unexpected success");
} catch (Exception ex) {
logger.info("Expected failure: " + ex.getMessage());
} finally {
DeleteBusinesses(saveBusiness.getBusinessEntity().get(0).getBusinessKey(), authInfoJoe, publicationJoe);
}
}