我可以在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();
}
任何人都可以帮助我提前谢谢!
你是否想在门户网站的环境中运行时获取它?如果是这样,为什么要使用笨重的休息接口,而不是直接调用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请求。