cancel
Showing results for 
Search instead for 
Did you mean: 

How to consume OData from SAP Gateway using SUP 2.1?

Former Member
0 Kudos

Hi everyone,

I read many discussions about using Odata SDK and connecting a mobile app with SUP but I still have a question in mind.

It appears that using Odata channel is only possible with the OData SDK for native applications. So, how to consume a service developed on gateway (providing Odata) in the hybrid way of developing mobile app on SUP? I would like to bind an MBO to my Gateway OData service on Sybase unwired workspace like another kind of data provider (REST service, SOAP...).

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

markteichmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

oData support as a data source for MBOs is planned to be available in SUP 2.5 which may be released in Q3/2012. Until then you can only use oData sources for online apps in native apps.

Regards,

Mark

former_member184221
Contributor
0 Kudos

Mark, By SUP 2.5 I assume you mean SUP 2.2 or perhaps SMP 2.3 release ?

markteichmann
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi David,

that is a good question 🙂

As I said that one year ago I better should have added a reference for my statement above.

I think I heard that from a Sybase contact back then but it seems that it is still not possible in SMP 2.3 today. Maybe the Syclo Integration has changed some planned features or maybe I understood something wrong...

Sorry that my information might be misleading as of today.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks a lot.

Former Member
0 Kudos

Hi Mark,

How to consume OData Service via SUP2.2 for Hybrid Applications (using HTML5,jQuery,JavaScript). I 

have done Proxy Settings in Sybase Control Center (SCC).But, how can i connect to SUPServer here, to consume OData Service through SUP2.2 ?. Can you please suggest a solution on this ?

Thanks in Advance.

Regards,

Hemagiri

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can create MBO's that access the OData source following this sample.

http://scn.sap.com/docs/DOC-33172

Alternatively you can access the OData source directly from your HTML page using the datajs library in SUP 2.2

IE

<html>

<head>

<script src="js/datajs-1.0.3.js"></script>

<script>

function successCallback(data, response) {

    document.writeln("<table><tr><th>Name</th><th>Description</th></tr>");

    for (var i = 0; i < data.results.length; i++) {

        document.writeln("<tr><td>" + data.results[i].Name + "</td><td>" + data.results[i].Description + "</td></tr>");

    }

    document.writeln("</table>");

}

function errorCallback(e) {

    alert("An error occurred");

    alert(e);

}

</script>

</head>

<body>

<script>

    OData.read("http://services.odata.org/OData/OData.svc/Products", successCallback, errorCallback);

</script>

</body>

</html>

former_member184221
Contributor
0 Kudos
former_member184221
Contributor
0 Kudos

Danial, great reply as ever I like your first reference, I had not spotted that article before, I assumed it was possible, but possibly tricky. I will give it a try. Thanks David

Former Member
0 Kudos

Thank you Daniel and David. Thanks a lot

I started using the datajs-1.0.3.js library to access OData source via SUP2.2 . I am able to retrieve the data from the OData source, but it is not integrating with SUP2.2.  I can see the "Basic authentication" ," Authentication against OData", and two more in the following provided link

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01853.0222/doc/html/vhu13...

The SUP2.2 Server what i am using is licensed one.Do i need to use "Basic Authentication" or "Authentication against OData " to consume OData source for  what i have done the Proxy settings

in Sybase Control center. I havent seen the connection details in datajs-1.0.3 to connect to SUPServer providing any ipaddress , SUPServer_Username , SUPServer_Password . So, how i can  connect to SUPServer in this case ?

Please suggest me the brief solution and i would be very thankful to your's

Thanks in Advance,

Hemagiri

Former Member
0 Kudos

Thank you Daniel and David. Thanks a lot

I started using the datajs-1.0.3.js library to access OData source via SUP2.2 . I am able to retrieve the data from the OData source, but it is not integrating with SUP2.2.  I can see the "Basic authentication" ," Authentication against OData", and two more in the following provided link

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01853.0222/doc/html/vhu13...

The SUP2.2 Server what i am using is licensed one.Do i need to use "Basic Authentication" or "Authentication against OData " to consume OData source for  what i have done the Proxy settings

in Sybase Control center. I havent seen the connection details in datajs-1.0.3 to connect to SUPServer providing any ipaddress , SUPServer_Username , SUPServer_Password . So, how i can  connect to SUPServer in this case ?

Please suggest me the brief solution and i would be very thankful to your's

Thanks in Advance,

Hemagiri

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am not clear on what you are trying to do.  It may help to include some screen shots and perhaps explain what your objectives are.

For the sample code I included above, I should mention that if you wish to try it in Chrome, you will need to start Chrome with the flag --disable-web-security as the browser does not allow you to make a connection to another server (services.odata.org) in this case.  It does however run correctly in the Hybrid Web Container.

Former Member
0 Kudos

Hi Daniel,

I am trying to develop OData Hybrid app via SUP2.2 without using MBO'S. Please check the following step-by-step screens of my sample project name "Project1" .

   

<!DOCTYPE html>
<html>
<head>
<title>Sample</title>
<script type="text/javascript" src="../js/datajs-1.0.3.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
</head>
<body>

<input type="text" id="site"/>
<input type="submit" id="clickButton" value="Get Data"/>
<input type="text" id="name" />
<input type="text" id="werks" />

<script type="text/javascript">

$("#clickButton").click(function () {
var site=$('#site').val();
var requestUriString = "http://sapiecci.woolworths.com.au:8061/sap/opu/odata/sap/ZMAS_STORE_DETAILS/zmas_store_detailsCollec... eq '"+site+"'";
         
        OData.read({requestUri:requestUriString , user:"supAdmin", password:"xxxxx"},
  function (data, response) {
                 //alert(data.results[0].name1);
//   alert(data.results.length);
    var name1=data.results[0].name1;

    $('#name').val(name1);
    $('#werks').val(data.results[0].werks);

  }

I am able to retrieve the data by running the above sample.html using Chrome browser. The next step, i am trying to do is using the packaging tool to

generate the manifest.xml file and Hybrid App ZIP package to deploy the package to server through Sybase Control Center. Once I zipped the package using packaging tool, i can see Project1.Zip package and manifest file inside Project1.zip package. Please check the below screenshot for these.

But, while trying to deploy the above Project1.zip package, i am facing the follow error .Please check the below screens.

       Please suggest me the solution for the above error.

      Also, as per the link provided by David, i can see that we have to do proxy setting for OData source in Sybase Control Center . But i havent

      understood how this proxy setting will give access to SUP2.2 to consume OData sources.  Please check the below screen shot of proxy settings i

      have done in SCC.

     

      So, Please suggest me the brief solution for

      1. Error facing while deploying the Project1.zip package to Sybase Control Center.

      2. There is no option to like "ping " in the proxy setting page to check whether the entered proxy setting details are correct or not ?. How to know 

          this ?

    Thanks in Advance,

    Hemagiri S

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

Q Error facing while deploying the Project1.zip package to Sybase Control Center

A Not sure.  I would try unchecking and rechecking the Support iOS platform or Android platform and regenerating.  It might also help to try the sample on using the packaging tool in

SUP 2.2 SP02 New Hybrid App Designer Features https://cw.sdn.sap.com/cw/docs/DOC-152841

Q There is no option to like "ping " in the proxy setting page

A Just try to access the proxy connection by entering it into the browser.  http://SUP_SERVER_IP:8000/OData


Former Member
0 Kudos

Hi Daniel,

I have done Proxy settings in Sybase Control Center (SCC) for the following OData source:

http://sapiecci.woolworths.com.au:8061/sap/opu/odata/sap/ZMAS_STORE_DETAILS/zmas_store_detailsCollec... eq '1106'

SUPServer has been installed in one machine ( windows machine) and i have a VPN access to that machine from MacBook Pro ( to connect to SUPServer) .

When i am trying to hit the above OData source on MacBook Pro ( with VPN connected to SUPServer) , i am not getting any response, and showing " Unable to open the url " .

Can you please give some suggestions on this ?

Thanks in Advance,

Hemagiri Seerapu

Vlad
Advisor
Advisor
0 Kudos

Hello Hemagiri,

The proxy URL is the web service URL without any parameter or collection: http://sapiecci.woolworths.com.au:8061/sap/opu/odata/sap/ZMAS_STORE_DETAILS

Can you please explain what do you do with MacBook? Simply using Safari? 

Kind regards,

Vlad

Former Member
0 Kudos

Hi Vlad,

First of all i am thankful to you for your response.

I dont have a real device to test the deployed Hybrid App. For now i am testing the App in simulator ( in MAC , with installed HWC in simulator).

Please check the following steps what i have done till now :

1. Done proxy settings in Sybase Control Center

2. Zipped the whole sample project using packaging tool, and deployed it to SUPServer (from Sybase Control Center).

3. Connected the device ( using simulator in MAC) to SUPServer and assigned the sample project from SCC, and while running the app in simulator, not getting any response as well as data from the OData service . So, i got a doubt on proxy settings what i have done in SCC and now checking whether able to hit the OData service via SUP in the following format :

http://SUP_Server_ipaddress:8000/SOH

SOH - Proxy Connection Pool name in SCC for the following OData service

http://sapiecci.xxxxx.com.au:8061/sap/opu/odata/sap/ZSP_STOCKS_ON_HAND

Please check the following step-by-step screens what i have done

Proxysettings:

Once i hit the Url : http://SUPServer_ipadress:8000/SOH on the browser (using internet explorer 64bit version) asking to provided Credentials to acess or to login to SUPServer and SAPNetweaver Gateway. So, i provided the required credentials .Please check the following screens

After providing the required credentials, i am facing the following error. Also, I can see the logs in Sybase Control Center . Please check the below screen

Also, when i tried to hit the proxy Url in internet explorer on windows desktop, it is not displaying the XML content and it is suggesting to save it . Please check the below screenshot.

Usually authorization errors will come only if we provide wrong credentials.But, i dont think i had provided wrong credentials. because i tried with different combinations in providing the credentials.

Still no use and facing the same error.

I am, facing the same error while trying to access the proxy from MAC ( using safari, or Mozilla)

Can you please suggest me some solution on this?

Thanks,

Hemagiri

Vlad
Advisor
Advisor
0 Kudos

Hello Hemagiri,  Thank you for the detailed post. Let me start from the beginning, to figure out what is wrong:  1. You have the hybrid web container application. The application has probably the HWC ID in the SCC. 2. Please check the security configuration which is used by the HWC. Theoretically, this is the preconfigured user login. If yes, during the registration you has to provide the user name and password of the preconfigured user. This is typically supAdmin. 3. When you do this, the HWC container will start the registration automatically using this user credentials, and you should see the successful registration in logs.  After that you will see your user registered in SCC.  Thanks, Vlad

Former Member
0 Kudos

Hello Vlad,

Can you please explain how to do security configuration ( Basic Authentication) after doing OData Proxy settings ?

Thanks,

Hemagiri Seerapu

Vlad
Advisor
Advisor
0 Kudos

Hello Hemagiri,

The security configuration is just a set of modules, which decide if a user can do the registration. For example, you can create a preconfigured module and use there some sample user with a sample password. Later, when you assign this sec. config to the application, you can use the user credentials to register the application.

Usually, for testing purposes you can use nologin module. It means that any user/any password can be registered.

Kind regards,

Vlad

Former Member
0 Kudos

Thank you Vlad, Thanks for your valuable suggestions. Now, my app is working fine.

Former Member
0 Kudos

Hi Hemagiri, Vladislav Volodin, Daniel van Leeuwen                    

We are also developing Hybrid application using OData and SUP 2.3, I have few doubts. it will be appreciated, if you clarify these.

1. Which user name and password we need to give while creating proxy in SUP?

2. Is '/' required at the end of Netweaver gateway URL(Address)?

3. How do you handled the authentication of Netweaver gateway in Hybrid Application?

passing user name and password in header of odata.read is enough?

Authentication Against an OData Source

Thanks in Advance

Suresh

Former Member
0 Kudos

Hi Hemagiri,

I am in a situation, what you faced earlier.

I have created security configuration, Connections, and an application in SCC.

From Client side, I am not using HWC but a Hybrid app with OData services.

Now My question is, how to call(or register with) SUP server, which Path I need to give.

I tried with out using SCC, that is working fine with basic authentication. Now I don't know how to call SUP server, in which I specified End point URL in the Connections, Application.

Please help me, Thanks in advance.

Regards,

Prasad