[midPoint] RawType conversion error

Ana Pereyra apereyra at identicum.com
Tue Jan 10 18:52:34 CET 2017


Hi Pavol,

Thanks for answering. We were having trouble with this, but it's working
now. In our test, we had a midpoint project, with an overlay that extended
the admin-gui. In that context, we thought it should work, but had that
conversion type error.

What we ended up doing, was creating a new project, adding the model-client
dependency to the pom file and it worked.

Thanks a lot for your time!
Regards,

2017-01-09 10:03 GMT-03:00 Pavol Mederly <mederly at evolveum.com>:

> 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 developerevolveum.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 <apereyra at identicum.com>*
> www.identicum.com
>
>
> _______________________________________________
> midPoint mailing listmidPoint at lists.evolveum.comhttp://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>


-- 
*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/20170110/bec992df/attachment.htm>


More information about the midPoint mailing list