diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f8481be..842a1a27d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------------------------------------- -# 5.6.3 (2021-04-06) +# 5.6.3 (2021-04-08) ### 新特性 * 【core 】 修改数字转换的实现,增加按照指定端序转换(pr#1492@Github) @@ -16,6 +16,7 @@ * 【cache 】 使用LongAddr代替AtomicLong(pr#301@Gitee) * 【cache 】 EnumUtil使用LinkedHashMap(pr#304@Gitee) * 【crypto 】 SymmetricCrypto支持大量数据加密解密(pr#1497@Gitee) +* 【http 】 SoapClient增加针对不同协议的头信息(pr#305@Gitee) ### Bug修复 * 【core 】 修复Validator.isUrl()传空返回true(issue#I3ETTY@Gitee) diff --git a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java b/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java index 5d8f269dc..7e8d09a3e 100644 --- a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java +++ b/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java @@ -661,9 +661,14 @@ public class SoapClient extends HttpBase { * @return 请求的Content-Type */ private String getXmlContentType() { - return SoapProtocol.SOAP_1_1.equals(this.protocol) ? - CONTENT_TYPE_SOAP11_TEXT_XML.concat(this.charset.toString()) : - CONTENT_TYPE_SOAP12_SOAP_XML.concat(this.charset.toString()); + switch (this.protocol){ + case SOAP_1_1: + return CONTENT_TYPE_SOAP11_TEXT_XML.concat(this.charset.toString()); + case SOAP_1_2: + return CONTENT_TYPE_SOAP12_SOAP_XML.concat(this.charset.toString()); + default: + throw new SoapRuntimeException("Unsupported protocol: {}", this.protocol); + } } /**