ashttp | Shell command , that expose any other command as http | HTTP library
kandi X-RAY | ashttp Summary
kandi X-RAY | ashttp Summary
ashttp can serve any text application over http, like :.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handler for GET requests
- Send OK response
- Run a logtop program as HTTP
ashttp Key Features
ashttp Examples and Code Snippets
Community Discussions
Trending Discussions on ashttp
QUESTION
I am following the official documentation to call workflow REST APIs with Cloud SDK libraries.
https://sap.github.io/cloud-sdk/docs/java/features/rest/clients/scp-workflow-rest-api
When I deployed the application to Cloud Foundry environment. It failed to start. The error messages are the same when I started the application locally.
Cloud SDK version: 3.27.0
Below is the error stack.
...ANSWER
Answered 2020-Sep-11 at 07:02Update: SAP Cloud SDK 3.28.1 is available since today and fixes this issue. Check out the release notes here.
Thanks for reporting this Jerry. This is a bug, I will update this answer here once a bug fix is released with the SAP Cloud SDK.
As a workaround you can use the Tomee archetype of the SAP Cloud SDK scp-cf-tomee
. There the problem does not exist.
QUESTION
I am looking for a way to call S4HANA on-premise BAPI locally and on SAP Cloud Platform with Cloud SDK. The problem is how to define RFC destinations just like HTTP ones.
I also encountered JCo class not found exception and could not find a suitable workaround.
Locally
In HTTP destination, I can provide environment variables like the following:
...ANSWER
Answered 2020-Apr-08 at 13:44Thanks for raising this question here. I can identify different aspects in your question, hence touching upon them individually in the following.
JCO Class Not found exceptionPlease provide more information on the following questions:
- I understand that you receive a
java.lang.NoClassDefFoundError: com/sap/conn/jco/JCo
at runtime after app deployment to the SCP. Is my understanding correct? - I understand that you use a Spring Boot application, correct?
- Have you used the SAP Cloud SDK archetype?
- Please attach the application log here for further reference.
- Can you also elaborate on how exactly you added sapjco3.jar to the project classpath?
- Do you deploy you app as jar or as war?
I understand that you struggle understanding how to specify the RFC destination in your environment variable. May I ask what you already tried respectively which concrete problems (error messages, etc.) you are facing?
RFC Destination cannot be decorated to involve additional propertiesYou are pointing out correctly that the SAP Cloud SDK is able to enrich the request headers considering the additional properties on an HTTP destination. Therefore, you need to decorate your HttpDestination
instance like so:
QUESTION
We are trying to call OData and REST endpoints in an S/4HANA On Premise system from our SAP Cloud Platform Java app. However, our attempts to use the SAP CloudSDK to get an HTTP client for the corresponding destination
...ANSWER
Answered 2020-May-20 at 10:37Florian, you'll have to decorate your destination with DefaultErpHttpDestination
like
QUESTION
I am using the SAP Cloud SDK for Java to do CRUD on the SalesOrder APIs in S/4. Everything works well in that I can carry out these actions from Postman. However, these requests from Postman only work if I include a pre-request script to get a csrf token as outlined in this blog post
If I run the requests without the pre-request script outlined in the blog post, I get a '403 Forbidden'. As I said it works from Postman, but I would like to understand how this should be handled without the need for this script, for example if I was making a request from another application. Does the SDK allow me to handle this from the application code somehow. Maybe I am missing something.
Thanks for your time.
EDIT: I am not making requests to the S/4 directly from Postman. I have an app deployed which is using the Cloud SDK to make the requests to S/4. It works if I use the pre-request script to fetch the CSFR token and attach it to the request before I send it, but 403 if I don't. So, if we imagine I am not using Postman but some ui somewhere to fill a form and send this request my understanding is that I shouldn't, as you suggested, have to worry about this token, that my service in the middle which uses the SDK and the VDM should handle this for me. This is what I am struggling to understand.
This is the servlet code:
...ANSWER
Answered 2020-Apr-28 at 09:53The SDK makes an attempt to fetch a CSRF token automatically within execute(destination)
. This happens before issuing the actual request. If the attempt is successful the token will be included in the request. If not, the request will be send regardless.
Please increase the log level to debug for all com.sap.cloud.sdk
packages if you think this is not happening correctly. Also it would be great to see the actual HTTP requests that go in and out which you can enable by setting the log level of org.apache.http.wire
also to debug. Then attach the stack trace here together with the SDK version you are using and the exact code you are invoking.
QUESTION
It works in SAP Cloud SDK Version 3.7.0 to 3.10.0 but failed in the latest version from 3.11.0 to 3.13.0.
I have two applications deployed on SAP Cloud Platform. One is cloud java application based on SAP Cloud SDK using destination which is configured with Principal Propagation. The other is app router.
All related configuration of Principal Propagation are all finished in Cloud Connector and backend on-premise system. We also set up our own identity provider in SAP Cloud Platform.
Let me introduce what we want to achieve.
User login to cloud application using our own IDP from app router and then get some data from S4 on-premise system using the same user (different from the technical user in Basic authentication) configured in destination.
For more details please refer to https://blogs.sap.com/2017/07/13/part-2-how-to-use-the-sap-cloud-platform-connectivity-and-the-cloud-connector-in-the-cloud-foundry-environment/
What I did in java application to invoke billing document from S4 system.
...ANSWER
Answered 2020-Feb-24 at 13:21The error message SSO token validation failed. Make sure trust is configured correctly in the cloud connector to enable principal propagation, if token has not expired yet.
indicates an outdated/wrong/lacking trust configuration between the Cloud Connector and Cloud Foundry.
Kindly reconsider the trust configuration as per its official documentation, conduct the steps below headline 'Configure Trusted Entities in the Cloud Connector' in particular
QUESTION
I have a filter
...ANSWER
Answered 2020-Mar-15 at 06:48You have to swap order of sendError
and addHeader
calls
QUESTION
Following the problem from question: Generate VDM for SFSF using Java in SAP Cloud SDK: Generated URI is wrong
I generated a Virtual Data Model from a metadata file from SFSF using the Maven plugin and SAP Cloud SDK for Java.
The generator works correctly, however the URI generated is not what SFSF is expecting:
Generated URI: /odata/v2/SFODataSet
Expected URI: /odata/v2 or /odata/v2/JobRequisition
(SFODataSet entity does not exist, and SFSF gives an error when trying to access it).
Anyway, I proceed and change the DEFAULT_SERVICE_PATH in the generated files to /odata/v2 and create the following servlet that includes the query:
...ANSWER
Answered 2020-Mar-05 at 12:40The EDMX file that you've used to generate the VDM from is not compatible with the remote OData service responses. Please ask the maintainer of the OData service to provide an up-to-date metadata file. You can also try and download it directly from http://[URL]/odata/v2/$metadata
.
I found about half of the JSON sample payload that you attached was not compatible with the EDMX file published on API Business Hub.
The response contains unknown entity properties which cannot be matched with the metadata:
QUESTION
I'm trying to build an app that reads info from SFSF. For this, I'm using the Virtual Data model generator tool (the maven plugin) with SFSF OData metadata to be able to access the system. I'm following these steps:
- Get a project via archetype (with powershell):
ANSWER
Answered 2020-Feb-24 at 12:32I will start of with a partial answer and edit in more information later if needed.
Regarding the URL:
The behaviour you observe is intentional. The full URL of a request will be assembled as follows: Destination URL + service path + service name + entity + '?' + query parameters. So in your case that might be:
QUESTION
I am using the Java SAP Cloud SDK version 3.11.0 and have the following VDM request:
...ANSWER
Answered 2020-Jan-31 at 08:20Since you are connecting to an S/4 OData service, the request expects additional HTTP headers. Custom values for sap-client
and sap-locale
can be either set manually (as you did, described in your question). Or you can use the following code:
QUESTION
Using java SAP Cloud SDK
I have to use com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.outbounddeliveryv2.batch.OutboundDeliveryV2ServiceBatch.execute(HttpDestinationProperties destination)
to perform some updates on S/4 system. This method, execute
takes an argument of type HttpDestinationProperties
.
Since I need a destination, I am using below code to get destination:
...ANSWER
Answered 2020-Jan-29 at 14:52This is an excellent question!
The context:
- Of course you can keep using your original approach:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ashttp
You can use ashttp like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page