【发布时间】:2019-10-10 02:10:51
【问题描述】:
我有一个WSDL 一直在从事的项目。该项目在Linux 和windows 上运行良好,直到我从Java 8 升级到openJDK 11。在 Linux 上它仍然可以工作,问题出在 Windows 上。我什至无法初始化WSDL studs,就像程序一旦到达它应该初始化并调用WSDL studs 的部分就完全停止,下面是我的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>
以及我如何从Java 访问它
try{
logger.debug("Initialization started");
org.asycuda.WsItemService service = new org.asycuda.WsItemService();
org.asycuda.WsItem port = service.getWsItemServicePort();
Authenticator.setDefault(new WSAuthenticator(username, password));
logger.debug("Initialization complete");
}catch(Exception e){
logger.error(e);
}
当我在 Windows 中运行此代码时,程序只会在 logger.debug("Initialization started") 消息处停止,另一方面,当我在 Linux 中运行它时,初始化会完成。我该如何解决这个问题?
【问题讨论】:
-
您几乎肯定需要配置modules。 Java 9 为 Java 添加了模块化。所以要么配置模块,要么降级到 Java 8。
标签: java wsdl webservice-client