我们最近将一个旧的 Java 7 应用程序升级到了 Spring Boot 和最新版本的 Spring Boot(同时将它移到了 Java 8)。在重新使用在合约参数中使用 xs:dateTime 的 Web 服务后,它现在会在生成的客户端界面上生成错误。
抽象类 javax.xml.datatype.XMLGregorianCalendar 不能用作运行时类,因为它没有被适合作为运行时类的非抽象类扩展
这在以前的消费中从来都不是问题。XMLGregorianCalendar 是否有理由不再使用?如果可能,我想避免自定义绑定(从而保持 XMLGregorianCalendar 不必重构所有现有代码)。
WSDL 方法输入:
<xs:complexType name="findGroupingsBySystem">
<xs:sequence>
<xs:element type="xs:string" name="theSystem" minOccurs="0"/>
<xs:element type="xs:dateTime" name="theStartDate" minOccurs="0"/>
<xs:element type="xs:dateTime" name="theEndDate" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
使用 cxf-spring-boot-starter 3.2.0 的 Java 8 Spring Boot 1.5.7
我从多年前看到了这个现有条目:CXF 创建的 Web 服务代码因为 XMLGregorianCalendar 而不是合法的?
我最大的问题是为什么现在这不起作用(为什么我以前从未遇到过这个问题)?是否可以引入依赖项/等以便能够将其保留在界面中?如果没有,如果默认值不起作用,为什么会以这种方式生成?