String key = GetAuthKey("uddi", "uddi", AuthStyle.UDDI_AUTH);
SaveTModel st = new SaveTModel();
st.setAuthInfo(key);
TModel tm = new TModel();
tm.setName(new Name());
tm.getName().setValue("My Company's Keymodel generator");
tm.getName().setLang("en");
tm.setCategoryBag(new CategoryBag());
KeyedReference kr = new KeyedReference();
kr.setTModelKey("uddi:uddi.org:categorization:types");
kr.setKeyName("uddi-org:keyGenerator");
kr.setKeyValue("keyGenerator");
tm.getCategoryBag().getKeyedReference().add(kr);
tm.setTModelKey("uddi:www.mycoolcompany.com:keygenerator");
st.getTModel().add(tm);
TModelDetail saveTModel = publish.saveTModel(st);
System.out.println("Creation of Partition Success!");
tm = new TModel();
tm.setName(new Name());
tm.getName().setValue("My Company's Department");
tm.getName().setLang("en");
tm.setTModelKey("uddi:www.mycoolcompany.com:department");
st.getTModel().add(tm);
saveTModel = publish.saveTModel(st);
System.out.println("Creation of tModel Department Success!");
tm = new TModel();
tm.setName(new Name());
tm.getName().setValue("My Company's Authentication Method");
tm.getName().setLang("en");
tm.setTModelKey("uddi:www.mycoolcompany.com:authmode");
st.getTModel().add(tm);
saveTModel = publish.saveTModel(st);