我可以获取 Websphere 门户中的所有用户吗? 我在链接上开发:http://localhost:10039/wps/contenthandler/um/secure/users/profiles 但有些硬 这是:
String targetURL = "http://localhost:10039/wps/contenthandler/um/secure/users/profiles";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = null;
NodeList nList = null;
Document doc = null;
try {
db = dbf.newDocumentBuilder();
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
doc = db.parse(new URL(targetURL).openStream());
nList = doc.getElementsByTagName("entry");
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
}
}
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
任何人都可以帮助我 提前致谢!
最佳答案
您是否试图在门户上下文中运行时获取它?如果是这样,为什么要使用笨重的休息接口(interface)而不是直接调用 PUMA SPI
com.ibm.portal.um.PumaProfile
com.ibm.portal.um.PumaController
com.ibm.portal.um.PumaLocator
以下示例向您展示如何执行 JNDI 查找
Context ctx = new InitialContext();
Name myjndiname = new CompositeName(PumaHome.JNDI_NAME);
PumaHome myHome = (PumaHome) ctx.lookup(myjndiname);
然后您可以使用 findusersbyattribute 从 pumalocator 获取该列表
或者您可以只为用户发出 xmlaccess 请求。
关于java - 获取 Websphere 门户中的所有用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48072962/