如何通过Jawin连接 QC(OTAClient.dll) 。糊涂了
Dispatchptr("TDApiOle80.TDConnection")
我不能使用 Jawin 类型浏览器。
try{
Ole32.CoInitialize();
DispatchPtr qc = new DispatchPtr("TDApiOle80.TDConnection");
qc.invoke("InitConnectionEx", new String("URL"));
qc.invoke("Login", "username", "password");
System.out.println("\nAUTHENTCATED");
qc.invoke("Connect", "domainname", "projname");
System.out.println("\nCONNECTED");
DispatchPtr testSetFolder = (DispatchPtr) qc.get("TestSetTreeManager");
testSetFolder = (DispatchPtr) testSetFolder.get("Root");
testSetFolder = (DispatchPtr) testSetFolder.invoke("AddNodeDisp", "Jawin_008Folder");
testSetFolder.invoke("post");
DispatchPtr testSet=(DispatchPtr)testSetFolder.get("TestSetFactory");
testSet=(DispatchPtr)testSet.invoke("AddItem", "Jawin007_testSet007");
testSet.put("Name","JawintestSet_007");
testSet.put("Status","Open");
testSet.invoke("Post");
System.out.println("Test SET Created");
if((Boolean)qc.get("Connected"))
{
if((Boolean)qc.get("LoggedIn"))
{
qc.invoke("Logout");
System.out.println("Logged out");
}
}
qc.invoke("Disconnect");
System.out.print("\nDISCONNECTED");
qc.invoke("ReleaseConnection");
Ole32.CoUninitialize();
}
catch (Exception e) {
e.printStackTrace();
}