使用 Axis2 ADB 客户端使用 https wsdl?异常:指标字段值缺少 class

Consume https wsdl using Axis2 ADB client?Exception: Missing class for indicator field value

我成功地使用了 https wsdl usign CXF 客户端。现在我需要使用 Axis2 ADB 客户端执行相同的操作。我已经用证书更新了 jdk 安全库。当我使用 http 使用代码时,没有错误。当我将其更改为 https 时,这是错误。所有依赖(生成的)classes 都是 Stub class 中的静态 classes。我没有看到任何缺失 class.

请建议一种使用 https wsdl 的方法。

    org.apache.axis2.AxisFault: javax.xml.bind.JAXBException
 - with linked exception:
[org.xml.sax.SAXException: 
Exception Description: Missing class for indicator field value [ns1:ssssAuthenticateUserVOIn] of type [class java.lang.String].
Descriptor: XMLDescriptor(oracle.e1.bssv.JP55USRB.valueobject.SSSS_AuthenticateUserVOIn --> [DatabaseTable(ns0:SSSS_AuthenticateUserMethod)])
Exception [EclipseLink-43] (Eclipse Persistence Services - 2.5.2): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [ns1:ssssAuthenticateUserVOIn] of type [class java.lang.String].
Descriptor: XMLDescriptor(oracle.e1.bssv.JP55USRB.valueobject.SSSS_AuthenticateUserVOIn --> [DatabaseTable(ns0:SSSS_AuthenticateUserMethod)])]

架构:

<xsd:complexType name="ssss_AuthenticateUserVOIn">
<xsd:complexContent>
<xsd:extension base="ns0:valueObject">
<xsd:sequence>
<xsd:element name="description" type="xsd:string" minOccurs="0"/>
<xsd:element name="enterpriseOnePassword" type="xsd:string" minOccurs="0"/>
<xsd:element name="errorCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="scheduledUserRole" type="xsd:string" minOccurs="0"/>
<xsd:element name="userID" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="SSSS_AuthenticateUserMethod" type="ns0:ssss_AuthenticateUserVOIn" nillable="true"/>

我自己想出了解决办法。我比较了 java 代码和 soapui 生成的 xml。我注意到在 java 代码中是 在 SOAPUI 中是 所以我回到代码并评论了这个 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ssssAuthenticateUserVOIn" 被添加的地方:

在 public void serialize(final javax.xml.namespace.QName parentQName, javax.xml.stream.XMLStreamWriter xmlWriter, boolean serializeType) 方法中,我评论了这个块并开始工作:

if ((namespacePrefix != null)
                    && (namespacePrefix.trim().length() > 0)) {
                writeAttribute("xsi",
                        "http://www.w3.org/2001/XMLSchema-instance", "type",
                        namespacePrefix + ":ssssAuthenticateUserVOIn",
                        xmlWriter);
            } else {
                writeAttribute("xsi",
                        "http://www.w3.org/2001/XMLSchema-instance", "type",
                        "ssssAuthenticateUserVOIn", xmlWriter);
            }

我什至不需要为 https 注册协议,也不需要为信任库或密钥库设置任何系统 属性,因为我已经将服务器证书添加到 jssecacerts 中。除了注释这个块之外,唯一的其他变化是 URL 从 http 到 https。而已。我想知道它在 http wsdl 下是如何工作的。 希望这可以帮助那里的人。