mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
webservice SOAP 弃用javaEE xml saop 使用jakarta xml soap
This commit is contained in:
parent
00eaaeae2d
commit
c874210568
@ -505,8 +505,7 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 适配jdk升级到9及以上,移除了 javax.xml.bind (JAXB) 的问题; javax需要从外部引入 -->
|
||||
<!--JAXB (JSR 222) JAXBUtil xml相关依赖-->
|
||||
<!--JAXB (JSR 222) JAXBUtil javax.xml.bind xml相关依赖, 从javaEE(javax.xml.bind)变成jakartaEE(jakarta.xml.bind) -->
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
@ -525,11 +524,5 @@
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>activation</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -43,10 +43,17 @@
|
||||
<artifactId>hutool-log</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<!-- webservice SOAP, 从javaEE变成jakartaEE(javax.xml.soap) Jakarta XML SOAP(jakarta.xml.soap) -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.soap</groupId>
|
||||
<artifactId>javax.xml.soap-api</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<groupId>jakarta.xml.soap</groupId>
|
||||
<artifactId>jakarta.xml.soap-api</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.messaging.saaj</groupId>
|
||||
<artifactId>saaj-impl</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -26,7 +26,7 @@ import org.dromara.hutool.http.client.Response;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.soap.*;
|
||||
import jakarta.xml.soap.*;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.http.webservice;
|
||||
|
||||
import javax.xml.soap.SOAPConstants;
|
||||
import jakarta.xml.soap.SOAPConstants;
|
||||
|
||||
/**
|
||||
* SOAP协议版本枚举
|
||||
|
@ -17,8 +17,8 @@ import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import javax.xml.soap.SOAPException;
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
import jakarta.xml.soap.SOAPException;
|
||||
import jakarta.xml.soap.SOAPMessage;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.util.CharsetUtil;
|
||||
|
@ -17,8 +17,8 @@ import org.dromara.hutool.core.util.CharsetUtil;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.xml.soap.SOAPException;
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
import jakarta.xml.soap.SOAPException;
|
||||
import jakarta.xml.soap.SOAPMessage;
|
||||
|
||||
/**
|
||||
* SOAP相关单元测试
|
||||
@ -32,7 +32,7 @@ public class SoapClientTest {
|
||||
@Disabled
|
||||
public void requestTest() {
|
||||
final SoapClient client = SoapClient.of("http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx")
|
||||
.setMethod("web:getCountryCityByIp", "http://WebXml.com.cn/")
|
||||
.setMethod("getCountryCityByIp", "http://WebXml.com.cn/")
|
||||
.charset(CharsetUtil.GBK)
|
||||
.setParam("theIpAddress", "218.21.240.106");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user