对与同一个wsdl文件,我尝试过使用axis2是可以正常转过来java代码。
但是,当使用cxf时,出现了报错:
wsdl的出错部分:
这时,只需增加schemaLocation。如
但是,当使用cxf时,出现了报错:
WSDLToJava Error: Thrown by JAXB:
Thrown by JAXB:
undefined simple or complex type 'soapenc:Array'
wsdl的出错部分:
<s:schema targetNamespace="http://iamsweb.gmcc.net/WS/AbstractTypes">
<s:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<s:complexType name="StringArray">
<s:complexContent mixed="false">
<s:restriction base="soapenc:Array">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="String" type="s:string" />
</s:sequence>
</s:restriction>
</s:complexContent>
</s:complexType>
</s:schema>
这时,只需增加schemaLocation。如
<s:schema targetNamespace="http://iamsweb.gmcc.net/WS/AbstractTypes">
<s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
<s:complexType name="StringArray">
<s:complexContent mixed="false">
<s:restriction base="soapenc:Array">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="String" type="s:string" />
</s:sequence>
</s:restriction>
</s:complexContent>
</s:complexType>
</s:schema>