SPML

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()

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact