Java 解组错误CXF
我使用IntelliJ的最新版本,JDK1.7和CXF3.1 我使用它们从WSDL生成Java客户机代码 这是WSDLJava 解组错误CXF,java,web-services,intellij-idea,wsdl,cxf,Java,Web Services,Intellij Idea,Wsdl,Cxf,我使用IntelliJ的最新版本,JDK1.7和CXF3.1 我使用它们从WSDL生成Java客户机代码 这是WSDL <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://myserver/definitions" xmlns:tns="http://myserver/definitions" xmlns:http="http://schemas
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://myserver/definitions"
xmlns:tns="http://myserver/definitions"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:icd="http://myserver/schemas/GlobalID">
<!-- schema imports + elements -->
<wsdl:types>
<xs:schema targetNamespace="http://myserver/definitions">
<xs:import namespace="http://myserver/schemas/GlobalID" schemaLocation="http://myserver/schemas/GlobalID.xsd" />
</xs:schema>
</wsdl:types>
<!-- message definitions -->
<wsdl:message name="AddressingRequest">
<wsdl:part name="Body" element="icd:Addressing" />
</wsdl:message>
<wsdl:message name="AddressingResponse">
<wsdl:part name="Body" element="icd:AddressingResponse" />
</wsdl:message>
<!-- ports -->
<wsdl:portType name="WebServicePortType">
<wsdl:operation name="AddressingRequest">
<wsdl:input message="tns:AddressingRequest" />
<wsdl:output message="tns:AddressingResponse" />
</wsdl:operation>
</wsdl:portType>
<!-- service bindings -->
<wsdl:binding name="WebServiceBinding" type="tns:WebServicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="AddressingRequest">
<soap:operation soapAction="Addressing" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- service -->
<wsdl:service name="GlobalIDWebService">
<wsdl:port name="WebServicePort" binding="tns:WebServiceBinding">
<soap:address location="${soap.address.location}"/>
</wsdl:port>
</wsdl:service>
<wsdl:service name="GlobalIDWebServiceSecure">
<wsdl:port name="SecureWebServicePort" binding="tns:WebServiceBinding">
<soap:address location="${soap.address.location.secure}"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
以及一些必需的xsd定义:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
elementFormDefault="unqualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://myserver/schemas/GlobalID"
xmlns:globalid="http://myserver/schemas/GlobalID"
xmlns:common="http://myserver/schemas/Common">
<xs:import namespace="http://myserver/schemas/Common" schemaLocation="http://myserver/schemas/Common.xsd"/>
<xs:element name="Addressing" type="globalid:AddressingSearchType"/>
<xs:complexType name="AddressingSearchType">
<xs:sequence>
<xs:element name="Authentication" type="common:AuthenticationType" minOccurs="1"
maxOccurs="1"/>
<xs:choice>
<xs:element name="Address" type="common:AddressType" minOccurs="1" maxOccurs="1"/>
<xs:element name="ComponentAddress" type="globalid:AddressingRecordType"
minOccurs="1" maxOccurs="1"/>
<xs:sequence>
<xs:element name="FullAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="CountryCode" type="common:CountryCodeType" minOccurs="1"
maxOccurs="1"/>
</xs:sequence>
</xs:choice>
</xs:sequence>
<xs:attribute name="maxrows" type="xs:integer"/>
</xs:complexType>
<xs:element name="AddressingResponse" type="globalid:AddressingResponseType"/>
<xs:complexType name="AddressingResponseType">
<xs:sequence>
<xs:element name="Result" type="globalid:AddressingRecordType" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="recordcount" type="xs:integer"/>
</xs:complexType>
<xs:complexType name="AddressingRecordType">
<xs:group ref="globalid:AddressingRecordGroup"/>
</xs:complexType>
<xs:group name="AddressingRecordGroup">
<xs:all>
<xs:element name="AddressLine1" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine2" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine3" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine4" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine5" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine6" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine7" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AddressLine8" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="CountryCode" type="common:CountryCodeType" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:group>
</xs:schema>
我得到了一个错误
org.apache.cxf.interceptor.Fault:解组错误:意外
元素(uri):,
当地:“结果”)。预期的要素是
我尝试了许多不同的方法,在POJO中添加和删除名称空间。。。没有效果。我在网上搜索的所有类似的解决方案都没有帮助…:(似乎我需要在我的POJO中的注释中定义名称空间…不知道为什么CXF没有正确地生成它