[midPoint] assign account REST call

Katka Valalikova katkav at evolveum.com
Thu Jul 23 05:58:25 CEST 2015


Hi Anton, 

more comments are inline. At the beginning - this is call and modification I used (and worked for me) : 

CURL command 
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 


modification-assign-account.xml 


<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' 

xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"> 
<itemDelta> 
<t:modificationType>add</t:modificationType> 
<t:path>c:assignment</t:path> 
<t:value> 
<c:construction xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"> 
<c:resourceRef oid="resource-0000-0000-0000-000000000001" /> 
</c:construction> 
</t:value> 
</itemDelta> 
</objectModification> 


Best Regards, 
Katarina Valalikova 
----- Original Message -----

From: "ANTON OPPERMAN" <antono at btinternet.com> 
To: midpoint at lists.evolveum.com 
Sent: Wednesday, July 22, 2015 4:01:57 PM 
Subject: [midPoint] assign account REST call 

Hi Guys, 

Trying to assign an account to a user using REST api; copied and modified modification-assign-account.xml from samples. 
I replaced the resource OID with that of my target resource and deleted the line: <oid>there will be oid</oid> 

This should be OK, the line <oid>there will be oid</oid> is not needed in the sample. 

If I understand correctly, if there is no OID supplied, midPoint should generate one; however the call fails with: 

Yes, midPoint generates oid for objects while they are created/imported. But if you want to modify object (assign account to user) you need to know oid of object you are going to modify. 


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) 

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 ( {.../connector/icf-1/resource-schema-3}name ). If you didn't try to assign account via GUI before, could you please try it if it works? Let me know. 

This seems to target the intended resource and if I leave the original <oid> line in tact, the call fails with the same error. 

Any hints would be appreciated. Some more REST examples would also be welcome ... 

Thx, 
Anton 



_______________________________________________ 
midPoint mailing list 
midPoint at lists.evolveum.com 
http://lists.evolveum.com/mailman/listinfo/midpoint 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20150723/90fbeb81/attachment.htm>


More information about the midPoint mailing list