将wsdl导入SoapUI时出错

时间:2016-09-12 15:33:45

标签: soap wsdl soapui

尝试将WSDL加载到SoapUI时出现以下错误:

    WSDLException (at /wsdl:definitions/wsdl:porttype): faultCode=INVALID_WSDL: Encountered illegal extension element '{http://schemas.xmlsoap.org/wsdl/}porttype' in the context of a 'javax.wsdl.Definition'. Extension elements must be in a namespace other than WSDL's:

Mon Sep 12 20:41:56 CEST 2016:ERROR:com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
   com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:53)
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:62)
    at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:34)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:246)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:48)
    at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:219)
    at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
    at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:131)
    at java.lang.Thread.run(Unknown Source)
. 

这是WSDL:

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
        xmlns:tns="http://www.somedomain.com/Design" xmlns:s="http://www.w3.org/2001/XMLSchema"
        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
        targetnamespace="http://www.somedomain.com/Design" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
        <wsdl:types>
            <s:schema elementformdefault="qualified" targetnamespace="http://www.somedomain.com/Design">
                <s:element name="PrintMessage">
                    <s:complexType />
                </s:element>
                <s:element name="PrintMessageResponse">
                    <s:complexType>
                        <s:portType>
                            <s:element minoccurs="0" maxoccurs="1" name="PrintMessageResult" type="s:string" />
                        </s:portType>
                    </s:complexType>
                </s:element>
                <s:element name="StartDesign">
                    <s:complexType>
                        <s:portType>
                            <s:element minoccurs="0" maxoccurs="1" name="userEmail" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="designType" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="organism" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="portTypes" type="tns:ArrayOfSequenceModel" />
                            <s:element minoccurs="0" maxoccurs="1" name="intronSpanning" type="s:boolean" />
                            <s:element minoccurs="0" maxoccurs="1" name="distributed" type="s:boolean" />
                        </s:portType>
                    </s:complexType>
                </s:element>
                <s:element name="StartDesignWithCustomer">
                    <s:complexType>
                        <s:portType>
                            <s:element minoccurs="0" maxoccurs="1" name="userEmail" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="designType" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="organism" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="portTypes" type="tns:ArrayOfSequenceModel" />
                            <s:element minoccurs="0" maxoccurs="1" name="customerName" type="s:string" />
                            <s:element minoccurs="0" maxoccurs="1" name="intronSpanning" type="s:boolean" />
                            <s:element minoccurs="0" maxoccurs="1" name="distributed" type="s:boolean" />
                        </s:portType>
                    </s:complexType>
                </s:element>
                <s:complexType name="ArrayOfSequenceModel">
                    <s:portType>
                        <s:element minoccurs="0" maxoccurs="unbounded" name="SequenceModel" nillable="true"
                            type="tns:SequenceModel" />
                    </s:portType>
                </s:complexType>
                <s:complexType name="SequenceModel">
                    <s:portType>
                        <s:element minoccurs="0" maxoccurs="1" name="Gene" type="s:string" />
                        <s:element minoccurs="0" maxoccurs="1" name="Sequence" type="s:string" />
                        <s:element minoccurs="0" maxoccurs="1" name="IntronPositions" type="s:string" />
                        <s:element minoccurs="0" maxoccurs="1" name="IntronLengths" type="s:string" />
                    </s:portType>
                </s:complexType>
                <s:element name="StartDesignResponse">
                    <s:complexType>
                        <s:portType>
                            <s:element minoccurs="0" maxoccurs="1" name="StartDesignResult" type="tns:WebServiceDesignStartResponse" />
                        </s:portType>
                    </s:complexType>
                </s:element>
                <s:element name="StartDesignWithCustomerResponse">
                    <s:complexType>
                        <s:portType>
                            <s:element minoccurs="0" maxoccurs="1" name="StartDesignWithCustomerResult" type="tns:WebServiceDesignStartResponse" />
                        </s:portType>
                    </s:complexType>
                </s:element>
                <s:complexType name="WebServiceDesignStartResponse">
                    <s:portType>
                        <s:element minoccurs="0" maxoccurs="1" name="Status" type="s:string" />
                        <s:element minoccurs="0" maxoccurs="1" name="Message" type="s:string" />
                        <s:element minoccurs="0" maxoccurs="1" name="JobId" type="s:string" />
                    </s:portType>
                </s:complexType>
            </s:schema>
        </wsdl:types>
        <wsdl:message name="PrintMessageSoapIn">
            <wsdl:part name="parameters" element="tns:PrintMessage" />
        </wsdl:message>
        <wsdl:message name="PrintMessageSoapOut">
            <wsdl:part name="parameters" element="tns:PrintMessageResponse" />
        </wsdl:message>
        <wsdl:message name="StartDesignSoapIn">
            <wsdl:part name="parameters" element="tns:StartDesign" />
        </wsdl:message>
        <wsdl:message name="StartDesignSoapOut">
            <wsdl:part name="parameters" element="tns:StartDesignResponse" />
        </wsdl:message>
        <wsdl:message name="StartDesignWithCustomerSoapIn">
            <wsdl:part name="parameters" element="tns:StartDesignWithCustomer" />
        </wsdl:message>
        <wsdl:message name="StartDesignWithCustomerSoapOut">
            <wsdl:part name="parameters" element="tns:StartDesignWithCustomerResponse" />
        </wsdl:message>
        <wsdl:porttype name="DesignWebServiceSoap">
            <wsdl:operation name="PrintMessage">
                <wsdl:input message="tns:PrintMessageSoapIn" />
                <wsdl:output message="tns:PrintMessageSoapOut" />
            </wsdl:operation>
            <wsdl:operation name="StartDesign">
                <wsdl:input message="tns:StartDesignSoapIn" />
                <wsdl:output message="tns:StartDesignSoapOut" />
            </wsdl:operation>
            <wsdl:operation name="StartDesignWithCustomer">
                <wsdl:input message="tns:StartDesignWithCustomerSoapIn" />
                <wsdl:output message="tns:StartDesignWithCustomerSoapOut" />
            </wsdl:operation>
        </wsdl:porttype>
        <wsdl:binding name="DesignWebServiceSoap" type="tns:DesignWebServiceSoap">
            <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
            <wsdl:operation name="PrintMessage">
                <soap:operation soapaction="http://www.somedomain.com/Design/PrintMessage" style="document" />
                <wsdl:input>
                    <soap:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="StartDesign">
                <soap:operation soapaction="http://www.somedomain.com/Design/StartDesign" style="document" />
                <wsdl:input>
                    <soap:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="StartDesignWithCustomer">
                <soap:operation soapaction="http://www.somedomain.com/Design/StartDesignWithCustomer" style="document" />
                <wsdl:input>
                    <soap:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:binding name="DesignWebServiceSoap12" type="tns:DesignWebServiceSoap">
            <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
            <wsdl:operation name="PrintMessage">
                <soap12:operation soapaction="http://www.somedomain.com/Design/PrintMessage" style="document" />
                <wsdl:input>
                    <soap12:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="StartDesign">
                <soap12:operation soapaction="http://www.somedomain.com/Design/StartDesign" style="document" />
                <wsdl:input>
                    <soap12:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="StartDesignWithCustomer">
                <soap12:operation soapaction="http://www.somedomain.com/Design/StartDesignWithCustomer" style="document" />
                <wsdl:input>
                    <soap12:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap12:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="DesignWebService">
            <wsdl:port name="DesignWebServiceSoap" binding="tns:DesignWebServiceSoap">
                <soap:address location="http://www.somedomain.com/_vti_bin/DesignWebService.asmx" />
            </wsdl:port>
            <wsdl:port name="DesignWebServiceSoap12" binding="tns:DesignWebServiceSoap12">
                <soap:address location="http://www.somedomain.com/_vti_bin/DesignWebService.asmx" />
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>

我有一个类似的WSDL可行,但事实并非如此。我没有看到任何错误。有什么想法吗?

谢谢!

0 个答案:

没有答案