In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces how to use nodejs to consume Web service on SAP Cloud for Customer. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
Look at a specific example: Individual Customers in C4C can maintain Social User Profile. In the official account article above Jerry, it is to maintain the open ID of Wechat users to the SocialMediaAccountUserID field of Social User Profile, as shown in the following figure.
So now that we know a Social Profile ID, how can we use nodejs to get the Profile details through Web Service?
First, go to Administrator- > Input and Output Management- > Service Explorer to get the web service of the standard query Social User profile:
Https:///sap/bc/srt/scs/sap/requestforsocialmediauserprofi
Then use nodejs module request to send a HTTP post request to the url.
You can refer to my source code on github.
Var request = require ('request'); var config = require (".. /.. / config.js"); function getSocialMediaProfile (profileID) {console.log ("Jerry trace begin * *"); console.log ("url:" + config.socialMediaProfileGetEndPoint); console.log ("config.credential_qxl:" + config.credential_qxl) Var ogetSocialMediaProfileOptions = {url: config.socialMediaProfileGetEndPoint, method: "POST", headers: {"content-type": "text/xml", 'Authorization':' Basic'+ new Buffer (config.credential_qxl) .toString ('base64')}, body:' +'I'+'1' +'+ profileID +'+'}; console.log ("body:" + ogetSocialMediaProfileOptions.body) Console.log ("Jerry trace end * *"); return new Promise (function (resolve,reject) {request (ogetSocialMediaProfileOptions,function (error,response,body) {console.log ("Jerry web service response:" + body); var soapreg = /. * (. *); var soapresult = soapreg.exec (body) If (soapresult.length = 2) {resolve (soapresult [1]);}});});} module.exports = getSocialMediaProfile
Save the above code as a file getSocialMediaProfileTest.js and execute it directly using node getSocialMediaProfileTest.js.
From console, you can observe the body of the HTTP post request sent and the response content returned:
On how to use nodejs to consume Web service on SAP Cloud for Customer to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.