1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    skarolus is on a distinguished road

      0  

    Default Unanswered: Sencha Touch oData Connector for SAP

    Unanswered: Sencha Touch oData Connector for SAP


    Hi i want to get Data with the oData Connector, but there are always an Error Message:
    401 (Unauthorized).
    My proxy:
    HTML Code:
    proxy: {
    
                type: 'odata',
    
                url: 'https://url..../odata/_vti_bin/listdata.svc/News',
    
                withCredentials: true,
    
                username: 'username',
    
                password: 'password'
    if I try to open the url in the browser, it works with the credentials.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,125
    Answers
    3504
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Are you also trying to do this cross origin?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    skarolus is on a distinguished road

      0  

    Default


    I disabled the web security of google chrome, I don't think this should be the problem.

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    7
    Vote Rating
    0
    GUPTA.221 is on a distinguished road

      0  

    Default


    Hi,

    I am facing the similar issue. This is an authorization error. But when I open the link in the browser in a different tab by providing the credentials, this error is gone. Unfortunately a new error has popped up(Status code 501). Not sure how to resolve this one.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    2
    Vote Rating
    0
    Scott Stefanich is on a distinguished road

      0  

    Default


    I am encountering the same issue.

    Using the error handling from the Flights Unlimited example project, additional error message details were provided: "Logon performed in system ABC, No logon data provided"

    Since username and password properties are being provided, I was expecting an invalid logon data message versus a no logon data message and am therefore proceeding with investigating the proxy itself.

    Like others, the URL works in Google Chrome with disabled web security and in Firefox with the RESTClient add-on.

  6. #6
    Ext Premium User
    Join Date
    Mar 2007
    Posts
    89
    Answers
    2
    Vote Rating
    1
    Luc is on a distinguished road

      0  

    Default


    Quote Originally Posted by skarolus View Post
    HTML Code:
    proxy: {
    
                type: 'odata',
    
                url: 'https://url..../odata/_vti_bin/listdata.svc/News',
    
                withCredentials: true,
    
                username: 'username',
    
                password: 'password'
    Your use of listdata.svc seems to suggest you're connecting to SharePoint, not SAP gateway.

    If so, the issue may be the authentication method used. If your SharePoint uses e.g. claims based authentication, logon will not work.

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    6
    Vote Rating
    0
    dean.wood is on a distinguished road

      0  

    Default Only works in Browsers not on Simulator or Device

    Only works in Browsers not on Simulator or Device


    I have been trying for many weeks now and concluded that the SAP OData Proxy works fine in browsers, but does not work in a Simulator or on Device. The error that occurs is a 401 error, which states that the credentials were not given.

    After launching Chrome with the following parameters:
    open -a "Google Chrome" --args --allow-file-access-from-files --disable-web-security
    The SAP OData Proxy will work and the username and password are understood, but when packaging for the Simulator, it does not work.

    Has anyone got this working, without the need to remove the authentication from the OData service.

    Regards

    Dean

  8. #8
    Ext Premium User
    Join Date
    Mar 2007
    Posts
    89
    Answers
    2
    Vote Rating
    1
    Luc is on a distinguished road

      1  

    Default


    Hi,

    Did you try to include "useHeaderAuthentication: true"? Like so:

    Code:
    proxy: {
                type: 'odata',
                url: "HTTP://GW.ESWORKPLACE.SAP.COM:80/sap/opu/sdata/iwcnt/activity/ActivityCollection",
                withCredentials: true,
                useHeaderAuthentication: true,  
                username: '<yourusername>',
                password: '<yourpassword>'
            }
    Let me know if that works.

    Thanks.

  9. #9
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    6
    Vote Rating
    0
    dean.wood is on a distinguished road

      0  

    Smile


    Luc,

    Perfect, just tried and that did the trick, fantastic, I now have a fully functioning SAP Odata Application using a SAP Hana OData Service on an iOS Device.

    Many thanks for your help.

    Dean

  10. #10
    Ext Premium User
    Join Date
    Mar 2007
    Posts
    89
    Answers
    2
    Vote Rating
    1
    Luc is on a distinguished road

      0  

    Default


    Hi Dean,

    Fantastic!

    Glad I could help.