+ Start a Discussion
VFVF 

issue while using the metadata api

Hello,
 
I have an issue while using the metadata api the issue is -
 
We are using metadata api to get the report information (like criteria, fields selected, etc...). But we are getting error while using the API call 'retrieve'. Error is "java.io.IOException: Non nillable element 'version' is null." We are accessing this API in java. what will be the problem?
 
Please help me out of this issue as its urjent requirement for me. 
 
Thanks and Regards
 



Best Answer chosen by Admin (Salesforce Developers) 
Mark SFMark SF

You need to set the API version for the retrieve request:

 

private static final double API_VERSION = 17.0;

RetrieveRequest retrieveRequest = new RetrieveRequest();
retrieveRequest.setApiVersion(API_VERSION);
setUnpackaged(retrieveRequest);

 

See the doc at

http://www.salesforce.com/us/developer/docs/api_meta/index_Left.htm#StartTopic=Content/meta_retrieve.htm

for a complete Java sample.