This section contains two authenticated SPML ModifyRequest examples.
SpmlClient client = new SpmlClient(); client.setURL("http://example.com:8080/idm/spml"); ModifyRequest req = new ModifyRequest(); req.setIdentifier("maurelius"); req.addModification("email", "marcus.aurelius@example.com"); SpmlResponse res = client.request(req); if (res.getResult() .equals(SpmlResponse.RESULT_SUCCESS)) System.out.println("Person was successfully modified");
LighthouseClient client = new LighthouseClient(); client.setURL("http://example.com:8080/idm/spml"); client.setUser("maurelius"); client.setPassword("xyzzy"); ModifyRequest req = new ModifyRequest(); req.setIdentifier("maurelius"); req.addModification("email", "marcus.aurelius@example.com"); SpmlResponse res = client.request(req); if (res.getResult() .equals(SpmlResponse.RESULT_SUCCESS)) System.out.println("Person was successfully modified");
The only difference between these examples is that the second example uses the LighthouseClient class and two additional method calls to client.setUser and client.setPassword. For example, you could use this example to avoid setting a proxy user in Waveset.properties, which results in the audit log reflecting the specified user instead of the proxy user.
This example is authenticated by client.setUser and client.setPassword when the request is sent.