on 06-28-2015 4:54 PM
Hi All,
I am trying to access a 3rd party external json/webservice to update the data. What should be my approach?
1. Can we create a new destination for the external service in HANA Cockpit as we register the SAP Odata service?
2. Can I call the external service directly from the code to update the data?
3. Can I call this external service from SAP Odata service and use this in the webIDE ?
Appreciate your expert advise.
Thanks, Gopi
1) yes, just put type HTTP for destination.
2) yes. add a mapping in neo-app.json
{
"path": "/your_service",
"target": {
"type": "destination",
"name": "YOUR_DESTINATION",
"entryPath": "/whatever_is_the_entrypath"
},
"description": "Your destination"
},
and use that mapping prefix to call an external service
3) yes, see abow. oDataModel( "/your_service/odata_service_name" )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Maksim,
I have created the destination for the json service as below. When I create a project from template in webIDE I don't see this destination, where as i see other destinations like northwind.
Am I missing anything?
Also is it a good approach to call this json service and create a odata service and the use that in the webIDE?
Please suggest.
Thanks
Gopi
Hi Maksim,
In my case the api is public api. The url is http://api.wunderground.com/<key>.json . I did provide parameters for the below, but still i cannot see it. Also I am not sure what would be the WebIDESystem would be as this is public api.
WebIDEEnabled = true
WebIDESystem = ??? for public api what would be this???
WebIDEUsage = odata_gen.
Coming to my second question.
As we can consume json service from ABAP. I was thinking to consume the json in Odata service(SAP) and as the destination to Gateway servers is already available, this service would show up while creating a project from template.
Not sure if this approach right.
Thanks,
Gopi
from
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script> jQuery(document).ready(function($) { $.ajax({ url : "http://api.wunderground.com/api/Your_Key/geolookup/conditions/q/IA/Cedar_Rapids.json", dataType : "jsonp", success : function(parsed_json) { var location = parsed_json['location']['city']; var temp_f = parsed_json['current_observation']['temp_f']; alert("Current temperature in " + location + " is: " + temp_f); } }); }); </script>
you don't need destination for using their services as they support javascript
thank you.
I have a similar requirement where i need to call the api of 3rd party and update the information.
with the above approach of directly calling the service, Can I use the offline Kapsel project template?
When I call this 3rd party api the app has to work in offline mode too.
Any inputs is appreciated.
Thanks,
Gopi
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.