java操作domino NOTES服務(wù)器相關(guān)配置
NOTE 服務(wù)器相關(guān)配置1. 在lotus domino server 命令臺(tái)查看是否開啟了diiop,http 服務(wù)。一般notes 服務(wù)器啟動(dòng)后不會(huì)自動(dòng)加載diiop,http 服務(wù)。show
NOTE 服務(wù)器相關(guān)配置
1. 在lotus domino server 命令臺(tái)查看是否開啟了diiop,http 服務(wù)。一般notes 服務(wù)器啟動(dòng)后不會(huì)自動(dòng)加載diiop,http 服務(wù)。
show tasks;命令查看所有任務(wù)
load diiop;啟動(dòng)diiop
load http;啟動(dòng)http
2. 服務(wù)啟動(dòng)后,查看notes 服務(wù)器的連通性,包括是否可以ping 通,telnet 下端口是否開通。然后在測(cè)試服務(wù)器上瀏覽器中直接訪問: http://notes服務(wù)器ip/diiop_ior.txt,如果可以打開字符串,則http 連通。
3. 程序調(diào)用diiop 服務(wù)時(shí),需在domino 服務(wù)器配置中,所有服務(wù)器文檔,選中服務(wù)器修改, basics 中,
server name 為服務(wù)名,
domain name 為域名, FULLY qualified internet host name:中配置為note 服務(wù)器的計(jì)算機(jī)名或域名(例如:bfoem000/icbc)。
Ports 中,Notes Network Ports --> TCPIP 行的net Address 配置為note 服務(wù)器的IP 地址或域名(例如:xxxxxx/xxxx)。
4. 確保notes 服務(wù)器的dns 可以解析 (可在報(bào)表服務(wù)器中的host 文件中添加notes 服務(wù)器的地址(例如:XX.XX.XX.XX xxxxxx/xxxx)。
連通性代碼:
public void getNoteDatabse(String reportid,String dominoServer){
Session session = null ; Database database = null ; String ior; //數(shù)據(jù)庫文件 try {
f inal String mailFile = “”;//notes郵件服務(wù)器上的數(shù)據(jù)庫文件路徑, 如d://xxx//xx/admin4.nsf
S tring username = “”; S tring password = “”; //如果已將ior 文件拷到本地, 則直接讀ior 文件 try { BufferedReader iorin= new BufferedReader(new
,FileReader("diiop_ior.txt"));
//如果讀不到diiop_ior.txt文件,則需要通過網(wǎng)絡(luò)從服務(wù)器下載這個(gè)文件 //這需要domino 服務(wù)器開放http 服務(wù) if (ior == null ) { ior = NotesFactory.getIOR (dominoServer);//下載IOR } session = //得到數(shù)據(jù)庫 database = session.getDatabase(session.getServerName(), } catch (Exception ex) { i f (ex instanceof lotus.domino.NotesException){ } ior = iorin.readLine(); iorin.close(); } catch (IOException e) { ior = null ; } NotesFactory. createSessionWithIOR (ior,username,password); mailFile, false ); e x.printStackTrace(); }
}