Please check below code.
i got below error
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.Throwable.printStackTrace()' on a null object reference
check my code
@Override
public void Retrieve(String logicalName, UUID id, @NonNull ColumnSet columnSet, final Callback<Entity> callback) {
StringBuilder content = new StringBuilder();
content.append(GetEnvelopeHeader());
content.append("<s:Body>");
content.append("<d:Retrieve>");
content.append("<d:entityName>" + Utils.encodeXML(logicalName) + "</d:entityName>");
content.append("<d:id>" + Utils.encodeXML(id.toString()) + "</d:id>");
content.append(Utils.objectToXml(columnSet, "d:columnSet", true));
content.append("</d:Retrieve>");
content.append("</s:Body>");
content.append("</s:Envelope>");
SoapEndpoint.Soap(SoapActions.RETRIEVE, new TypedString(content.toString()), new Callback<String>() {
@Override
public void success(String xml, Response response) {
Entity entity = null;
try {
XmlPullParser parser = Xml.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new ByteArrayInputStream(xml.getBytes()), null);
do {
parser.next();
} while(!parser.getName().equals("RetrieveResult"));
parser.require(XmlPullParser.START_TAG, "http://schemas.microsoft.com/xrm/2011/Contracts/Services", "RetrieveResult");
entity = Entity.loadFromXml(parser);
}
catch(Exception ex) {
ex.getCause().printStackTrace();
}
if (entity != null) {
callback.success(entity, response);
}
}
@Override
public void failure(RetrofitError error) {
callback.failure(error);
}
});
}