📄 testclient.java
字号:
sb.setAuthInfo(ai);
sb.setBindingTemplateVector(bss);
BindingDetail sd = p.saveBinding(sb);
System.out.println("Done.");
// log out
System.out.print("Logging out ..... ");
testLogout(ai);
System.out.println("Done.");
}
catch(UDDIException ue)
{
System.out.println("");
System.out.println("**** UDDIEXception ***");
System.out.println("Fault Actor : " + ue.getFaultActor());
System.out.println("Fault Error : " + ue.getFaultCode());
DispositionReport dr = ue.getDispositionReport();
Vector res = dr.getResultVector();
Result r = (Result)res.elementAt(0);
ErrInfo ei = r.getErrInfo();
System.out.println("ErrInfo : "+ ei.getValue());
}
catch (XML_SoapException exp){
System.out.println("XML_SoapException");
System.out.println(exp.getMessage());
exp.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception");
e.printStackTrace();
}
}
private void testDelTModel()
{
try
{
// log in
System.out.print("Logging in ..... ");
AuthInfo ai = testLogin();
System.out.println("Done : "+ ai.getValue());
Vector vbkeys = new Vector();
vbkeys.add(new TModelKey("UUID:4FB99D70-3AAF-11D5-80DC-002035229C64"));
//vbkeys.add(new TModelKey("57D4A7D0-2B9A-11D5-BFAF-AB3B31212312"));
System.out.print("Deleting TModel .....");
// create a delete tModel structure
DeleteTModel dt = new DeleteTModel();
// set all the arguments and attributes of the message
// follow the uddi.org specification for details.
dt.setAuthInfo(ai);
dt.setTModelKeyVector(vbkeys);
DispositionReport drpts = p.deleteTModel(dt);
System.out.println("Done.");
// log out
System.out.print("Logging out ..... ");
testLogout(ai);
System.out.println("Done.");
}
catch(UDDIException ue)
{
System.out.println("");
System.out.println("**** UDDIEXception ***");
System.out.println("Fault Actor : " + ue.getFaultActor());
System.out.println("Fault Error : " + ue.getFaultCode());
DispositionReport dr = ue.getDispositionReport();
Vector res = dr.getResultVector();
Result r = (Result)res.elementAt(0);
ErrInfo ei = r.getErrInfo();
System.out.println("ErrInfo : "+ ei.getValue());
}
catch (XML_SoapException exp){
System.out.println("XML_SoapException");
System.out.println(exp.getMessage());
exp.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception");
e.printStackTrace();
}
}
private void testSaveTModel()
{
try
{
// log in
System.out.print("Logging in ..... ");
AuthInfo ai = testLogin();
System.out.println("Done : "+ ai.getValue());
TModel tmdl = new TModel();
tmdl.setName("test2tmodel2testudditest one");
tmdl.addDescription("test tmodel");
//tmdl.setTModelKey("UUID:6C5EDF20-2BA6-11D5-BFAF-AB3B31212312");
tmdl.setTModelKey("");
tmdl.setAuthorizedName("");
tmdl.setOperator("uddiuddi");
OverviewDoc ov = new OverviewDoc();
//ov.addDescription("description for overview");
ov.setOverviewURL("http://www.overview.com");
tmdl.setOverviewDoc(ov);
CategoryBag cb = new CategoryBag();
cb.addKeyedReference("UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384","Software engineering","811116");
//Microsoft site:
//cb.addKeyedReference("uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4","types","categorizational");
IdentifierBag ib = new IdentifierBag();
ib.addKeyedReference("UUID:8609C81E-EE1F-4D5A-B202-3EB13AD01823","Apperceive","314159265358970");
//Microsoft site:
//ib.addKeyedReference("uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823","D-U-N-S","08-146-6956");
tmdl.setCategoryBag(cb);
tmdl.setIdentifierBag(ib);
Vector bss = new Vector();
bss.add(tmdl);
System.out.print("Saving TModel ..... ");
// create a save tModel structure
SaveTModel st = new SaveTModel();
// set all the arguments and attributes of the message
// follow the uddi.org specification for details.
st.setAuthInfo(ai);
st.setTModelVector(bss);
TModelDetail sd = p.saveTModel(st);
System.out.println("Done.");
// log out
System.out.print("Logging out ..... ");
testLogout(ai);
System.out.println("Done.");
}
catch(UDDIException ue)
{
System.out.println("");
System.out.println("**** UDDIEXception ***");
System.out.println("Fault Actor : " + ue.getFaultActor());
System.out.println("Fault Error : " + ue.getFaultCode());
DispositionReport dr = ue.getDispositionReport();
Vector res = dr.getResultVector();
Result r = (Result)res.elementAt(0);
ErrInfo ei = r.getErrInfo();
System.out.println("ErrInfo : "+ ei.getValue());
}
catch (XML_SoapException exp){
System.out.println("XML_SoapException");
System.out.println(exp.getMessage());
exp.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception");
e.printStackTrace();
}
}
private void testSaveTModelUploadRegister()
{
try
{
// log in
System.out.print("Logging in ..... ");
AuthInfo ai = testLogin();
System.out.println("Done : "+ ai.getValue());
Vector vbe = new Vector();
vbe.add(new UploadRegister("www.test.com/test.xml"));//;http://www-3.ibm.com/services/uddi/uddiget?businessKey=A63F7B30-2B94-11D5-BFAF-AB3B31212312"));
System.out.print("Saving TModel .....");
SaveTModel st = new SaveTModel();
// set all the arguments and attributes of the message
// follow the uddi.org specification for details.
st.setAuthInfo(ai);
st.setUploadRegisterVector(vbe);
TModelDetail bdtls = p.saveTModel(st);
System.out.println("Done.");
// log out
System.out.print("Logging out ..... ");
testLogout(ai);
System.out.println("Done.");
}
catch(UDDIException ue)
{
System.out.println("");
System.out.println("**** UDDIEXception ***");
System.out.println("Fault Actor : " + ue.getFaultActor());
System.out.println("Fault Error : " + ue.getFaultCode());
DispositionReport dr = ue.getDispositionReport();
Vector res = dr.getResultVector();
Result r = (Result)res.elementAt(0);
ErrInfo ei = r.getErrInfo();
System.out.println("ErrInfo : "+ ei.getValue());
}
catch (XML_SoapException exp){
System.out.println("XML_SoapException");
System.out.println(exp.getMessage());
exp.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception");
e.printStackTrace();
}
}
private void testGetRegisteredInfo()
{
try
{
// log in
System.out.print("Logging in ..... ");
AuthInfo ai = testLogin();
System.out.println("Done : "+ ai.getValue());
System.out.print("Getting Registered Info ..... ");
GetRegisteredInfo gri = new GetRegisteredInfo();
// set all the arguments and attributes of the message
// follow the uddi.org specification for details.
gri.setAuthInfo(ai);
RegisteredInfo ri = p.getRegisteredInfo(gri);
System.out.println("Done.");
// log out
System.out.print("Logging out ..... ");
testLogout(ai);
System.out.println("Done.");
}
catch(UDDIException ue)
{
System.out.println("");
System.out.println("**** UDDIEXception ***");
System.out.println("Fault Actor : " + ue.getFaultActor());
System.out.println("Fault Error : " + ue.getFaultCode());
DispositionReport dr = ue.getDispositionReport();
Vector res = dr.getResultVector();
Result r = (Result)res.elementAt(0);
ErrInfo ei = r.getErrInfo();
System.out.println("ErrInfo : "+ ei.getValue());
}
catch (XML_SoapException exp){
System.out.println("XML_SoapException");
System.out.println(exp.getMessage());
exp.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception");
e.printStackTrace();
}
}
private void testValidateCatByBusinessEntity()
{
try
{
BusinessEntity be = new BusinessEntity();
be.setBusinessKey("A63F7B30-2B94-11D5-BFAF-AB3B31212312");
//be.setBusinessKey("");
be.setName("MyNewTestCompany");
be.addDescription("My New Test Description");
System.out.print("Validating Category .....");
ValidateCategorization vc = new ValidateCategorization();
// set all the arguments and attributes of the message
// follow the uddi.org specification for details.
vc.setTModelKey(new TModelKey("UUID:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2"));
vc.setKeyValue(new KeyValue("334"));
vc.setBusinessEntity(be);
DispositionReport dr = p.validateCategorization(vc);
System.out.println("Done.");
}
catch(UDDIException ue)
{
System.out.println("");
System.out.println("**** UDDIEXception ***");
System.out.println("Fault Actor : " + ue.getFaultActor());
System.out.println("Fault Error : " + ue.getFaultCode());
DispositionReport dr = ue.getDispositionReport();
Vector res = dr.getResultVector();
Result r = (Result)res.elementAt(0);
ErrInfo ei = r.getErrInfo();
System.out.println("ErrInfo : "+ ei.getValue());
}
catch (XML_SoapException exp){
System.out.println("XML_SoapException");
System.out.println(exp.getMessage());
exp.printStackTrace();
}
catch(Exception e)
{
System.out.println("Exception");
e.printStackTrace();
}
}
private void testValidateCatByBusinessServ()
{
try
{
BusinessService bs = new BusinessService();
//bs.setBusinessKey("A63F7B30-2B94-11D5-BFAF-AB3B31212312");
//bs.setServiceKey("F3573D80-2B95-11D5-BFAF-AB3B31212312");
bs.setServiceKey("");
bs.setName(new Name("Testing Your Services for UDDDDI"));
bs.addDescription("Empowering people. They will be better off after using this service.");
BindingTemplate btemp = new BindingTemplate();
btemp.addDescription("Testing binding template");
btemp.setBindingKey("");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -