0

我是使用axis2的新手,我试图从wsdl生成java类。不幸的是,我得到了以下异常: org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL 我无法弄清楚如何找到问题。我在 jdk1.7 和 win7 上使用axis2-1.6.2。任何提示将不胜感激。Flavio 这是我的 wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions 
name="IFX170PortType" 
targetNamespace="urn:ifxforum-org:WSDL:1:PortType" 
xmlns:tns="urn:ifxforum-org:WSDL:1:PortType" 
xmlns:types="urn:ifxforum-org:WSDL:1:PortType:types" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
    <xsd:schema 
        targetNamespace="urn:ifxforum-org:WSDL:1:PortType:types"
        xmlns:ifx="urn:ifxforum-org:XSD:1" 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
        <xsd:import namespace="urn:ifxforum-org:XSD:1" 
                                schemaLocation="IFX170.xsd"/>
        <xsd:element name="DoIFXRq">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="ifx:IFX" />
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="DoIFXRs">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="ifx:IFX" />
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
</wsdl:types>
<wsdl:message name="DoIFXRqMsg">
    <wsdl:part name="parameters" element="types:DoIFXRq"/>
</wsdl:message>
<wsdl:message name="DoIFXRsMsg">
    <wsdl:part name="result" element="types:DoIFXRs"/>
</wsdl:message>
<wsdl:portType name="IFX170PortType">
    <wsdl:operation name="DoIFX">
        <wsdl:input message="tns:DoIFXRqMsg"/>
        <wsdl:output message="tns:DoIFXRsMsg"/>
    </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="IFX170SOAPBinding" type="IFX170PortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="DoIFX">
        <soap:operation style="document" soapAction="getDoIFX" />
        <wsdl:input>
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="IFX170Service">
    <wsdl:port name="IFX170SOAPPort" binding="IFX170SOAPBinding">
        <soap:address location="http://localhost:8080/axis2/services      /StockQuoteService" />
    </wsdl:port>
</wsdl:service>
</wsdl:definitions>
4

1 回答 1

0

如果仍有问题,请尝试对 WSDL 进行以下更新,以确保正确引用 WSDL 中的相关实体:

<wsdl:binding name="IFX170SOAPBinding" type="tns:IFX170PortType">

<wsdl:service name="IFX170Service">
    <wsdl:port name="IFX170SOAPPort" binding="tns:IFX170SOAPBinding">

请注意分别在 type 和 binding 属性中使用 'tns:' 前缀。

于 2012-05-10T05:08:11.010 回答