我使用wsimport的WSDL生成的类没有equals()和hashcode()方法.如何自定义和生成客户端类以获取equals()和hashcode()方法.
我不确定使用JAXB来实现这一点.
在Axis2.0生成的存根中生成了这些方法,但不确定为什么JAXWS中没有这样的基本功能!
使用wsimport从WSDL生成客户端代码时,我得到了很多ArrayOf***类.我想确保我得到String []而不是ArrayOfString.
要实现这一目标需要做哪些外部定制?
我有a.wsdl&b.wsdl,其中a.wsdl导入b.wsdl.现在我必须使用wsimport和JAXB自定义b.wsdl中的模式.但使用下面的自定义会给出"XPath评估"wsdl:definitions/wsdl:types/xsd:schema [@ targetNamespace ='b']"导致空目标节点的错误
在使用wsimport生成客户端代码时,我无法找到在导入的b.wsdl中自定义内联架构的方法.
<jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='b']"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<jaxb:globalBindings>
<jaxb:javaType name="java.util.Calendar" xmlType="xsd:dateTime"
parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
printMethod="javax.xml.bind.DatatypeConverter.printDateTime" />
</jaxb:globalBindings>
</jaxws:bindings>
Run Code Online (Sandbox Code Playgroud)
A.wsdl
<definitions targetNamespace="a"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:interface="b">
<import location="b.wsdl" namespace="b"/>
<service name="Service">
<port binding="interface:Binding" name="Port">
<soap:address location="https://localhost/sdk/vpxdService" />
</port>
</service>
</definitions>
Run Code Online (Sandbox Code Playgroud)
B.wsdl
<definitions targetNamespace="b"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:b="b"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<schema
targetNamespace="b"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:b="b"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<complexType name="XYZ">
<sequence>
<element name="dynamicType" type="xsd:string" minOccurs="0" />
<element name="val" type="xsd:anyType" maxOccurs="unbounded" />
</sequence>
</complexType>
</types>
</schema>
</definitions>
Run Code Online (Sandbox Code Playgroud)