This is obsolete functionality. It is no longer supported or maintained.
IDM Model Web Service Interface was deprecated in midPoint 4.0. Therefore the sample client does not bring any substantial value. The client may even encourage the users to use deprecated SOAP functionality. Therefore all the SOAP clients were removed from midPoint 4.0.
This is a short description how to use
model-client-sample which demonstrates the use of Java client based on JAX-WS. This approach is beneficial because it provides good maintainability of the code on the compiler level. I.e. if the midPoint API changes in an incompatible manner (in future midPoint releases) than the client code will break and indicate the exact place that needs to be fixed. This is saving a lot of testing effort. If the midPoint API changes in a compatible manner then the client code should work without any major change.
MidPoint provides a stand-alone project that is using
model-client library. The
model-client library is part of midPoint especially designed to support such clients. It contains a JAX-WS and JAX-B code generated from midPoint schemas. Therefore projects that use this library do not need to generate the code and they can simply use this library. There is no need to build
model-client library, it is available as a binary JAR in Evolveum Maven Repository. Maven can take advantage of that and he only part that needs to be built is the client code itself. The sample project is configured to do just that. Please inspect the
pom.xml file in the project for more details.
Using the Sample
Check-out the Source Code
Use one of the following URLs based on your midPoint version:
Use git to check out the source code:
Adjust the Configuration
The sample is very simple. All the configuration is hardcoded into the source code. But it is quite easy to change. Just edit few source files:
Web service URL
midPoint user name
midPoint user password
OIDs of roles used in the sample
constants ROLE_PIRATE_OID, ROLE_CAPTAIN_OID
The scenario that the client sample does in midPoint is hardcoded in the
main method of the
Main class. You can adjust it or simple comment out some parts. It goes roughly like this:
- Getting system configuration object
- Search for user with username
- Searching for role with name
- Creating user
Guybrush Threepwoodwith username
- Changing password of user
- Assing roles
guybrush(roles are identified by fixed OID
- Unasssign role
- List all roles that have
requestableflag set to true
- Delete user
guybrush(which also deletes all the accounts that the roles assigned to the user)
mvn command to build the sample:
The resulting JAR should appear in the
While it is theoretically possible to use
java -jar command to run the sample this is a bit difficult in practice. The code will need some libraries on the classpath to run, especially the model-client midPoint library. It is much easier to run the sample using Maven. Maven will make sure that the classpath is populated as needed. Using maven this is not a major problem because this just a sample project. The real midPoint client will be most likely integrated into a larger project and executed a any way that is native to that integrated project.
Do not forget that initialized and configued midPoint instance must be running before successfully executing the client sample.