Java 为什么WSDL客户端不能在Windows上工作
我一直在做一个Java 为什么WSDL客户端不能在Windows上工作,java,wsdl,webservice-client,Java,Wsdl,Webservice Client,我一直在做一个WSDL项目。该项目在Linux和windows上都运行良好,直到我从java8升级到openjdk11。在Linux上,它仍然在工作,问题是在Windows上。我甚至无法使WSDL螺柱进行初始化,这就像程序一旦到达应该初始化并调用WSDL螺柱的部分,就完全停止运行一样,下面是我的WSDL定义 <?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev
WSDL
项目。该项目在Linux
和windows
上都运行良好,直到我从java8
升级到openjdk11
。在Linux上,它仍然在工作,问题是在Windows上。我甚至无法使WSDL
螺柱进行初始化,这就像程序一旦到达应该初始化并调用WSDL螺柱的部分,就完全停止运行一样,下面是我的WSDL
定义
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-b01-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-b01-. -->
<definitions
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.asycuda.org"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.asycuda.org" name="MyWbService">
<types>
<xsd:schema>
<xsd:import namespace="http://www.asycuda.org"
schemaLocation="http://ip:port/asyws/WsItem?xsd=1"/>
</xsd:schema>
</types>
<message name="wsItemStore">
<part name="parameters" element="tns:wsItemStore"/>
</message>
<message name="wsItemStoreResponse">
<part name="parameters" element="tns:wsItemStoreResponse"/>
</message>
<portType name="WsItem">
<operation name="wsItemStore">
<input wsam:Action="urn:wsItemStore" message="tns:wsItemStore"/>
<output wsam:Action="http://www.asycuda.org/WsItem/wsItemStoreResponse" message="tns:wsItemStoreResponse"/>
</operation>
</portType>
<binding name="WsItemServicePortBinding" type="tns:WsItem">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="wsItemStore">
<soap:operation soapAction="urn:wsItemStore"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WsItemService">
<port name="WsItemServicePort" binding="tns:WsItemServicePortBinding">
<soap:address location="http://ip:port/asyws/WsItem"/>
</port>
</service>
</definitions>
当我在Windows中运行此代码时,程序只会在logger.debug(“Initialization started”)
消息处停止,另一方面,当我在Linux中运行它时,初始化会完成。如何修复此问题?事实证明,我缺少一些依赖项。在Linux
上运行应用程序时,我在intellij
中运行它,但要在windows上运行它,我需要从IDE编译一个jar。IDE在运行时注入了缺少的依赖项,这也是它在Linux上工作正常但在windows上工作不正常的原因
我必须添加这些依赖项才能使它在Java11
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.0</version>
<type>pom</type>
</dependency>
com.sun.xml.ws
jaxws-rt
2.3.1
聚甲醛
javax.xml.ws
JAXWSAPI
2.3.1
com.sun.xml.ws
jaxws-ri
2.3.0
聚甲醛
您几乎肯定需要进行配置。Java9为Java添加了模块化。因此,要么配置模块,要么降级到Java8。
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.0</version>
<type>pom</type>
</dependency>