36 Replies Latest reply: Jun 4, 2014 2:57 PM by Ravindra Dolas RSS

Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1

Ponnusamy Durai
Currently Being Moderated

Greetings,

 

I am trying to find some documentation or tutorial to explain how to write a Native application (iOS or Android) that can consume an OData channel from Netweaver gateway.

 

What needs to be done on SUP server (or Data Proxy as the case may be) to make this happen?

 

So far I haven't been successful in turning up any such tutorial.

 

Appreciate your time.

 

Thanks

pj

  • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
    David Thirakul
    Currently Being Moderated

    Hi PJ !

     

    You raise a good question. Unfortunately, there is nothing available at the moment (at the time of writing this reply).

    To answer your question, the effort required on SUP is configuration work in SCC. You will have to set your OData provider information in the application connection setting.

    For more information, there is a blog on this:

    [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/28283|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/28283]

     

    I hope this helps. Good luck !

    Kind regards,

    David

     

    Edited by: David Thirakul on Jan 17, 2012 3:46 AM

    • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
      Srinivas Divakarla
      Currently Being Moderated

      In SCC you have to provide the details of NWGW, under proxy template

      but sadly when I provide the details of the service URL and credentials, it says Unathorized, where as I am able to access the same from the browser.

       

      Not too sure, but I think it's it's not sending the User and password detaills

    • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
      Srinivas Divakarla
      Currently Being Moderated

      What will be the end URL, consider a scenario where you would like to connect SUP 2.1 with relay server. and at the other end you will have netweaver gateway which is connected to SUP

       

       

      SAP <--->NWGW<-> SUP 2.1<


      > Relay server <-----> iOS/Android

       

      in this kind of connection what will be the URL for metadata or service doc, which I can mention in the code?

    • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
      Ponnusamy Durai
      Currently Being Moderated

      Thanks David.

       

      That's exactly the information I was looking for. I will try it out and update.

       

      thanks

      pj

    • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
      Ponnusamy Durai
      Currently Being Moderated

      Hi David

       

       

      Following your instructions, I have made some progress. But it is still not working. (This is a bit long. Please bear with me.)

       

       

      Basically what I am attempting to do is to get the 'TravelManagement' iOS application run from my iOS emulator and get it talking to the FlightData OData channel in the NW Gateway.

       

      Here are the things I have managed to do:

       

      - Install the NW GW and access the FlightData OData channel that comes with it. I am able to see the XML packets from the following Urls.

      http://nplhost:8042/sap/opu/sdata/IWFND/RMTSAMPLEFLIGHT/  (I will call this the ServiceUrl)

      http://nplhost:8042/sap/opu/sdata/IWFND/RMTSAMPLEFLIGHT/$metadata?sap-client=001&$format=xml (Lets call this Metadata URL)

       

      But.. It requires that I enter username/password for the SAP NWGW developer account on the browser download these XML documents. (This is relevant because later on I am not finding an appropriate place to enter this UserName/Password combination)

       

      - Following your instructions , in SCC I had created the following items.

         - In SCC , in 'Applications' tab I created an entry with ApplicationID as 'NewFlight'. (Interestingly it had to be 'NewFlight' because this AppId is hard coded in the iOS sample client. When I used some other string, the initial connection from device failed).

         - In SCC, in 'Application Connections' tab I created a registration item with a user name and activation code. Application Identifier for this is 'NewFlight'.

        - In this registration entry (Application Connection) settings/'Proxy/Application EndPoint'  I entered the ServiceUrl as. I left 'Push Endpoint' as it was. I don't yet know what that is for.

       

      - Built the iOS application (I downloaded this sample from SUPApps site) with XCode 4. It built and runs ok. In the settings page I see the following options.

          Afaria [On/Off]

          ServerName

          PortNumber

         CompanyId

         UserName

         ActivationCode

       

        APP Username (?)

        APP Password (?)

       

      I am not sure what the last two input items are. I took a wild stab and used the SAP developer account creds here (but to no avail).

       

      The initial connection (registration) actually succeeds. Device app declares that registration succeded. In SCC also I can see the Application Connections entry get filled out Device ID and other stuff.

       

      But device app later fails saying unable to Parse XML. This is the log I see in XCode output panel.

       

      -


      2012-01-17 12:55:04.291 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : TestVault123]

      2012-01-17 12:55:12.458 TravelManagement[39796:207] DataVault unlocked

      2012-01-17 12:55:12.592 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : TestVault123]

      2012-01-17 12:55:12.595 TravelManagement[39796:207] DEBUG :: Initializing Messaging Client with [Application Id : NewFlight]

      2012-01-17 12:55:12.600 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : 86668656C76F11DFB6F7BE23E0D72085]

      2012-01-17 12:55:12.605 TravelManagement[39796:207] DEBUG :: Initialize User Registration Manager with [Application Id : NewFlight]

      2012-01-17 12:55:12.606 TravelManagement[39796:207] DEBUG :: Initializing a default vault with [Vault : 86668656C76F11DFB6F7BE23E0D72085]

      2012-01-17 12:55:12.608 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : 86668656C76F11DFB6F7BE23E0D72085]

      2012-01-17 12:55:12.623 TravelManagement[39796:207] 192.168.0.138, 5001, 0, user0010, aaa

      2012-01-17 12:55:12.634 TravelManagement[39796:207] DEBUG :: Setting Connection Properties with [Host : 192.168.0.138][Port : 5001][Farm Id : 0]

      2012-01-17 12:55:12.641 TravelManagement[39796:207] DEBUG :: Registering User with [User Name : user0010]

      2012-01-17 12:55:12.642 TravelManagement[39796:207] DEBUG :: Initializing Messaging Client with [Application Id : NewFlight]

      2012-01-17 12:55:12.647 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : 86668656C76F11DFB6F7BE23E0D72085]

      2012-01-17 12:55:12.651 TravelManagement[39796:207] DEBUG :: Registering User with [Port : 5001][Host : 192.168.0.138][FarmId : 0][User : user0010]

      2012-01-17 12:55:12.691 TravelManagement[39796:5e03] DEBUG :: Connection Status Changed with [Status : Disconnected]

      2012-01-17 12:55:13.921 TravelManagement[39796:6303] DEBUG :: Connection Status Changed with [Status : Connected]

      2012-01-17 12:55:14.189 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [11004 : 20120117T125514]

      2012-01-17 12:55:14.197 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10300 : 0]

      2012-01-17 12:55:14.208 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [11003 : ]

      2012-01-17 12:55:14.223 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [1 : 192.168.0.138]

      2012-01-17 12:55:14.231 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2 : 5001]

      2012-01-17 12:55:14.243 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [3 : 0]

      2012-01-17 12:55:14.251 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10001 : user0010]

      2012-01-17 12:55:14.257 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10002 : aaa]

      2012-01-17 12:55:14.262 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10004 : ]

      2012-01-17 12:55:14.267 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10005 : 0]

      2012-01-17 12:55:14.272 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [11002 : 0]

      2012-01-17 12:55:14.281 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [1305 : /tm/?cid=%cid%]

      2012-01-17 12:55:14.286 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10300 : 0]

      2012-01-17 12:55:14.295 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [1200 : iPhone Simulator (5.0)]

      2012-01-17 12:55:14.300 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [11007 : 0]

      2012-01-17 12:55:14.305 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [10200 : 1]

      2012-01-17 12:55:14.466 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [11003 : 20120117T124554]

      2012-01-17 12:55:14.473 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2001 : ICDAIBIJACIBIBAANEHFHBBDHJLKIMGNJNJBOGHKEJCJNHDJOEBELDFIGOFPEIMNGCENLFGHAPBHHNEAIGKINNDGHKCJOGJAPINILMGNBNJPBEKGBABFBCCGAGMBNCEENKJHKHEONMPECJOKHHFFDBEJHOKLCNNHMFMNHJCGDMPBLLDLCAPNNPDNMJMODJJNJEDDNCKLOJEGMCLFBMOOJCDPHBNPMKMHLHBINLCKMLJBELPNNDONCHFCLBIGLEAJLDHKIJEFMEGGFMLJACADABAAAB]

      2012-01-17 12:55:14.481 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2606 : ]

      2012-01-17 12:55:14.488 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2603 : 1]

      2012-01-17 12:55:14.495 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2602 : 1]

      2012-01-17 12:55:14.502 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2601 : 1]

      2012-01-17 12:55:14.509 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [1400 : 2]

      2012-01-17 12:55:14.518 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [3000 : ]

      2012-01-17 12:55:14.525 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [2801 : RSA]

      2012-01-17 12:55:14.531 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [3001 : http://sandor:8000/GWC/SUPNotification]

      2012-01-17 12:55:14.544 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [1304 : 1]

      2012-01-17 12:55:14.552 TravelManagement[39796:6303] DEBUG :: Settings exchanged with [1303 : 50]

      2012-01-17 12:55:14.724 TravelManagement[39796:207] registered

      2012-01-17 12:55:14.734 TravelManagement[39796:207] URL to requestWithURL:

      2012-01-17 12:55:14.741 TravelManagement[39796:207] Request sent

      2012-01-17 12:55:14.743 TravelManagement[39796:1f07] ERROR :: (null):Empty URL Passed/Location:-[SUPRequest startSynchronous] + 989

      2012-01-17 12:55:14.748 TravelManagement[39796:207] Download failed from: , error code: 1 description: Error Domain=EmptyURL Code=1 "The url is empty" UserInfo=0x854d330 {NSLocalizedDescription=The url is empty}!

      2012-01-17 12:55:14.749 TravelManagement[39796:207] error parsing payload: (null)

      Current language:  auto; currently objective-c

      2012-01-17 14:00:09.182 TravelManagement[39796:6b07] ERROR :: 571:Error: 571 Detail: client timed out waiting for server - timeout value set as 3600 seconds Source: /Users/iotabuilder/svn/Pioneer/MOClients/iPhone/../Common/C/moClient.cpp 1692./Location:-[LiteSUPMessagingClientConnListener onConnectionStateChanged:connectionType:error:errorMsg:] + 130

      -


       

       

      " ERROR :: (null):Empty URL Passed/Location:-[SUPRequest startSynchronous] + 989 "

       

      This error seems to be the key failure. The ServiceURL is still missing on the pipeline. It looks like the URL should download to the device as part of SettingsExchange and it didn't.

       

      Also the username/password required by the browser when I hit those URLs, where do they come in? Is this the "APP User Name and APP Password" in the device settings screen?

       

      What am I missing? (Am I even in the same ball park?)

       

      thanks

      pj

       

      Edited by: PJ Durai on Jan 17, 2012 10:15 PM  Yikes. The whole thing has come up in a lump. I must have offended the markup engine somehow. I just want it to be plain text.

      • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
        Ponnusamy Durai
        Currently Being Moderated

        I seem to have offended the Markup Engine Gods. My whole post is coming up in a single lump.

        Any help with formatting guys?

         

        How Can I turn off the Wiki Markup?

         

        thanks

        pj

      • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
        Ponnusamy Durai
        Currently Being Moderated

        Hi David

         

        Following your instructions, I have made some progress. But it is still not working. (This is a bit long. Please bear with me.)

         

        Basically what I am attempting to do is to get the 'TravelManagement' iOS application run from my iOS emulator and get it talking to the FlightData OData channel in the NW Gateway.

         

        Here are the things I have managed to do:

         

        - Install the NW GW and access the FlightData OData channel that comes with it. I am able to see the XML packets from the following Urls.

        http://nplhost:8042/sap/opu/sdata/IWFND/RMTSAMPLEFLIGHT/  (I will call this the ServiceUrl)

        http://nplhost:8042/sap/opu/sdata/IWFND/RMTSAMPLEFLIGHT/$metadata?sap-client=001&$format=xml (Lets call this Metadata URL)

         

        But.. It requires that I enter username/password for the SAP NWGW developer account on the browser download these XML documents. (This is relevant because later on I am not finding an appropriate place to enter this UserName/Password combination)

         

        - Following your instructions , in SCC I had created the following items.

            

        • In SCC , in 'Applications' tab I created an entry with ApplicationID as 'NewFlight'. (Interestingly it had to be 'NewFlight' because this AppId is hard coded in the iOS sample client. When I used some other string, the initial connection from device failed).

            

        • In SCC, in 'Application Connections' tab I created a registration item with a user name and activation code. Application Identifier for this is 'NewFlight'.

            

        • In this registration entry (Application Connection) settings/'Proxy/Application EndPoint'  I entered the ServiceUrl as. I left 'Push Endpoint' as it was. I don't yet know what that is for.

         

         

        - Built the iOS application (I downloaded this sample from SUPApps site) with XCode 4. It built and runs ok. In the settings page I see the following options.

            Afaria [On/Off]

            ServerName

            PortNumber

           CompanyId

           UserName

           ActivationCode

         

          APP Username (?)

          APP Password (?)

         

        I am not sure what the last two input items are. I took a wild stab and used the SAP developer account creds here (but to no avail).

         

        The initial connection (registration) actually succeeds. Device app declares that registration succeded. In SCC also I can see the Application Connections entry get filled out Device ID and other stuff.

         

        But device app later fails saying unable to Parse XML. This is the log I see in XCode output panel.

         

         

        2012-01-17 12:55:04.291 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : TestVault123]

        2012-01-17 12:55:12.458 TravelManagement[39796:207] DataVault unlocked

        2012-01-17 12:55:12.592 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : TestVault123]

        2012-01-17 12:55:12.595 TravelManagement[39796:207] DEBUG :: Initializing Messaging Client with [Application Id : NewFlight]

        2012-01-17 12:55:12.600 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : 86668656C76F11DFB6F7BE23E0D72085]

        2012-01-17 12:55:12.605 TravelManagement[39796:207] DEBUG :: Initialize User Registration Manager with [Application Id : NewFlight]

         

         

        2012-01-17 12:55:12.606 TravelManagement[39796:207] DEBUG :: Initializing a default vault with [Vault : 86668656C76F11DFB6F7BE23E0D72085]

        2012-01-17 12:55:12.608 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : 86668656C76F11DFB6F7BE23E0D72085]

        2012-01-17 12:55:12.623 TravelManagement[39796:207] 192.168.0.138, 5001, 0, user0010, aaa

        2012-01-17 12:55:12.634 TravelManagement[39796:207] DEBUG :: Setting Connection Properties with [Host : 192.168.0.138][Port : 5001][Farm Id : 0]

        2012-01-17 12:55:12.641 TravelManagement[39796:207] DEBUG :: Registering User with [User Name : user0010]

        2012-01-17 12:55:12.642 TravelManagement[39796:207] DEBUG :: Initializing Messaging Client with [Application Id : NewFlight]

        2012-01-17 12:55:12.647 TravelManagement[39796:207] DEBUG :: Fetching Vault with [Vault ID : 86668656C76F11DFB6F7BE23E0D72085]

        2012-01-17 12:55:12.651 TravelManagement[39796:207] DEBUG :: Registering User with [Port : 5001][Host : 192.168.0.138][FarmId : 0][User : user0010]

        2012-01-17 12:55:12.642 TravelManagement[39796:207] DEBUG :: Initializing Messaging Client with [Application Id : NewFlight]

         

        • Bunch of Settings Exchange Logs *

         

        2012-01-17 12:55:14.743 TravelManagement[39796:1f07] ERROR :: (null):Empty URL Passed/Location:-[SUPRequest startSynchronous] + 989

         

         

         

        This error seems to be the key failure. The ServiceURL is still missing on the pipeline. It looks like the URL should download to the device as part of SettingsExchange and it didn't.

         

        Also the username/password required by the browser when I hit those URLs, where do they come in? Is this the "APP User Name and APP Password" in the device settings screen?

         

        What am I missing?

         

        thanks

        pj

  • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
    Andrew Whitaker
    Currently Being Moderated

    Hi All,

     

    I just happened to read over this thread.  A number of How-To guides are currently in draft covering this topic across Android, Blackberry and iOS.  In addition the guides will cover notifications from a client perspective and cover SP3 updates from the older guides currently available.

     

    They will become available on SDN and possibly the SUP official help tutorial pages.

     

    Regards,

     

    Andrew Whitaker - Customer Solution Adoption - Mobility - APJ.

  • Re: Consuming OData channel service from SAP NWGW in iOS/Android thru SUP 2.1
    Andrew Whitaker
    Currently Being Moderated

    Hi,

     

    This is a very old post.  If you are looking for legacy solutions please check the how to guides I created below for android integration.  Please note the SUP API's have changed and their are different ways to integrate Android and Gateway.  Please see the links mentioned above.  I am including my documents purely to close off this thread and help where requried.

     

     

    http://scn.sap.com/people/andrew.whitaker2/content

     

    Andy

     

    SAP for Mobile

    Andrew Whitaker

Actions