Developer

Making HTTP Get Requests from Whitelisted Connections

Make HTTP Get requests from either whitelisted OData or non-OData service connections.

Prerequisites

Define a whitelisted back-end connection used by the application in SAP Mobile Platform Server using the cockpit.

Procedure

  1. If the whitelisted connection is an OData service:
    1. Configure the HttpConversationManager with the MAFLogonManager’s logonConfigurator to respond to the authentication challenges, or use a CommonAuthFlowsConfigurator and register the providers.
    2. Follow the steps Making HTTP Get Requests.
  2. If the whitelisted connection is not an OData service:
    1. Configure the HttpConversationManager with the MAFLogonManager’s logonConfigurator to respond to the authentication challenges, or use a CommonAuthFlowsConfigurator and register the providers.
    2. Use HttpConversationManager and HttpConversationImpl to retrieve the data:
      IManagerConfigurator configurator = LogonUIFacade.getInstance().getLogonConfigurator(context);
      
      HttpConversationManager manager = new HttpConversationManager(context);
      
      configurator.configure(manager);
      
      IHttpConversation conversation = manager.create(baseURL);
      …
      conversation.start();