使用Axis2 ADB客户端使用https wsdl?例外:缺少指标字段值的类

时间:2016-09-26 20:51:43

标签: https axis2 webservices-client

我成功地使用了https wsdl usign CXF客户端。现在我需要使用Axis2 ADB客户端做同样的事情。我已使用证书更新了jdk安全库。当我使用代码使用http时,没有错误。当我将其更改为https时,这是错误。所有依赖(生成)类都是Stub类中的静态类。我没有看到任何失踪的课程。

请建议使用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"/>

1 个答案:

答案 0 :(得分:0)

我自己想出了解决方案。我比较了由java代码和soapui生成的xmls。我注意到它在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注册协议,也不需要为truststore或keystore设置任何系统属性,因为我已经将服务器证书添加到jssecacerts中。除了评论此块之外,唯一的其他更改是从http到https的URL。而已。我想知道它在http wsdl下是如何工作的。 希望这可以帮助那些人。

相关问题