You need to sign in to do that
Don't have an account?
Daniel Gonzalez Torres
Metadata API v31.0 checkRetrieveStatus error
I am trying the version 31.0 of the metadata api. There is a new async method checkRetrieve status that accepts an asyncRetrieveId (e.g. 09SK0000001DmPTMA0) but my program throws an exception when I check for the tretrieve status.
I'm trying to retrieve a couple of Apex Classes (already in v31.0).
This is the exception I get:
I'm trying to retrieve a couple of Apex Classes (already in v31.0).
This is the exception I get:
com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://soap.sforce.com/2006/04/metadata:done' but found 'http://soap.sforce.com/2006/04/metadata:fileProperties' at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:389) at com.sforce.ws.bind.TypeMapper.verifyElement(TypeMapper.java:418) at com.sforce.soap.metadata.RetrieveResult.loadFields(RetrieveResult.java:237) at com.sforce.soap.metadata.RetrieveResult.load(RetrieveResult.java:230) at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:631) at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:507) at com.sforce.soap.metadata.CheckRetrieveStatusResponse_element.loadFields(CheckRetrieveStatusResponse_element.java:62) at com.sforce.soap.metadata.CheckRetrieveStatusResponse_element.load(CheckRetrieveStatusResponse_element.java:54) at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:631) at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:507) at com.sforce.ws.transport.SoapConnection.bind(SoapConnection.java:174) at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:148) at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99) at com.sforce.soap.metadata.MetadataConnection.checkRetrieveStatus(MetadataConnection.java:229) at com.force.deploy.tools.MainUIController.processApex(MainUIController.java:683)
Changed from:
to:
All Answers
Changed from:
to:
I had places in my code that were still referencing API 29. In particular I had:
If I'm not mistaken, because the request was defined as API 29.0, the responce was given in API 29.0 format, which is different then API 31.0+. When the wsc parser tries to parse it, it tries to hold the responce against validation for whatever API version it was compiled for, which is why the exception starts at the verifyTag method within the wsc.
Updating to API 33.0 throughout my application fixed the issue.