<div dir="ltr">Hi Pavol,<div><br></div><div>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.</div><div><br></div><div>What we ended up doing, was creating a new project, adding the model-client dependency to the pom file and it worked.</div><div><br></div><div>Thanks a lot for your time!</div><div>Regards,</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-09 10:03 GMT-03:00 Pavol Mederly <span dir="ltr"><<a href="mailto:mederly@evolveum.com" target="_blank">mederly@evolveum.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>Hello Ana.</p>
<p>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:</p>
<p><font size="-1"><tt>"Endpoint URL:
<a class="m_271802167605248676moz-txt-link-freetext" href="http://localhost:8080/midpoint/model/model-3" target="_blank">http://localhost:8080/<wbr>midpoint/model/model-3</a></tt><tt><br>
</tt><tt>Got system configuration</tt><tt><br>
</tt><tt>Got administrator user:
00000000-0000-0000-0000-<wbr>000000000002</tt><tt><br>
</tt><tt>Got Sailor role</tt><tt><br>
</tt><tt>Resources (0)</tt><tt><br>
</tt><tt>Users (1)</tt><tt><br>
</tt><tt>Tasks (3)</tt><tt><br>
</tt><tt>Created user guybrush, OID:
9baf4217-47ec-4792-805a-<wbr>a9e7f6c6145a</tt><tt><br>
</tt><tt>Fetched user guybrush:</tt><tt><br>
</tt><tt>Users fullName: Guybrush Threepwood</tt><tt><br>
</tt><tt>Created user lechuck, OID:
c0c010c0-d34d-b33f-f00d-<wbr>11111111ec1e</tt><tt><br>
</tt><tt>Changed user password</tt><tt><br>
</tt><tt>Changed user given name</tt><tt><br>
</tt><tt>Assigned roles</tt><tt><br>
</tt><tt>Unassigned roles</tt><tt><br>
</tt><tt>Found 0 requestable roles</tt><tt><br>
</tt><tt>Created role Sea Superuser, OID:
b77019b2-6a45-4d41-aff6-<wbr>6041acc748b8</tt><tt><br>
</tt><tt>Assigned role Sea Superuser to LeChuck</tt><tt><br>
</tt><tt>Modified role Sea Superuser - modified resource
inducement</tt><tt><br>
</tt><tt>Modified role Sea Superuser - changed role inducement</tt><tt><br>
</tt><tt>LeChuck reconciled.</tt><tt><br>
</tt><tt>Deleted user(s)</tt><tt><br>
</tt><tt><br>
</tt><tt>Process finished with exit code 0"</tt></font></p>
<p>Are you sure you use correct versions of the Java code? I.e.
either both 3.4.x or 3.5 (or master)?<br>
</p>
<pre class="m_271802167605248676moz-signature" cols="72">Pavol Mederly
Software developer
<a href="http://evolveum.com" target="_blank">evolveum.com</a>
</pre><div><div class="h5">
<div class="m_271802167605248676moz-cite-prefix">On 05.01.2017 19:52, Ana Pereyra wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hi everyone.
<div><br>
</div>
<div>I'm trying to build a client using the model-client-sample
example in Github.</div>
<div><br>
</div>
<div>The issue I'm having is with line 339 of class Main (<a href="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" target="_blank">https://github.com/Evolveum/<wbr>midpoint/blob/v3.4.1/samples/<wbr>model-client-sample/src/main/<wbr>java/com/evolveum/midpoint/<wbr>testing/model/client/sample/<wbr>Main.java</a>):
the method ItemDeltaType.getValue() returns a list of RawType,
and the ModelClientUtil.<wbr>createProtectedString() returns a
ProtectedString not compatible with RawType.</div>
<div><br>
</div>
<div>Here is the code:</div>
<div><br>
</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">private static void
changeUserPassword(<wbr>ModelPortType modelPort, String oid,
String newPassword) throws FaultMessage {<br>
<span class="m_271802167605248676gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>ItemDeltaType
passwordDelta = new ItemDeltaType();<br>
<span class="m_271802167605248676gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>passwordDelta.<wbr>setModificationType(<wbr>ModificationTypeType.REPLACE);<br>
<span class="m_271802167605248676gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>passwordDelta.setPath(<wbr>ModelClientUtil.<wbr>createItemPathType("<wbr>credentials/password/value"));<br>
<b>
passwordDelta.getValue().add(<wbr>ModelClientUtil.<wbr>createProtectedString(<wbr>newPassword));</b><br>
ObjectDeltaType deltaType = new ObjectDeltaType();<br>
deltaType.setObjectType(<wbr>ModelClientUtil.getTypeQName(<wbr>UserType.class));<br>
deltaType.setChangeType(<wbr>ChangeTypeType.MODIFY);<br>
deltaType.setOid(oid);<br>
deltaType.getItemDelta().add(<wbr>passwordDelta);<br>
ObjectDeltaListType deltaListType = new
ObjectDeltaListType();<br>
deltaListType.getDelta().add(<wbr>deltaType);<br>
modelPort.executeChanges(<wbr>deltaListType, null);<br>
<span class="m_271802167605248676gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</blockquote>
<div><br>
</div>
<div>How do I get a RawType from the result of the <b>createProtectedString
</b>return type?</div>
<div><br>
</div>
<div>Thank you all.</div>
<div>Regards,<br>
-- </div>
<div class="m_271802167605248676gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr"><b style="font-size:12.8px">Ana
Pereyra</b><br>
</div>
<div dir="ltr"><font style="font-size:12.8px" face="verdana,
sans-serif"><img> Identicum S.A.<br>
<i><font color="#666666">Jorge Newbery
3226, Argentina<br>
Tel: +54 (11) </font></i></font><font style="font-size:12.8px" face="verdana,
sans-serif" color="#666666"><i>4552.3050</i></font>
<div style="font-size:12.8px"><font face="verdana, sans-serif"><i><font size="1"><a href="mailto:apereyra@identicum.com" style="color:rgb(17,85,204)" target="_blank">apereyra@identicum.com</a></font></i><br>
<a href="http://www.identicum.com/" style="color:rgb(17,85,204)" target="_blank"><font color="#000000">www.identicum.com</font></a></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="m_271802167605248676mimeAttachmentHeader"></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
midPoint mailing list
<a class="m_271802167605248676moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a class="m_271802167605248676moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</div>
<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b style="font-size:12.8px">Ana Pereyra</b><br></div><div dir="ltr"><font face="verdana, sans-serif" style="font-size:12.8px"><img src="http://www.identicum.com/img/favicon.ico"> Identicum S.A.<br><i><font color="#666666">Jorge Newbery 3226, Argentina<br>Tel: +54 (11) </font></i></font><font color="#666666" face="verdana, sans-serif" style="font-size:12.8px"><i>4552.3050</i></font><div style="font-size:12.8px"><font face="verdana, sans-serif"><i><font size="1"><a href="mailto:apereyra@identicum.com" style="color:rgb(17,85,204)" target="_blank">apereyra@identicum.com</a></font></i><br><a href="http://www.identicum.com/" style="color:rgb(17,85,204)" target="_blank"><font color="#000000">www.identicum.com</font></a></font></div></div></div></div></div></div></div></div></div></div></div>
</div>