<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi Anton,<br></div><div><br></div><div><span style="font-family: Helvetica, Arial, sans-serif;" data-mce-style="font-family: Helvetica, Arial, sans-serif;"></span></div><div>more comments are inline. At the beginning - this is call and modification I used (and worked for me) :</div><div><br></div><div><strong><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">CURL command</span></strong></div><div>curl.exe --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST http://localhost:8080/midpoint/model/rest/users/fbe385c9-0205-4245-ad0f-30ae90ef99b4 -d @C:\midpoint\samples\rest\modification-assign-account.xml -v</div><div><br></div><div><br></div><div><strong><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">modification-assign-account.xml</span></strong></div><div><p style="margin: 0px;" data-mce-style="margin: 0px;"><objectModification xmlns='http://midpoint.evolveum.com/xml/ns/public/common/api-types-3' xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3'</p><p style="margin: 0px;" data-mce-style="margin: 0px;"> xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"><br> <itemDelta><br> <t:modificationType>add</t:modificationType><br> <t:path>c:assignment</t:path><br> <t:value><br> <c:construction xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"><br> <c:resourceRef oid="resource-0000-0000-0000-000000000001" /><br> </c:construction><br> </t:value><br> </itemDelta><br></objectModification></p></div><div><br></div><div><br></div><div>Best Regards,</div><div>Katarina Valalikova</div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"ANTON OPPERMAN" <antono@btinternet.com><br><b>To: </b>midpoint@lists.evolveum.com<br><b>Sent: </b>Wednesday, July 22, 2015 4:01:57 PM<br><b>Subject: </b>[midPoint] assign account REST call<br><div><br></div>Hi Guys,<br><div><br></div> Trying to assign an account to a user using REST api; copied and modified modification-assign-account.xml from samples.<br> I replaced the resource OID with that of my target resource and deleted the line: <oid>there will be oid</oid></div><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br></div><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><span data-mce-bogus="true" style=""><em>This should be OK, the line <span style="font-family: Helvetica, Arial, sans-serif;" data-mce-style="font-family: Helvetica, Arial, sans-serif;"><oid>there will be oid</oid> is not needed in the sample.</span></em></span></div><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br> If I understand correctly, if there is no OID supplied, midPoint should generate one; however the call fails with:<br><div><em style="font-family: Helvetica, Arial, sans-serif;" data-mce-style="font-family: Helvetica, Arial, sans-serif;"><br></em></div><div><em style="font-family: Helvetica, Arial, sans-serif;" data-mce-style="font-family: Helvetica, Arial, sans-serif;">Yes, midPoint generates oid for objects while they are created/imported. But if you want to modify <em style="font-family: Helvetica, Arial, sans-serif;" data-mce-style="font-family: Helvetica, Arial, sans-serif;">object </em>(assign account to user) you need to know oid of object you are going to modify.</em></div><div><br></div><div><br></div>java.lang.NullPointerException: Cannot invoke method getOid() on null object (new) expression in mapping in outbound mapping for {.../connector/icf-1/resource-schema-3}name in resource:ef2bc95b-76e0-48e2-86d6-3d4f02d3eaef(Active Directory Internal)</div><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br></div><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><em></em><em></em><em>Did you try to assign account via GUI? I think this error might be related with incorrect expression in outbound mapping for the name attribute (<span style="font-family: Helvetica, Arial, sans-serif;" data-mce-style="font-family: Helvetica, Arial, sans-serif;">{.../connector/icf-1/resource-schema-3}name</span>). If you didn't try to assign account via GUI before, could you please try it if it works? Let me know.</em><br><div><br></div> This seems to target the intended resource and if I leave the original <oid> line in tact, the call fails with the same error.<br><div><br></div> Any hints would be appreciated. Some more REST examples would also be welcome ...</div><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div><br></div>Thx,<br> Anton<br><div><br></div><br><div><br></div>_______________________________________________<br>midPoint mailing list<br>midPoint@lists.evolveum.com<br>http://lists.evolveum.com/mailman/listinfo/midpoint<br></div><div><br></div></div></body></html>