[midPoint] RawType conversion error

Ana Pereyra apereyra at identicum.com
Thu Jan 5 19:52:00 CET 2017


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, ArgentinaTel: +54 (11) **4552.3050*
*apereyra at identicum.com <apereyra at identicum.com>*
www.identicum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170105/df7c1c26/attachment.htm>


More information about the midPoint mailing list