Set the IODPHttpErrorListener to receive HTTP error from the network edge.
ODPClientConnection ocl = ODPClientConnection.getInstance(); IODPHttpErrorListener httpErrorListener = new ODPHttpErrorListenerImpl(); ocl.setODPHTTPErrorListener( httpErrorListener ); Implement the listener public class UserRegistration{ public void startUserRegistration() { UserManager.initialize(appID); UserManager.setConnectionProfile(serverIP, serverPort,farmID); UserManager.enableHTTPS(true); ODPErrorListener odpErrorListener = new ODPErrorListener(); ODPClientConnection.setODPHTTPErrorListener(odpErrorListener); UserManager.registerUser(username, securityConfig,password); }public class ODPErrorListener implements IODPHttpErrorListener { // callback method for HTTP Error Code Listenerpublic void onHttpError(int iErrorCode, String sErrorMessage,Hashtable oHeaders) { Log.i("Error info" +iErrorCode+sErrorMessage); } }
To ensure that OData android clients are notified of HTTP errors while establishing a connection with the network edge, implement this listener.