Skip to Content

Hi All,

I am sure most of us have started working on new release of SAP Mobile Platform 3.0. We got many approaches to develop a mobile application like Kapsel  app development, native OData based app, REST API based app. From SUP 2.2 onwards, this mobile platform provides REST APIs which enable standard HTTP client apps running in any platform to access platform REST services. This platform provides different functionality like

  1. Management and monitoring the apps
  2. Native push notification like APNS , BES, GCM, WNS, MPNS

There is a proper procedure to get start with. First we have to register a client application with proper device information. Once registration is successful, we have follow REST API method to retrieve and update the application.

 

Platform Required: SMP3.0 SP04+ Runtime, Eclipse Kepler with ‘SAP Mobile Platform Tools’ installed (How to?), REST Client (chrome/Firefox)

So lets start it:

1. I have created one OData service using Integration gateway modeling tool for a given databaseHSQLDB.

https://smpserver:8083/gateway/odata/SAP/DEPTHSQLDB;v=1/

 

Note: From SP04 PL01 onward, all Integration Gateway (IGW) URLs are https and listen on admin https port (8083/8084).

2. Open Admin cockpitby running: https://smpserver:8083/Admin/

 

  • Create an Application id by clicking on “New

appid.PNG

  • Move to  “BACK END” tab, provides Endpoint URL

1backendconnection.PNG

NOTE:

 

*Make sure you provide SMP server host name while pasting IGW URLs not localhost/smp server ip.

** If you are accessing OData URL through a proxy then don’t forget to check “Use System Proxy” option. Before that make sure you have configured SMP 3.0 to use proxy to access external resource. Check here.

  • Once done, move to “AUTHENTICATION” tab, There is one already existing profile admin. Save and confirm.

 

secprof.PNG

 

  • To verify if request is reaching to backend server successfully, select newly created application id and click on  ‘Ping‘. You will see a successful message.

 

pingAppID.PNG

 

3. Open Advanced REST Client (from Chrome web store)

Auth.PNG

    • REST Client will convert Authorization values into base64 format
    • Hit the ‘Send‘ button
    • If everything is fine, then you must receive an HTTP 200 OK as the status – this confirms the proxy connection.

/wp-content/uploads/2014/07/6_ge_705695.png

    • Notice the response, you will see two entries of collection. Endpoints and Connections.

/wp-content/uploads/2014/07/getre_705696.png

Register the Application ID

  1. For registration we have to use the “Connections” collection at the end of the
Key Value
Content-Type application/xml
Authorization smp server id and password
X-SMP-APPCID
    • Add this xml text in the RAW body section:

<?xml version="1.0" encoding="utf-8"?> 
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" 
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"> 
<content type="application/xml"> 
<m:properties> 
<d:DeviceType>Android</d:DeviceType> 
</m:properties> 
</content> </entry>









 

    • Here i have added DeviceType as Android. That means registration will be for Android device.
    • Possible valid values for DeviceType are:
DeviceType Device
Android Android Devices
Blackberry Blackberry devices
iOS iOS devices
iPad Apple iPad
iPhone Apple iPhone
iPod Apple iPod
Windows includes desktop or servers with Windows OS such as Windows XP, Windows Vista, Windows 7, and Windows Server series OS
Windows8 includes Windows desktop version
WinPhone8 includes Windows mobile

Check here for more details:  https://help.sap.com/viewer/e501bc6206bc4796b69baa3a634da3f3/3.0.13/en-US/7c0aaf8770061014a403e0decc28cbd6.html

Note: Any other value for above mentioned DeviceType returns a value “Unknown” in the DeviceType column.

 

Here you go,

 

/wp-content/uploads/2014/07/1_post_705672.png

Response:

 

    Status as 201 created and in the Response headers you will see the newly created X-SMP-APPCID

 

/wp-content/uploads/2014/07/1_postrest_705673.png

To Verify the same device registration in the Admin cockpit:

Here, you can see that total registration against com.test.dept application is ‘1’.

/wp-content/uploads/2014/07/applc_655587.png

Go to REGISTRATIONS tab:

Here, userName is smpAdmin for the DeviceType Android.

 

 

          /wp-content/uploads/2014/07/1_post1_705686.png           

 

CRUD operation for the given OData service through SMP server

 

Since we have already created one application id for the given Odata service. Now we have to test if we are able to do GET, POST,PUT, DELETE operation for the same.

GET (Reading a record)

Method: GET

URI http://smpserverhostname:8080/com.test.dept (http://smpserverip:8080/appid)

Header Sections:

Key Value
Authorization same smpuserid and password
Content-Type application/xml
X-CSRF-Token FETCH
X-SMP-APPCID returned value as highlighted above

2_GET.png

For information, SMP 3.0 Integration gateway has a feature to enable the CSRF Token handling. It is required to catch a Token before posting data. Basically CSRF Token are used to creation data successfully with security.See Cross-Site Request Forgery (CSRF)  for additional details.

Response:

Returned X-CSRF-TOKEN value will be used for POST, PUT and DELETE request.

 

 

2_GET_2.png

 

Here, you can see the collection details e.g. DEPARTMENT

 


<?xml version="1.0" encoding="UTF-8"?>
<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://jk:8080/com.test.dept/">
   <workspace>
      <atom:title>Default</atom:title>
      <collection href="DEPARTMENT">
         <atom:title>DEPARTMENT</atom:title>
      </collection>
   </workspace>
</service>







More More precisely, To view the content for the DEPARTMENT table, run this URL  http://jk:8080/com.test.dept/DEPARTMENT

 

For POST, PUT, DELETE : ❗ Features have been added from SMP 3.0 SP03 PL02 onward.

 

POST (Creating a record)

Method: POST

URI http://smpserverhostname:8080/com.test.dept/DEPARTMENT (http://smpserverip:8080/appid/entityset)

 

Header Sections:

Key Value
Authorization same smpuserid and password
Content-Type application/xml
X-SMP-APPCID returned value as highlighted above
X-CSRF-Token returned CSRF token value in GET method

   3_POST.PNG

Body Content:


<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
   <content type="application/xml">
      <m:properties>
         <d:DEPT_ID>105</d:DEPT_ID>
         <d:DEPT_NAME>CanvasM</d:DEPT_NAME>
         <d:DEPT_LOCATION>ITC-5</d:DEPT_LOCATION>
      </m:properties>
   </content>
</entry>







Response:

you must get a “201 Created” status code.

3_POST_2.PNG

3_POST_3.PNG

PUT (Updating a record)

Method: PUT

URI http://smpserverhostname:8080/com.test.dept/DEPARTMENT(‘105’) (http://smpserverip:8080/appid/entityset(‘ID’))

 

Header Sections:

Key Value
Authorization same smpuserid and password
Content-Type application/xml
X-SMP-APPCID returned value as highlighted above
X-CSRF-Token returned CSRF token value in GET method

     4_put_1.PNG

    

Body Content:


<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
   <content type="application/xml">
      <m:properties>
         <d:DEPT_ID>105</d:DEPT_ID>
         <d:DEPT_NAME>Finance</d:DEPT_NAME>
         <d:DEPT_LOCATION>SDB1</d:DEPT_LOCATION>
      </m:properties>
   </content>
</entry>







Response:

you must get a “204 No Content” status code.

4_put_2.PNG

DELETE (deleting a record)

Method: DELETE

URI http://smpserverhostname:8080/com.test.dept/DEPARTMENT(‘105’) (http://smpserverip:8080/appid/entityset(‘ID’))

 

Header Sections:

Key Value
Authorization same smpuserid and password
Content-Type application/xml
X-SMP-APPCID returned value as highlighted above
X-CSRF-Token returned CSRF token value in GET method

5_delete_1.PNG

Body Content: NA

Response:

you must get a “204 No Content” status code.

deleteresponse.PNG

On-Boarding a user on HCPms (HANA Cloud Platform mobile Services)

 

Prerequisite: Enable HCPms service

 

Configuration an application in HCPms:

  1. Logon to SAP HANA Cloud Platform > Subscriptions > hcpmsadmin >Run the application URL (https://hcpmsadmin-<SCNuserID>trial.dispatcher.hanatrial.ondemand.com/ )
  2. Create a new application connection > click on ‘ +’ icon

 

1.PNG

3. Configure backend connection:

URL: http://services.odata.org/V2/OData/OData.svc/

Proxy type: INTERNET (if you want to connect to odata services hosted on on-premise system then you have to configure SAP HANA Cloud connector)

2.PNG

4. Ping the application connection

1_hcpms_appping.PNG

5. Make a POST call as already described above:

server: https://hcpms-<SCNuserid>trial.hanatrial.ondemand.com/odata/applications/latest/com.test.hcpms/Connections

Authorization: SCN user id and password

1_hcpms_post1.PNG

Reference: REST API App Development

For more information: Follow SMP Developer Center, SAP for Mobile

I hope this will blog will help you to understand basic concept of on-boarding of device at SMP 3.0 using REST client.

Your comments and feedback are most welcome.

Cheers,

JK (@jkkansal1987)

To report this post you need to login first.

79 Comments

You must be Logged on to comment or reply to a post.

  1. Serveshwar Mishra

    Hi Jitendra,

    Following your tutorial,

    I’ve created an OData Service and have configured the application in SMP 3.0.

    But when I’m hitting following url:

    http://localhost:8080/odata/applications/latest/com.test.dept

    from the rest client I’m getting status as 200 OK but not getting any thing in the response body.

    I also tried to register a device as mentioned in the tutorial but again the response was 200 OK and nothing in the response body.

    Kindly help.

    Regards,

    Serveshwar Mishra

    (0) 
      1. Serveshwar Mishra

        Getting the same, status code 200 OK and nothing in the response body.

        Probably its an authorization issue.

        I’d opened the server log of SMP 3.0 and getting “Authentication failed Authentication failed due to invalid credentials.” although valid credentials are being supplied.

        (0) 
          1. Serveshwar Mishra

            Hi Jitendra,

            I haven’t made any registration so far, I’m stuck at the very first step itself i.e. after hitting following url: http://smpserverip:8080/com.test.dept dept with “GET” request I’m supposed to get 200 in response status and a response body containing “EndPoints” and “Connections”.

            But I’m getting 200 status in response header and nothing i.e. no xml in the response body.

            I’ve tried with other steps too i.e. tried to register the device with “POST” request as mentioned in the tutorial but always getting the same i.e status 200 OK and an empty response body.

            I’d checked the server log and it says, “com.sybase.security.core.PreConfiguredUserLoginModule##anonymous#http-bio-8084-exec-8###Authentication failed Authentication failed due to invalid credentials.” whenever I’m trying to hit the url via Rest client.

            Untitled.png

            Regards,

            Serveshwar Mishra

            (0) 
            1. Jitendra Kansal Post author

              Serveshwar Mishra

              If you have Firefox installed, check the same GET request in its RESTClient OR clear cache, cookie of browser and Chrome rest client and then try.

              Also, have you set any security profile to existing application? Can you try with some new profile and add its authentication provider as “NoAuthenticationProvider”

              Hope you will get some hints now.

              Rgrds,

              JK

              (0) 
    1. Serveshwar Mishra

      Hi Jitendra,

      I’d tried with uninstalling the rest client and then re installing. I even tried with the RestClient on firefox, but the problem still persists.

      Kindly help

      Regards,

      Serveshwar Mishra

      (0) 
  2. avinash kumar

    Hi Jithendra,

    I’ve been following your blog and implementing from my hybrid application using cordova, and I am succesful registering device

    Code:

    OData.request

      ({

      requestUri:  “http:/serverip:8080/odata/applications/latest/com.demo.test/Connections”, 

                    method: “POST”, 

                        headers:

                            {   

                      “Authorization”: “Basic c21wQWRtaW46V2VsY29tZTAx”,

                            “X-SMP-APPCID”: “”,

                            “Content-Type” : “application/json”

                               },                            

                data: {

      DeviceType:”Android”

         }

    });

    This works fine on my local server, When I try to implement on our global server, I get no response.

    Can you assist me through this.

    <<serverip removed by Jitendra>>

    Thank You

    Avinash

    (0) 
        1. Jitendra Kansal Post author

          Are you able to do the registration from REST client on global SMP server? Are you getting 201 message? Did you find any logs in global server installation path? Make sure you pass the correct credentials under “Authorization” header?

          When you created an app id in Admin cockpit in global smp server, are you able to ping it successfully?

          (0) 
          1. avinash kumar

            Jitendra, I got the solution, since device doesn’t have host, We have to use static host name or address then we will be able to access it. Successfully am able to register. Now all I thinking is, Is this a correct approach for creating hybrid app or should we be using  kapsel plugins to logon and register

            (0) 
            1. Jitendra Kansal Post author

              You can follow two different approaches for creating hybrid apps in smp 3.0

              1. REST API app development : That one you are following right now ( i guess)

              2. Using Kapsel plugins

              It is not mandatory that you should use kapsel plugins for developing hybrid app.

              (0) 
              1. Praveen Kumar Addiki

                Good to hear that ,and is mandatory to develop the ios native app’s using the SMP plugins and  cant  we develop through Rest API?

                If we develop the app through Rest API ,can we reach the SAP standards so to push the application to SAP store?

                (0) 
  3. Saranya sakthivel

    Hi Kansal… Thanks fo this blog .. It is very helpful one. But i am struggled with offline settings. As we know we can configure the offline settings for the app in SMP Cockpit. After configured that how  to test the offline capability in REST Client? Is there any way test it?

    (0) 
    1. Midhun VP

      Hi Saranya,

      REST API based applications will not support offline. Only hybrid and native apps supports offline, you have to use hybrid/native SDK for it.

      Regards, Midhun

      SAP Customer Experience Group – CEG

      (0) 
  4. Saranya sakthivel

    Thanks for the reply.. I have created one hybrid app in the SMP cockpit.. And i configured offline cache for it in that SMP admin cockpit.. could you tell me how i can test it? whether it is working or not in offline mode.. or what steps i can proceed further to get the offline service of the app.

    That will be more helpful.

    (0) 
  5. Saranya sakthivel

    Hi Midhun,

    Your information is really helpful. But If i dont want to test it in the app level and i want to test the SMP server level for offline cache . Is there any way to do it ?? Like testing procedures for that offline cache of SMP cockpit something like that??

    If it is not anyway then i can go with Kapsel Plugin. Please help me with this.

    (0) 
    1. Midhun VP

      Hi Saranya,

      You can’t test offline from SMP server. You have to implement offline in your native or hybrid app to test it.

      Regards, Midhun

      SAP Customer Experience Group – CEG

      (0) 
  6. kumar chakraborty

    Hi Jitendra,

              I am trying to test my application configuration on SMP server using rest client. However I am using SAML based authentication with ADFS as authentication provider. Can I use the rest client on firefox to test the user on boarding???. If so how to go about.

    thanks and regards,

    Kumar.

    (0) 
  7. Satish Jampalwar

    Hi everyone!

    I want to develop a new android application using SAP mobile platform, can any one suggest me any tutorial for beginners that how do i manage gateway connections and how can i get REST apis for different authorizations.

    I will be very thankful for reply.

    Regards,

    Satish J

    (0) 
    1. Midhun VP

      Hi Satish,

      You could follow the guides here:Mobile Application Development Platform for Developers – Native Apps

      But it’s not based on REST APIs. It is based on the Odata native SDK. If your requirement is to develop native apps for android the right approach is developing apps using odata native SDK.

      Odata native SDK supports Android, iOS and win 8.

      REST APIs are used only when you need to support other platforms like BB. In this approach you will not get all the benefits of SMP.

      Regards, Midhun

      SAP Technology RIG

      (0) 
        1. Midhun VP

          Hi Satish,

          I don’t know which is the other SDK you are referring to. If it’s Kapsel SDK it’s for hybrid mobile apps – you will write code once (HTML,Javascript,css) and it runs in multiple mobile platforms.

          Regards, Midhun

          SAP Technology RIG

          (0) 
  8. Sao Vu

    Hi Jitendra,

    I am following your tutorials, and i meet an error 403:

    – First Step: I use GET Method to retrieve X-CSRF-Token. And it work perfectly.

    Screen Shot 2015-05-05 at 4.17.13 PM.png

    – Then, i use returned value from Server to supply to the Headers , and call POST Method:

    Screen Shot 2015-05-05 at 4.17.53 PM.png

    Screen Shot 2015-05-05 at 4.18.05 PM.png

    I don’t know why i got this error? Can you help me to resolve this problem?

    Thanks and Best Regards,

    Sao Vu.

    (0) 
    1. Jitendra Kansal Post author

      Sao Vu

      Can you provide me below info:

      1. What is SMP server version you are working on? e.g. 3.0 SP05

      2. How many odata service are there for the application com.FPT.BookDB?

      3. Are you able to ping the app id in admin cockpit?

      Regards,

      JK

      (0) 
      1. Sao Vu

        Hi Jitendra,

        Thanks for reply.

        1. I am using SMP 3.0 Server SP 05

        2. In my application, i use one Odata Service

        3. Yes, i can ping to my app. But, Gateway cockpit gives me the https:8083 link ( because of SP 05), so i replace it to Http:8080. If i use Https:8083 as backend in Admin, i can NOT ping to app, and if use Http:8080 , i can ping to app. So i use Http:8080 as my endpoint URL.

        I tried to test when replace Https:8083 -> Http:8080, they have no difference.

        Thanks and Regards,

        Sao Vu.

        (0) 
        1. Jitendra Kansal Post author

          Sao Vu

          fyi: odata services exposed via Integration gateway listen on 8083 (admin port) from SP04 onward. It is always better to use https than http as it more secured.

          You have to check INTERNAL option for such services (as i mentioned in step 2)

          Are you able to execute odata service in the browser? and entityset data?

          what is the data source you have binded with entities?

          Regards,

          JK

          (0) 
          1. judy wang

            Hi Jitendra,
                    See your discussion, I am the same problem, the difference is that I need SSO, and therefore can not choose Internal

            Thanks and Regards,

            judy wang

            (0) 
  9. Swathi priya

    Hi Jitendra,

    I have created my own web service in Netweaver for create operation and converted it in to OData service. When i am accessing  through SOAP UI it is working fine and I am getting success message:

    /wp-content/uploads/2015/05/error2_711991.pngBut when trying to make a POST request through Advanced REST client after deploying to SMP, I am getting the below error:

    /wp-content/uploads/2015/05/error1_712010.png

    I am using the Authentication as mentioned in the post as “Internal”. Please let me know if any further information is needed.

    Thanks and Regards,

    Swathi

    (0) 
      1. Swathi priya

        Yes Jitendra, that was another post which i referred for converting. SMP Server Version is 3.0 update 7. Yes it is CREATE only.

        Request mapping:

        /wp-content/uploads/2015/05/req_712115.png

        Response Mapping:


        /wp-content/uploads/2015/05/res_712116.png

        Custom Script:

        /wp-content/uploads/2015/05/custom_712117.png

        “Can you confirm if you are able to execute odata service successfully?” – I am able to get the data but not able to POST

        (0) 
        1. Jitendra Kansal Post author

          Swathi priya

          Can you modified response mapping as below ?

          responsemapping.JPG

          Also can you check SAP Mobile Platform Tools plugin version? it should be 1.4.1 to work with SMP 3.0 SP07 How to install SAP Mobile Platform Tools for Integration Gateway in Eclipse IDE

          Are you able to see “Backend system reached successfully” message after pining app id in Admin cockpit?

          Does that SOAP WS require any proxy settings to access it? Check if you have set any proxy in the browser to access SOAP WS URL.

          Regards,

          JK

          (0) 
          1. Swathi priya

            if i alter the mapping it shows error, as Empid is the key field

            /wp-content/uploads/2015/05/newmap_712309.png

            Also, my SAP Mobile Platform Tools plugin version is 1.4.1

            /wp-content/uploads/2015/05/custom_712314.png

            Yes I am able to ping the back end system, and also the SOAP WS does not require a proxy to access it. Till registering the device, and fetching X-CSRF-Token it is all fine. But when we send the payload and make a POST request is when we get the internal server error

            (0) 
              1. Swathi priya

                Pay Load:

                Request Header:

                /wp-content/uploads/2015/05/reqhead_712377.png

                Payload:

                <?xml version=”1.0″ encoding=”utf-8″?>

                <entry xml:base=”https://bg6sap1007.gdnindia.com:8083/gateway/odata/SAP/EMPCREATE1;v=1/EmpSet” xmlns=”http://www.w3.org/2005/Atom” xmlns:m=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata” xmlns:d=”http://schemas.microsoft.com/ado/2007/08/dataservices“>

                <content type=”application/xml”>

                <m:properties>

                <d:Empid>1000098</d:Empid>

                <d:Empname>AAA</d:Empname>

                </m:properties>

                </content>

                </entry>

                (0) 
                1. Jitendra Kansal Post author

                  Swathi priya

                  I would like to have a look at request URI and Request Headers. Can you share that as well?

                  Can you try with below payload

                  <?xml version=”1.0″ encoding=”UTF-8″?> 

                  <atom:entry xmlns:atom=”http://www.w3.org/2005/Atom” xmlns:d=”http://schemas.microsoft.com/ado/2007/08/dataservices” xmlns:m=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata“> 

                     <atom:content type=”application/xml”> 

                  <m:properties>

                  <d:Empid>1000098</d:Empid>

                  <d:Empname>AAA</d:Empname>

                  </m:properties>

                     </atom:content> 

                  </atom:entry>

                  Regards,

                  JK

                  (0) 
  10. choong chan hol

    by following the tutorial, I Successful ping the application id and get the “Endpoints and Connections” from the Crome REST Client.

    I encounter error when “register the application ID” like the following screen shot. Please help.

    post connection.jpg

    ServiceErrorException.JPG

    Regards

    Choong

    (0) 
  11. Sao Vu

    Hi Jitendra,

    i have a small question:

    How can we reuse X-SMP-APPCID ????

    Suppose i have an application, in first time login, it will register device, and in second time,third time,… i login, but i want it will not register again, and use information that i register in the first time ???

    Thanks and Best Regards,

    SaoVV

    (0) 
      1. Sao Vu

        Hi Jitendra,

        Thanks for reply.

        I have a login screen, User will fill username and pass to textfield and submit to SMP server. So:

        – First time they login: app will register device and turn into other screen

        – Second time login: they still fill , but i want use information from first time, and turn into other screen.

        It likes MAFLogon. But i cannot use maf because of some private reason.

        Thanks and Best Regards,

        Sao Vu.

        (0) 
          1. Sao Vu

            Hi Jitendra,

            No. I mean i use same Login screen.

            1. When the app is installed, user run app: the login screen appear, they fill infor and supply it to SMP server ( this is the first time). He has a session with APPCID,Username,… After finish working, he quits apps.

            2. Another day, he runs app: the login screen appear.( but he registered account in 1.). He fill infor and supply. He has a session (but old APPCID, old username,..).

            ==> i want to ask:

            – How can we get APPCID, USERNAME, APPID,… SMP give us, to reuse ???

            – How can we know that device is registerd ????

            (0) 
            1. Midhun VP

              Hi Sao,

              When you register for the first time, in the response of your login request you will get APPCID (if you use maflogon it will be by default saved in encrypted data-vault. If you are not using maflogon you need to find your own way to store this value). You will be using it for all further transactions from the app.

              If you logout from the app this connection will be deleted from SMP server. Do not let the user logout of the application, hence the user do not need to login again and could use the same APPCID. Hope this satisfies your requirement.

              Regards,Midhun

              SAP Technology RIG

              (0) 
              1. Sao Vu

                Hi Midhun,

                Thanks for reply.

                As MAFLogon, we should Unregister, and APPCID will be deleted. But the user just quit the app, and re-run, so he must re-login again, he does not unregister.

                I want when he re-runs app, he can get previous APPCID,APPID,… and not register new registration to SMP Server.

                Without MAF, just URL Request, how can we do ???

                Thanks and Best Regards.

                Sao Vu.

                (0) 
                1. Midhun VP

                  Hi Sao,

                  I hope you are not following the REST API approach, and you are using Odata SDK.

                  You could follow this blog to not use MAFLogon: Onboarding users with Native OData SDK – SMP 3.0

                  In the response of your request you should get APPCID. You could store it in your local db and use it for all further transactions.

                  What is the reason you are not using MAFLogon component ?

                  Regards,Midhun

                  SAP Technology RIG

                  (0) 
                    1. Midhun VP

                      Hi Kundan,

                      To my knowledge Xamarin uses a different SDK to connect with SMP. I don’t have much information on it. You could raise this question in Xamarin support portal.

                      Regards,Midhun

                      SAP Technology RIG

                      (0) 
  12. kundan sakpal

    Hi Experts,

    First Time when i register device i can get registration ID and i can pull oData services, but when i login in the app next time i want user to call odata service using registration ID which was created before, instead of creating new one.

    How do i store RegistrationID in cache? or In any other option.

    please reply.

    (0) 
  13. judy wang

    HI Jitendra,

            See your discussion, in step 2,I can’t  check INTERNAL option ,because  I need SSO, Please help.4`0IJHWBT)KYDQ8Q(8BU%G8.png

    Thanks and Best Regards.

    judy wang

    (0) 
    1. Jitendra Kansal Post author

      judy wang

      I cant see image you attached in above comment.

      Please note that INTERNAL option is applicable only if OData service has the same host+port as SMP server. In general, OData services exposed via Integration Gateway (in SMP) has same host and port number as SMP so we have to INTERNAL in this case.

      Hope this makes clear.

      Regards,

      JK

      (0) 
      1. judy wang

        Thanks for reply.I’m sorry, but the picture is a failure, my ODATA is the interface of the release of the gataway,  host and port number as SMP is not the same,such as figure, but POST (a record Creating), reported 403 ForbiddenCatch(07-23-10-16-17).jpg

        Catch58BD(07-23-10-16-17).jpg

        GNJ{_27TV`0$8IZ6B_]85CQ.png

        hope to help,thanks!

        (0) 
          1. judy wang

            My mobile phone client needs a lot of interface, ZMINISTERAPPROVE_SRV SRV is among them a. Therefore, I put endponit address set to http: / /… 8080/sap/opu/odata/sap, such mobile terminal each time only need to register a SMP application; also tried to each interface in the admin to create an application, but will encounter the problem of cache, also feel that way is not reasonable

            (0) 
  14. Christopher Neve

    Hi Jitendra,

    Could you provide a few details on why the /odata/applications/latest/ part of the URL is necessary and what it does ? I’ve been reading the OData URL conventions and it doesn’t seem related. Is it used only for registering the application on the mobile platform?

    Many thanks for a great tutorial.

    Warm regards,

    Chris

    (0) 
    1. Jitendra Kansal Post author

      Christopher Neve

      Well, for registering/on-boarding any app (via SMP3), you have to use ../odata/applications/latest/….

      I really cant tell you why this specific part is used but it is necessary.

      From SP08 onward, a version 2 of internal odata services got introduced that means now also this request would work.

      …odata/applications/v2/appid/Connections…

      Even the old v1 is still working (backward comparability)

      Also, if you want to retrieve application info once you got app registration id, you can make a GET call

      http://smpserverhostname:8080/odata/applications/latest/com.test.dept/Connections(('X-SMP-APPCIDvalue‘)

      To unregister/delete an entry from SMP, you can do it by calling DELTE operation

      http://smpserverhostname:8080/odata/applications/latest/com.test.dept/Connections(('X-SMP-APPCIDvalue‘)

      Regards,

      JK

      (0) 
  15. Vasantham S

    Hi Jitendra,

     

    I am trying to do GET request using POSTMAN REST client. I need to configure backend connection in HCPms.  I am getting “Note: Your browser does not support JavaScript or it is turned off. Press the button to proceed”. Backend url has HTTP connection.

    I have attached screenshot.

     

    Thanks in advance.

     

    Regards,

    Vasantham

    (0) 

Leave a Reply