Issue while accessing SAP S/4HANA Cloud API using SDK or Rest OData - sap-cloud-sdk

I am trying to consume the SAP S/4HANA APIs from outside SAP (Postman or Java)
I found a couple of options to access it
Using Cloud SDK
Using Rest OData endpoints
https://api.sap.com/package/SAPS4HANACloud
I observed that we can use the Cloud SDK only for the application which is deployed in SAP BTP Cloud foundry.
For Rest OData endpoints, couldn't figure out the settings for authentication for Production URL for SAP S/4HANA Cloud instance
Does anyone know if we can use the Cloud SDK or REST OData endpoints externally from local machine or from Postman?
Note: I am trying these things using a Trial account.

Disclaimer: I'm one of the developers working in the SAP Cloud SDK.
The SAP Cloud SDK for Java is a Java library for developing cloud native applications mostly within the SAP ecosystem.
As such, it is of course very important to ensure that applications can be tested in different environments (e.g. CI/CD pipelines, and also local developer machines).
Hence, the SAP Cloud SDK can be used to connect to remote cloud services from the local machine.
Please note that the SAP Cloud SDK must be included into a Java application, which then needs to be executed - it cannot be run standalone and also has nothing to do with Postman (although it also provides a REST client).
To get started with the SAP Cloud SDK, you may want to have a look at this tutorial: https://developers.sap.com/group.s4sdk-cloud-foundry.html.
It explains how to easily create a new Java application that includes the SAP Cloud SDK and how to consume an OData SAP cloud service from the SAP API Business Hub. The tutorial even explains how to get all of this working with a trial service and from your local machine!

Related

SDK Support for Document Service

I would like to connect the Document Service from Java (Spring Boot application deployed in SAP BTP Cloud Foundry environment with multitenancy) and I am wondering about the intended way to connect the document service in a multitenant szenario.
Does SAP cloud sdk helps with connectivity?
If we're talking about consuming the service on the SAP Business Technology platform - then yes. Check the multi-tenancy docs.
The SAP Cloud SDK is a framework for consuming services and usually not the best choice for publishing them. You can use it as a proxy or data adapter, of course, if that's what you need.
For service publishing with multi-tenancy, I'd recommend looking into the direction of the Cloud Application Programming model (CAP)
Are you building OData, OpenAPI or generic REST enabled service? The SAP Cloud SDK can help to consume your service with multi-tenancy out of the box using our OData or OpenAPI code generators and type-safe clients. You can also use the SDK for testing. Please, check the details in our docs.
I'd also recommend checking if the service you're building already exists or you can adapt some other service with help of the SDK.

Is the SAP Cloud SDK also able to simplify connecting to non S/4 systems?

The virtual data model (VDM) of the SAP Cloud SDK is designed to make connecting to SAP S/4HANA systems on SAP Cloud Platform easier. Is it possible to also use the virtual data model for other downstream services?
The virtual data model of the Cloud SDK allows to also consume other ODataV2 services coming from for example SAP SuccessFactors or SAP ByDesign. You can also use the SDK capabilities to communicate via REST APIs. More details in this can be found here.

How to use my own API instead of using mobile API in Azure

is there any way to publish my API in azure mobile service API instead of using its own. I want just to know it, because assume I have a backup server in amazon and as you know I don't have access to azure sdk in there and it means technically I cant use the API anywhere outside the azure.
Azure mobile services is actually based on the .Net web api in their C# flavor and on node.js on the Javascript side. You could surely write an API using those technology and have the same behavior. You will gain the fact of being more portable, however you will lose some of the preconfigured stuff from Mobile services.
If you are using .NET, please check this to see how to build a Web api! http://www.asp.net/web-api.
If you are using Javascript, here is where you should start : https://nodejs.org/
Both tech are quite easy to learn and super powerfull, have fun! When your API is built, you could just publish them as an azure Web APP (http://azure.microsoft.com/en-us/services/app-service/web/) or an Azure API (https://azure.microsoft.com/en-us/services/app-service/api/) instead of the mobile App
Hope it helps, if you have more questions, please ask!
You can create and publish your own custom APIs in azure mobile service. You could even access in via azure mobile service sdk in client by using "InvokeApiAsync<>()" method.
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn614130.aspx
If you want to access the api via fidder/httpclient than AZM SDK, pass the mobile service key in HTTP header as Name:'x-zumo-application' value:'application key from portal'

Windows Azure Mobile Services REST API documentation

Is there any management API in Windows Azure Mobile Services? For example: methods to create mobile services or data tables. I could not find any documentation. I have read in some other thread that the API is available but not available publicly. Any expectation about its availability.
There is no REST API for managing Windows Azure Mobile Services, for operations like you mentioned (creating / configuring services; creating / configuring tables; etc). If you want to script those operations you can use the Azure command-line interface - that will let you perform those operations in the command line (for example via a batch / shell / command line script). That tool is implemented in node.js, so you can also use it in a node.js application, by using the azure-cli package.
There is a REST API for using a specific Azure Mobile Service - and you can find the documentation for it at http://msdn.microsoft.com/en-us/library/windowsazure/jj710108.aspx.

Monotouch - Windows Azure toolkit

I am working on an Iphone application which needs a direct access to Azure. I know there are toolkit versions exist for Objective C and Android. Is there any ported version of the toolkit exists for Monotouch?
There is no specific Azure SDK which is designed for MonoTouch and the Azure desktop binary are not compatible. If you decide to use MonoTouch, you would need to use WebClient API to create your own HTTP/HTTPS connection something similar to as described here, which could be comparative complex. On internet you may find some experiment level code to use Azure services and MonoTouch application so you may be by your own to try to get things working.
If you choose Objective C then you can use iOS SDK for Windows Azure which is far better solution. I personally will not use MonoTouch to develop application on iOS devices, if I am heavily dependent on Windows Azure Services, instead I will choose iOS Windows Azure SDK to connect Azure Service through native code.
Check this out as well: MonoTouch connect to Azure ACS, Azure SQL / Azure WCF

Resources