我成功地使用了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"/>I was successfully able to consume https wsdl usign CXF client. Now I need to do the same using Axis2 ADB client. I have updated the jdk security lib with the certificate. When I consume the code usign http, there is no error. When I change it to https, this is the error. All the dependent(generated) classes are static classes inside the Stub class. I dont see any missing class.
Please suggest a way to consume 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)])]Schema:
<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”正在增加:
在公共无效序列化(最终javax.xml.namespace.QName parentQName,javax.xml.stream.XMLStreamWriter xmlWriter,布尔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下工作的。 希望这可以帮助那里的人。
I figured out the solution myself. I compared the xmls thats getting generated by java code and soapui. I noticed that in java code it was and in SOAPUI it was So I went back to the code and commented the place where this xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ssssAuthenticateUserVOIn" was getting added:
In public void serialize(final javax.xml.namespace.QName parentQName, javax.xml.stream.XMLStreamWriter xmlWriter, boolean serializeType) method I commented this block and it started working:
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); }I dint even need to register protocol for https, nor set any system property for truststore or keystore since I had already added the server certificate into jssecacerts. Apart from commenting this block, the only other change is the URL from http to https. Thats it. I wonder how it worked under http wsdl. Hope this helps someone out there.
更多推荐
发布评论