com.sun.xml.internal.ws.spi.db.databindingexception:未知的jaxbcontext实现:类com.sun.xml.bind.v2.runtime.jaxbcontextimpl

s6fujrry  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(941)

我正在为dhl建立一个客户(https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/geschaeftskundenversand-api/3.1/). 它是一个带有隐式soap头的soap api。我尝试添加标题,如这里所述(https://javaee.github.io/metro/doc/user-guide/user-guide.html#adding-发送请求时的soap头)

AuthentificationType authentificationType = new AuthentificationType();
authentificationType.setUser("user");
authentificationType.setSignature("pwd");
JAXBContext jaxbContext = JAXBContext.newInstance(AuthentificationType.class);
((WSBindingProvider) port).setOutboundHeaders(
 Headers.create(jaxbContext, authentificationType));

在最后一行我得到了一个例外:

com.sun.xml.internal.ws.spi.db.DatabindingException: Unknown JAXBContext implementation: class com.sun.xml.bind.v2.runtime.JAXBContextImpl

不幸的是,我不熟悉jaxb或jaxws。有人能给我一个提示吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题