From d4d81e3dd24df73dd67771cd695c3b130ea00fd8 Mon Sep 17 00:00:00 2001 From: Looly Date: Tue, 16 Jan 2024 21:18:35 +0800 Subject: [PATCH] fix code --- hutool-http/pom.xml | 6 ++++++ .../org/dromara/hutool/http/meta/HeaderName.java | 8 +++++++- .../dromara/hutool/http/webservice/SoapClient.java | 12 ++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hutool-http/pom.xml b/hutool-http/pom.xml index 41686d9f7..4c147ec59 100755 --- a/hutool-http/pom.xml +++ b/hutool-http/pom.xml @@ -50,6 +50,12 @@ 2.0.1 provided + + com.sun.xml.messaging.saaj + saaj-impl + 2.0.1 + test + diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/meta/HeaderName.java b/hutool-http/src/main/java/org/dromara/hutool/http/meta/HeaderName.java index 931fc5b89..6c4c8a0f3 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/meta/HeaderName.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/meta/HeaderName.java @@ -71,7 +71,13 @@ public enum HeaderName { */ PRAGMA("Pragma"), /** - * 请求表示提交内容类型或返回返回内容的MIME类型 + * 请求表示提交内容类型或返回返回内容的MIME类型,例如: + * */ CONTENT_TYPE("Content-Type"), diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapClient.java b/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapClient.java index cc5b156f4..afb5e5fe2 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapClient.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapClient.java @@ -26,7 +26,10 @@ import org.dromara.hutool.http.client.Response; import javax.xml.XMLConstants; import javax.xml.namespace.QName; + import jakarta.xml.soap.*; +import org.dromara.hutool.http.meta.Method; + import java.io.IOException; import java.io.OutputStream; import java.nio.charset.Charset; @@ -586,10 +589,11 @@ public class SoapClient implements HeaderOperation { */ public Response sendForResponse() { final Request request = Request.of(this.url) - .setMaxRedirectCount(2) - .contentType(getXmlContentType()) - .header(this.headers, false) - .body(getMsgStr(false)); + .method(Method.POST) + .setMaxRedirectCount(2) + .contentType(getXmlContentType()) + .header(this.headers, false) + .body(getMsgStr(false)); return request.send(); }