Example to create a user with SPML. Has been tested with IDM 6.0
http://localhost:8080/idm/spml/Create.jsp
Create.jsp Page:
<%@page contentType="text/html"%> <%@page import="org.openspml.browser.*"%> <%@page import="org.openspml.client.*"%> <%@page import="org.openspml.message.*"%> <%@page import="org.openspml.server.*"%> <%@page import="org.openspml.util.*"%> <%@page import="java.util.List"%> <html> <head><title>SPML WorkItem Object Search and Approve Example</title></head> <body> <% LighthouseClient client = new LighthouseClient(); client.setUrl("http://localhost:8080/idm/servlet/rpcrouter2"); client.setUser("configurator"); client.setPassword("configurator"); AddRequest req = new AddRequest(); req.setOperationalAttribute("trace", "true"); req.setObjectClass("person"); req.setIdentifier("jkerry"); req.setAttribute("password", "heinz57"); req.setAttribute("gn", "SPML"); req.setAttribute("sn", "Test3"); req.setAttribute("email", "SPMLTest3@waveset.com"); SpmlResponse res = client.request(req); // Print the following statements System.out.println("Response from Server->"+res.getResult()); System.out.println("Error from server->"+res.getError()); %> </body> </html>
There are some tools to write and send SPML requests very easily, using groovy. The code is available here. Here an example:
import net.asyd.iam.spml.AddRequest AddRequest request = new AddRequest() request.init("http://172.16.19.128:8080/idm/servlet/openspml2") request.login("configurator", "configurator") request.addAttribute("emailAddress", "bbonfils@gmail.com") request.addAttribute("objectclass", "spml2Person") request.addAttribute("accountId", "EasySPMLdemo") request.addAttribute("credentials", "secret") request.proceed() request.dumpResponse()