spring-boot - Spring Boot soap client auto retry
问题描述
I have a Microservice written in Spring Boot.
<!-- SOAP consumer -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf</artifactId>
<version>3.3.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.0.1</version>
</dependency>
But sometime when make a Soap call to other server, it automaticly make 2 requests.
MyService service = new
MyService();
MyPortType portType = service
.getPort();
((BindingProvider) portType).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, user);
((BindingProvider) portType).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, pass);
((BindingProvider) portType).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpoint);
return portType.makeSoapCall(input);
In my app, only 1 request log and 1 response log. But in server, this is 2. I was try with VM argument "-Dsun.net.http.retryPost=false -Dhttp.retryPost=false" but no luck.
So, Anyone can give me a help? Thank you!
解决方案
推荐阅读
- javascript - Javascript - 从数组中返回最大的数字
- c# - PGM P2 格式应用中值过滤器并保存所做的更改问题
- node.js - 将帖子保存到数据库后,如何路由到另一个 ejs 页面
- python - 评估 False 为 -1 和 True 为 1 的最佳方法是什么?
- javascript - 如何从数组中定位当前焦点元素以调用 focusout 函数?
- typescript - TypeORM: Creating a connection in a parent class and using in a child not working
- java - 如何防止在 Java 获取重定向 URL 时出现 404/java.io.FileNotFoundException?
- python - 用python中的整数和字符串对列表中的项目求和
- go - Go 中的函数声明是否严格?
- c# - 将 C# 连接到非常旧的 ActiveX 控件