Hi, I have successfully used juddi 0.9 and uddi4j to save a TModel. But I
encountered some problems as I use juddi 3.0 beta. There seems no methods to
initialize the OverviewURL and Descriptionobject within TModel object. Same
things like CategoryBag have no relaventmethods to initialize itself. If I do
the wrong way? My codes are follows:
public class SavetModel { public static void main(String args[]) {
SavetModel app = new SavetModel(); app.run(); }
public void run() { GetAuthToken ga = new GetAuthToken();
ga.setUserID("uddi"); ga.setCred(""); JAXWSTransport tp = new
JAXWSTransport(); try { UDDISecurityPortType
securityService = tp.getSecurityService();
UDDIPublicationPortType publication = tp.getPublishService();
org.uddi.api_v3.AuthToken token =
securityService.getAuthToken(ga); System.out.println("Returned
authToken:" + token.getAuthInfo());
org.uddi.api_v3.SaveTModel savetModel = new org.uddi.api_v3.SaveTModel();
savetModel.setAuthInfo(token.getAuthInfo());
TModel tm = new TModel();
//set TModel Name Name tmodelName = new Name();
tmodelName.setValue(targetNameSpace);
tm.setName(tmodelName);
//set Description Description des = new
Description(); des.setValue("TModel Default Description!");
tm.setDescription(des);//have not this method.
//set OverviewURL OverviewDoc
od = new OverviewDoc(); od. //have no relavent
methods. OverviewURL ou = new OverviewURL();
ou.setValue("http://localhost:8080/axis2/services/HelloWorld?wsdl");
tm.setOverviewDoc(od); //have not this method
CategoryBag cBag = new CategoryBag();
cBag. //have no relavent methods.
tm.setCategoryBag(cBag);
st.getTModel().add(tm);
publication.saveTModel(st); } catch
(Exception e) { e.printStackTrace(); } }}
Waiting for your reply.Best regards.
Sunshine Wang
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/