Expand my Community achievements bar.

Dataservice getItem getting identity error

Avatar

Level 2
I am making a call to a dataservice assembler and getting a
fault on the call with the reason of:



Missing Identity Properties: userMasterId



I am calling the dataservice with the following call:



var ids:Object = new Object();

ids["login"] = this.login;

var call:AsyncToken = service.getItem(ids);

call.addResponder(responder);



On the server side, I have in the data-management-config.xml



<destination id="userDetails">



<adapter ref="java-dao" />

<security>

<security-constraint ref="appUser"/>

</security>

<properties>

<source>userDetailsAssembler</source>

<factory>spring</factory>



<metadata>

<identity property="userMasterId"/>

</metadata>



<network>

<session-timeout>20</session-timeout>

<paging enabled="true" pageSize="20" />

<throttle-inbound policy="ERROR" max-frequency="500"/>

<throttle-outbound policy="REPLACE"
max-frequency="500"/>

</network>

</properties>

</destination>



It doesn't actually call my assembler method. It's unclear
where the issue is. If I chance the value of the identity property,
the new name is reflected in the error. Please note that the
assembler is spring loaded. Since it doesn't know what type of
object is coming back, I'm not sure why it is complaining about not
being able to find the the identity properties.



Any thoughts?



Thanks,

Tom
1 Reply

Avatar

Level 2
Okay - I figured it out.



The array that is used to pass in the search criteria MUST
have the same name as the identity property on the server. So, the
following had to be changed.



var ids:Object = new Object();

ids["login"] = this.login;

var call:AsyncToken = service.getItem(ids);

call.addResponder(responder);



to



var ids:Object = new Object();

ids["userMasterId"] = this.login;

var call:AsyncToken = service.getItem(ids);

call.addResponder(responder);



Makes sense. I had hoped the error message would have been a
little more useful.