<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Consuming Odata from Nodejs in Cloudfoundry not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152512#M1977178</link>
    <description>&lt;P&gt;Hi Florian,&lt;/P&gt;&lt;P&gt;Is there any other blog which depicts the same, as you have mentioned in link.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2020 06:30:21 GMT</pubDate>
    <dc:creator>Badhusha</dc:creator>
    <dc:date>2020-01-21T06:30:21Z</dc:date>
    <item>
      <title>Consuming Odata from Nodejs in Cloudfoundry not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152510#M1977176</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I am developing a &lt;STRONG&gt;nodejs&lt;/STRONG&gt; application, which fetches data from an on-premise OData service and returns it back as a response. This is my node js application's code.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;server.js&lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;var http = require('http');
var express = require('express')
var request= require('request')
const bodyParser = require('body-parser')
const turl = require('turl')
var app = express()
const port =process.env.PORT ||3000
app.use(bodyParser.json())
app.use(express.static(__dirname));
var url ='http://10.124.2.117:8000/sap/opu/odata/sap/ZGW_EMPLOYEE_INFO_SRV/EmployeeHeaderSet';
app.get('/',async(req,res)=&amp;gt;{
var headers={
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Basic YmFkaHKzaGE6YWlodGhhPXI=',
"x-csrf-token" : "Fetch"};
var options={
          method:'GET',
          url: url,
          headers:headers
            };

request(options,function(error, response, body){
if(!error &amp;amp;&amp;amp; response.statusCode ==200){
    var resultData = JSON.parse(body);//Process the dataandreturn the response
}
else{
console.log("Error happened");
    }
    });
});
app.listen(port,()=&amp;gt;{ 
    console.log('Server is running on port '+port)})&lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;manifest.yaml&lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;---
applications:-name: myapp
  random-route: true
  path: myapp
  memory:128M
  health-check-type:none
  services:- myuaa&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;STRONG&gt;xs-app.json&lt;/STRONG&gt;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;{"xsappname" : "myapp","tenant-mode" : "dedicated"}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;When I run this application on the local system it is returning the response as expected, but when I deploy this node js application to the Cloudfoundry Environment, it is showing "Error happened".&lt;/P&gt;
  &lt;P&gt;Is there any other way to consume the data ?&lt;/P&gt;
  &lt;P&gt;What is the problem with my code?&lt;/P&gt;
  &lt;P&gt;Thanks in advance&lt;/P&gt;
  &lt;P&gt;Note: I am using TM System&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 11:12:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152510#M1977176</guid>
      <dc:creator>Badhusha</dc:creator>
      <dc:date>2020-01-17T11:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming Odata from Nodejs in Cloudfoundry not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152511#M1977177</link>
      <description>&lt;P&gt;As the system you are trying to call is not available in public, the request fails of course when it is executed in the CF environment.&lt;/P&gt;&lt;P&gt;You have to use the Connectivity service to access your on-premise system via SAP Cloud Connector. For details please check the online documentation: &lt;A href="https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/313b215066a8400db461b311e01bd99b.html" target="_blank"&gt;Consuming the Connectivity Service&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 15:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152511#M1977177</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-01-17T15:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming Odata from Nodejs in Cloudfoundry not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152512#M1977178</link>
      <description>&lt;P&gt;Hi Florian,&lt;/P&gt;&lt;P&gt;Is there any other blog which depicts the same, as you have mentioned in link.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 06:30:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152512#M1977178</guid>
      <dc:creator>Badhusha</dc:creator>
      <dc:date>2020-01-21T06:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming Odata from Nodejs in Cloudfoundry not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152513#M1977179</link>
      <description>&lt;P&gt;Just a simple search here in the community brings up a lot of results. For instance &lt;A href="https://blogs.sap.com/2017/07/09/how-to-use-the-sap-cloud-platform-connectivity-and-the-cloud-connector-in-the-cloud-foundry-environment-part-1/" target="_blank"&gt;https://blogs.sap.com/2017/07/09/how-to-use-the-sap-cloud-platform-connectivity-and-the-cloud-connector-in-the-cloud-foundry-environment-part-1/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 06:33:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/consuming-odata-from-nodejs-in-cloudfoundry-not-working/m-p/12152513#M1977179</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-01-21T06:33:02Z</dc:date>
    </item>
  </channel>
</rss>

