- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发使用 SAP Cloud SDK 的应用程序。我以前使用的是的版本2.20.1 的SAP Cloud SDK ,并将 POST请求发送到 OData服务。这是我用来发送 POST请求的代码:
final ODataCreateRequestImpl createRequest =
new ODataCreateRequestImpl("/sap/opu/odata/sap/ZAS_BP_CREATION_SRV",
"BP_DATASet", bodyAsMap, null, null, null, headersAsMap, null, false, null, null, false);
JSONObject jsonResponse = null;
try {
Map<String, Object> resp = createRequest.execute("ErpQueryEndpoint").asMap();
jsonResponse = new JSONObject(resp);
} catch(final ODataException e) {
logger.error(e.getMessage(), e);
}
catch(final JSONException e) {
logger.error(e.getMessage(), e);
}
public static HttpClient getHttpClient(@Nonnull HttpDestinationProperties destination)
,但是我得到的错误是因为此方法的签名在运行时不同,它期望接收一个字符串参数而不是 HttpDestinationProperties 。<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.atlantida.services</groupId>
<artifactId>account</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>atlantida</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>3.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<java-version>1.8</java-version>
<springframework.version>5.1.8.RELEASE</springframework.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.11</junit.version>
<jackson-version>2.9.2</jackson-version>
<lombok.version>1.18.8</lombok.version>
<jcl.slf4j.version>1.7.12</jcl.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- if you are behind a proxy use the following two properties to configure your proxy. Default: None -->
<proxy.host />
<proxy.port />
<non.proxy.hosts />
<!-- Properties that are related to the SAP Cloud Platform. -->
<scp.sdkVersion>1.44.12</scp.sdkVersion>
<!-- this is the location of your local SAP CP Neo runtime -->
<scp.sdkInstallPath>${project.basedir}/scp/sdk-${scp.sdkVersion}</scp.sdkInstallPath>
<scp.sdkLocalServerContentPath>${project.basedir}/localServerContent</scp.sdkLocalServerContentPath>
<scp.sdkErpEndpoint>${scp.sdkInstallPath}/server/config_master/service.destinations/destinations/ErpQueryEndpoint</scp.sdkErpEndpoint>
<scp.sdkSymbolicLink>${project.basedir}/scp/sdk</scp.sdkSymbolicLink>
<scp.sdkNeoCmdExtension>.sh</scp.sdkNeoCmdExtension>
<scp.sdkNeoCmd>${scp.sdkInstallPath}/tools/neo${scp.sdkNeoCmdExtension}</scp.sdkNeoCmd>
<scp.sdkLocalServer>${scp.sdkInstallPath}/server</scp.sdkLocalServer>
<scp.skipInstallSdk>false</scp.skipInstallSdk>
<scp.skipDeploy>false</scp.skipDeploy>
<scp.skipPutDestination>false</scp.skipPutDestination>
<scp.skipRestart>false</scp.skipRestart>
<scp.skipRollingUpdate>true</scp.skipRollingUpdate>
<scp.vmArguments />
<scp.vmSize>lite</scp.vmSize>
<scp.vmMinProcesses>1</scp.vmMinProcesses>
<scp.vmMaxProcesses>1</scp.vmMaxProcesses>
<scp.app />
<scp.host />
<scp.account />
<scp.username />
<scp.password />
<!-- Required for SAP CP user session management and audit logging. -->
<scp.warImportPackage>com.sap.security.auth.service,com.sap.security.um.service.api,com.sap.core.service.auditlog.impl,com.sap.cloud.auditlog,com.sap.cloud.auditlog.exception,com.sap.cloud.auditlog.extension</scp.warImportPackage>
<!-- Defines whether the deployment is productive or not. -->
<productive />
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- Bridge logging from JCL to SLF4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${jcl.slf4j.version}</version>
</dependency>
<!-- logback -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!--<!– https://mvnrepository.com/artifact/org.aspectj/aspectjtools –>-->
<!--<dependency>-->
<!--<groupId>org.aspectj</groupId>-->
<!--<artifactId>aspectjtools</artifactId>-->
<!--<version>1.6.2</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>scp-neo</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.s4hana</groupId>
<artifactId>s4hana-all</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>security-servlet</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sap.cloud</groupId>
<artifactId>neo-javaee7-wp-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>atlantida</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>SAP Cloud SDK Project Structure Checks</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.5</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
<reactorModuleConvergence />
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<attachClasses>true</attachClasses>
<archive>
<manifestEntries>
<Version>${project.version}</Version>
<Import-Package>${scp.warImportPackage}</Import-Package>
</manifestEntries>
</archive>
<webResources>
<resources>
<filtering>true</filtering>
<directory>src/main/webapp</directory>
<includes>
<include>**/web.xml</include>
</includes>
</resources>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.sap.cloud</groupId>
<artifactId>neo-javaee7-wp-sdk</artifactId>
<version>${scp.sdkVersion}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${scp.sdkInstallPath}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</plugin>
<!-- Plugin for deployment to SAP Cloud Platform Neo. -->
<plugin>
<groupId>com.sap.cloud</groupId>
<artifactId>neo-javaee7-wp-maven-plugin</artifactId>
<version>${scp.sdkVersion}</version>
<executions>
<execution>
<id>stop</id>
<phase>install</phase>
<goals>
<goal>stop</goal>
</goals>
<configuration>
<skip>${scp.skipRestart}</skip>
</configuration>
</execution>
<execution>
<id>deploy</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<skip>${scp.skipDeploy}</skip>
<vmArguments>${scp.vmArguments}</vmArguments>
</configuration>
</execution>
<execution>
<id>start</id>
<phase>install</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<skip>${scp.skipRestart}</skip>
</configuration>
</execution>
<execution>
<id>rolling-update</id>
<phase>install</phase>
<goals>
<goal>rolling-update</goal>
</goals>
<configuration>
<skip>${scp.skipRollingUpdate}</skip>
</configuration>
</execution>
</executions>
<configuration>
<sdkInstallPath>${scp.sdkInstallPath}</sdkInstallPath>
<skip>${scp.skipInstallSdk}</skip>
<application>${scp.app}</application>
<source>${project.build.directory}/${project.build.finalName}.war</source>
<vmArguments>${scp.vmArguments}</vmArguments>
<size>${scp.vmSize}</size>
<minimumProcesses>${scp.vmMinProcesses}</minimumProcesses>
<maximumProcesses>${scp.vmMaxProcesses}</maximumProcesses>
<host>${scp.host}</host>
<account>${scp.account}</account>
<user>${scp.username}</user>
<password>${scp.password}</password>
<synchronous>true</synchronous>
<httpProxyHost>${proxy.host}</httpProxyHost>
<httpProxyPort>${proxy.port}</httpProxyPort>
<httpsProxyHost>${proxy.host}</httpsProxyHost>
<httpsProxyPort>${proxy.port}</httpsProxyPort>
<consoleCommand />
<consoleHttpProxyHost>${proxy.host}</consoleHttpProxyHost>
<consoleHttpProxyPort>${proxy.port}</consoleHttpProxyPort>
<consoleHttpsProxyHost>${proxy.host}</consoleHttpsProxyHost>
<consoleHttpsProxyPort>${proxy.port}</consoleHttpsProxyPort>
<dbsystem />
<dbSize />
<dbUser />
</configuration>
</plugin>
<!-- Plugin for deployment to local runtime of SAP Cloud Platform Neo. -->
<plugin>
<groupId>com.sap.cloud.sdk.plugins</groupId>
<artifactId>scp-neo-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<sdkPlugin>neo-javaee7-wp-maven-plugin</sdkPlugin>
<sdkPluginVersion>${scp.sdkVersion}</sdkPluginVersion>
<sdkInstallPath>${scp.sdkInstallPath}</sdkInstallPath>
<sdkSymbolicLink>${scp.sdkSymbolicLink}</sdkSymbolicLink>
<sdkServerContentPath>${scp.sdkLocalServerContentPath}</sdkServerContentPath>
<source>${project.build.directory}/${project.build.finalName}.war</source>
<proxyHost>${proxy.host}</proxyHost>
<proxyPort>${proxy.port}</proxyPort>
<httpNonProxyHosts>${non.proxy.hosts}</httpNonProxyHosts>
<destinations>
<destination>
<path>${scp.sdkErpEndpoint}</path>
<username>achacon</username>
<password>achacon100</password>
<url>http://sapcrmdev.adbancat.hn:8000</url>
</destination>
</destinations>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.sap.cloud.sdk.plugins</groupId>
<artifactId>usage-analytics-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>usage-analytics</goal>
</goals>
<configuration>
<skipUsageAnalytics>false</skipUsageAnalytics>
<generateSalt>true</generateSalt>
<!--
Note: A random salt is auto-generated once the project is built for the first time.
Please keep the generated salt in the POM file, for example, when pushing to git.
To learn more, visit: https://blogs.sap.com/2018/10/23/usage-analytics-s4sdk/
-->
<salt>5d5e4e1e8a5f05d547fe8880f65173bda150a670f91f3657b970eaa9e7a4d392</salt>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!--
Profiles that are used to set the Neo SDK "neo" command extension ("neo.sh" or "neo.cmd")
-->
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<scp.sdkNeoCmdExtension>.bat</scp.sdkNeoCmdExtension>
</properties>
</profile>
<profile>
<id>unix</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<scp.sdkNeoCmdExtension>.sh</scp.sdkNeoCmdExtension>
</properties>
</profile>
<!-- Profile setting properties for deploying to the local SAP CP runtime. -->
<profile>
<id>local-deploy</id>
<activation>
<property>
<name>!scp.app</name>
</property>
</activation>
<properties>
<scp.skipInstallSdk>true</scp.skipInstallSdk>
<scp.skipDeploy>true</scp.skipDeploy>
<scp.skipPutDestination>true</scp.skipPutDestination>
<scp.skipRestart>true</scp.skipRestart>
<scp.skipRollingUpdate>true</scp.skipRollingUpdate>
</properties>
</profile>
<!-- Profile setting properties for deploying a productive version to SAP CP. -->
<profile>
<id>scp-deploy</id>
<activation>
<property>
<name>productive</name>
</property>
</activation>
<properties>
<scp.skipInstallSdk>false</scp.skipInstallSdk>
<scp.skipDeploy>true</scp.skipDeploy>
<scp.skipPutDestination>false</scp.skipPutDestination>
<scp.skipRestart>true</scp.skipRestart>
<scp.skipRollingUpdate>false</scp.skipRollingUpdate>
</properties>
</profile>
</profiles>
</project>
最佳答案
基本上有两种方法可以解决问题:
execute(HttpClient)
方法,例如那样:// altenative to create a Destination at runtime:
// HttpDestination destination = DefaultHttpDestination.builder("https://www.google.de").build();
HttpDestination destination = DestinationAccessor.getDestination("ErpQueryEndpoint").asHttp();
HttpClient httpClient = HttpClientAccessor.getHttpClient(destination);
Map<String, Object> resp = createRequest.execute(httpClient).asMap();
关于java - 使用SAP Cloud SDK版本3.2.0将POST请求发送到OData服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59671829/
我已经制作了一个用于报名参加 Activity 的小应用程序。用户输入他们的数据,然后单击“登录我”。 现在有时人们在数据库中是双倍的,完全相同的数据彼此之间很快被插入了两次。这只能表示某人单击了两次
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefin
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefin
我正在尝试将数据从 Textarea 发布到经典的 ASP 脚本,该脚本更新本地计算机上的 MS SQL,然后发布到另一台服务器上的 PHP 脚本。但是,执行以下操作不起作用,因为它会切断文本区域的数
无效的代码: login_form = page.form_with(:method => 'post') 和有效的代码: login_form = page.form_with(:method =>
我希望能够在 HTTP Post 请求被触发时拦截它,然后修改其请求正文(或参数),然后发送它。 这怎么可能用 jquery/js 实现。 谢谢 最佳答案 Jquery ajax beforeSend
我想编写一个 Mysql 语句,从表(发布)中选择所有内容,其中标题类似于 $title 除了 $title 的标题。基本上我想显示某个帖子的所有相关帖子。我希望查询选择表中标题或详细信息中具有标题名
我已经成功创建了一个简单的 HTML 表单,它将上传的文件发布到我的 Amazon S3 存储桶。我遵循了以下说明: http://aws.amazon.com/articles/1434 现在我正在
我正在实现一个 PayPal IPN 页面,并想检查以确保请求真正来自 PayPal 而不是被欺骗。我假设 HTTP_REFERRER 不是一个好的检查方式?我已经尝试过这种方法,但变量只是空的。 有
我有一个非常简单的设置有一个非常特殊的问题。 该设置部署了 nginx Web 服务器以提供一些静态页面。它还有一个用于处理 POST 请求的后端 uwsgi 守护进程。 我的nginx位置配置如下
我认为我做错了什么,或者误解了我在网上阅读的有关 POST 和 GET 请求的内容。我在 myNumber.ejs 上有一个提交表单。当我按下提交时,有 Add.ejs 的 View 。 Add.ej
我需要将数据从 Express 应用程序的前端发送到后端,然后使用需要显示该数据的 EJS 呈现页面。 问题是 app.post() 方法,随后 res.render() 函数似乎没有完全执行或者当我
根据AWS Documentation对于 CloudFormation cfn-hup 帮助程序脚本,cfn-hup Hook 可以具有“要检测的以逗号分隔的条件列表”。这些条件/触发器可以是 po
位于“wp-admin/includes/”的“post.php”文件中的 wordpress 函数“get_default_post_to_edit”无法正常工作。 当我加载页面时:wp-admin
我使用请求库发布数据,但在服务器上收到空主体,没有传递任何数据。我在代码中遗漏了什么吗? Map map = new Map(); map[csrfNameKey] = csrfName;
我正在尝试使用 siege 3.0.1 测试我的网站。但是好像siege不发送POST数据。这是我从网络浏览器收到的请求 POST / HTTP/1.0 Accept: text/html,appli
我正在尝试为 stockfigher 游戏 api 编写包装器,只是为了了解 feign 是如何工作的,而且我在第一个 POST 方法中遇到了问题: @RequestMapping(method =
如何使用 Jersey 获取原始 POST? @FormParam将不起作用,因为我发布的原始 JSON 不在任何特定的 POST 字段中。 最佳答案 Jersey 带有一个用于将 JSON 映射到
我正在尝试同时创建一个实体和两个子实体的实例。 如果我将以下 JSON 发布到/user_objects 资源,它会很高兴地创建父 user_object 实体和链接的 User_object_att
在 IPV6 中如何使用 IPV6 地址和端口号构建 CURL POST http 请求。任何类型的线程都将受到赞赏。 尝试构建如下请求 >curl --interface 'http://[2001
我是一名优秀的程序员,十分优秀!