[midPoint] RawType conversion error
Pavol Mederly
mederly at evolveum.com
Mon Jan 9 14:03:51 CET 2017
Hello Ana.
This is really strange. I've tested your scenario with both midPoint
3.4.1 and master (3.6-snapshot, almost equal to 3.5), and it works:
"Endpoint URL: http://localhost:8080/midpoint/model/model-3
Got system configuration
Got administrator user: 00000000-0000-0000-0000-000000000002
Got Sailor role
Resources (0)
Users (1)
Tasks (3)
Created user guybrush, OID: 9baf4217-47ec-4792-805a-a9e7f6c6145a
Fetched user guybrush:
Users fullName: Guybrush Threepwood
Created user lechuck, OID: c0c010c0-d34d-b33f-f00d-11111111ec1e
Changed user password
Changed user given name
Assigned roles
Unassigned roles
Found 0 requestable roles
Created role Sea Superuser, OID: b77019b2-6a45-4d41-aff6-6041acc748b8
Assigned role Sea Superuser to LeChuck
Modified role Sea Superuser - modified resource inducement
Modified role Sea Superuser - changed role inducement
LeChuck reconciled.
Deleted user(s)
Process finished with exit code 0"
Are you sure you use correct versions of the Java code? I.e. either both
3.4.x or 3.5 (or master)?
Pavol Mederly
Software developer
evolveum.com
On 05.01.2017 19:52, Ana Pereyra wrote:
> Hi everyone.
>
> I'm trying to build a client using the model-client-sample example in
> Github.
>
> The issue I'm having is with line 339 of class Main
> (https://github.com/Evolveum/midpoint/blob/v3.4.1/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java):
> the method ItemDeltaType.getValue() returns a list of RawType, and the
> ModelClientUtil.createProtectedString() returns a ProtectedString not
> compatible with RawType.
>
> Here is the code:
>
> private static void changeUserPassword(ModelPortType modelPort,
> String oid, String newPassword) throws FaultMessage {
> ItemDeltaType passwordDelta = new ItemDeltaType();
> passwordDelta.setModificationType(ModificationTypeType.REPLACE);
> passwordDelta.setPath(ModelClientUtil.createItemPathType("credentials/password/value"));
> *passwordDelta.getValue().add(ModelClientUtil.createProtectedString(newPassword));*
> ObjectDeltaType deltaType = new ObjectDeltaType();
> deltaType.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
> deltaType.setChangeType(ChangeTypeType.MODIFY);
> deltaType.setOid(oid);
> deltaType.getItemDelta().add(passwordDelta);
> ObjectDeltaListType deltaListType = new ObjectDeltaListType();
> deltaListType.getDelta().add(deltaType);
> modelPort.executeChanges(deltaListType, null);
> }
>
>
> How do I get a RawType from the result of the *createProtectedString
> *return type?
>
> Thank you all.
> Regards,
> --
> *Ana Pereyra*
> Identicum S.A.
> /Jorge Newbery 3226, Argentina
> Tel: +54 (11) //4552.3050/
> /apereyra at identicum.com <mailto:apereyra at identicum.com>/
> www.identicum.com <http://www.identicum.com/>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170109/400494b4/attachment.htm>
More information about the midPoint
mailing list