cancel
Showing results for 
Search instead for 
Did you mean: 

[-10204] Communication with the server failed with status code: 404-Android Offline store

Former Member
0 Kudos

Hi,

I am trying to open offline store in my Android Native app, But i couldn't do it successfully. I am getting "com.sap.smp.client.odata.exception.ODataNetworkException: Unknown network error occured". The callback for setofflinelistener is called, and offlinestore state changes from "offlinestore" opening then Initializing then populating, atlast offlineStoreOpenFailed is called. But, I can open onine store successfully, Can anyone help me to resolve this issue. I have given the code snippet below for offline store.

CODE:

private boolean OpenOfflineStore() throws OfflineODataStoreException

  {

  if (offlineStore==null){

  try {

  //This instantiate the native UDB libraries which are located in the

   //libodataofflinejni.so file

    ODataOfflineStore.globalInit();   

          LogonCoreContext lgCtx = LogonCore.getInstance().getLogonContext();

          String endPointURL = lgCtx.getAppEndPointUrl();

          URL url = null;

          try {

              url = new URL(endPointURL);

          } catch (MalformedURLException e) {

              e.printStackTrace();

          }

  

  

          ODataOfflineStoreOptions options = new ODataOfflineStoreOptions();

          options.host = url.getHost();

          options.port = String.valueOf(url.getPort());

  

  

          options.enableHTTPS = lgCtx.isHttps();

          options.serviceRoot= endPointURL;

          Log.e("Connection id", "" + lgCtx.getConnId());

  

  

          String appConnID = lgCtx.getConnId();

          options.customHeaders.put("X-SMP-APPCID", appConnID);

  

          CredentialsProvider credProvider = CredentialsProvider.getInstance(lgCtx);

          HttpConversationManager manager = new CommonAuthFlowsConfigurator(this).

                  supportBasicAuthUsing(credProvider).configure(new HttpConversationManager(this));

          options.conversationManager = manager;

  

  

          options.enableRepeatableRequests = false;

          options.storeName="store name";

  

  

          options.definingRequests.put("Notifications","Projects");

  

  

          offlineStore = new ODataOfflineStore(this);

          offlineStore.setOfflineStoreListener(this);

  

  

          try {

              Log.e("","OpenOfflineStore: open");

              offlineStore.openStoreSync(options);

            }

      catch(Exception e)

      {

            e.printStackTrace();

      }

  return true;

  } catch (Exception e) {

  throw new OfflineODataStoreException(e);

  }

  } else {

  return true;

  }

  //END

  }

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rathish,

I have faced the same issue with SP05. Are you using the same?

If yes, lease update your SDK to the latest version and try.

Opening offline store worked with SP07 and SP08 for me, but not with SP05.

Regards,

Dhani

Former Member
0 Kudos

Hi Dhani Former Member

First of all thank you for the update. I am using SP07 with the above code still i am getting the same error. My SMP server was SP05, and my doubt is whether that may be the cause. But my online store is working fine.

Whether i have to give a  try with SP08..? But i couldn't download SP08.

Any Server related changes should be made..?

Kindly advice me.

Former Member
0 Kudos

Hi Rathish,

     SMP 3.0 server SP05 was released with SMP 3.0 SDK SP06

     Can you please  upgrade both SDK and server to their latest version and give it a try?

     Server : SMP 3.0 server SP07 PL02

     SDK : SMP 3.0 SDK SP08 PL01

Regards,

Dhani