<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body 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="moz-txt-link-freetext" href="http://localhost:8080/midpoint/model/model-3">http://localhost:8080/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-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-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-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-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="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 05.01.2017 19:52, Ana Pereyra wrote:<br>
    </div>
    <blockquote
cite="mid:CAO5EgRr4ihx2hkFE+HLFA1gFK5xZAKUGTMvOmKdzyXNtutFrEg@mail.gmail.com"
      type="cite">
      <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
            moz-do-not-send="true"
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">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</a>):
          the method ItemDeltaType.getValue() returns a list of RawType,
          and the ModelClientUtil.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(ModelPortType modelPort, String oid,
            String newPassword) throws FaultMessage {<br>
            <span class="gmail-Apple-tab-span" style="white-space:pre">               </span>ItemDeltaType
            passwordDelta = new ItemDeltaType();<br>
            <span class="gmail-Apple-tab-span" style="white-space:pre">               </span>passwordDelta.setModificationType(ModificationTypeType.REPLACE);<br>
            <span class="gmail-Apple-tab-span" style="white-space:pre">               </span>passwordDelta.setPath(ModelClientUtil.createItemPathType("credentials/password/value"));<br>
            <b>       
passwordDelta.getValue().add(ModelClientUtil.createProtectedString(newPassword));</b><br>
                    ObjectDeltaType deltaType = new ObjectDeltaType();<br>
                   
            deltaType.setObjectType(ModelClientUtil.getTypeQName(UserType.class));<br>
                    deltaType.setChangeType(ChangeTypeType.MODIFY);<br>
                    deltaType.setOid(oid);<br>
                    deltaType.getItemDelta().add(passwordDelta);<br>
                    ObjectDeltaListType deltaListType = new
            ObjectDeltaListType();<br>
                    deltaListType.getDelta().add(deltaType);<br>
                    modelPort.executeChanges(deltaListType, null);<br>
            <span class="gmail-Apple-tab-span" style="white-space:pre">       </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="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
                                style="font-size:12.8px" face="verdana,
                                sans-serif"><img moz-do-not-send="true"
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
                                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 moz-do-not-send="true"
href="mailto:apereyra@identicum.com" style="color:rgb(17,85,204)"
                                        target="_blank">apereyra@identicum.com</a></font></i><br>
                                  <a moz-do-not-send="true"
                                    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="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>