📄 chemistryprovider.java
字号:
package webservice.web;
import java.rmi.*;
public class ChemistryProvider {
//根据元素周期表中的元素编号获取元素的名称
public String getNameByNumber (int number) {
String retValue = null;
try {
de.bov.spheon.ChemistryBindingStub binding = null;
try {
binding = (de.bov.spheon.ChemistryBindingStub)new de.bov.spheon.ChemistryLocator().getChemistryPort();
} catch (javax.xml.rpc.ServiceException jre) {
jre.getLinkedCause().printStackTrace();
}
//设置连接超时为1分钟
binding.setTimeout(60000);
//调用Chemistry Web Service 远程方法
retValue = binding.getNameByNumber(number);
return retValue;
} catch (RemoteException ex) {
ex.printStackTrace();
return retValue;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -