Hi Sunshine (cool name!)

tmodel.getOverviewDoc() returns a list. So to add an OverviewDoc, do

tmodel.getOverviewDoc.add(yourOverviewDoc)

Same thing for categoryBags.

Hope that helps!

--Kurt


建平 王 wrote:
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 Description
object within TModel object. Same things like CategoryBag have no relavent
methods 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://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/>


Reply via email to