Forum Discussion

mickey-icix's avatar
mickey-icix
Occasional Contributor
6 years ago
Solved

Why am I getting INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions error

Below is the definitions section of my .wsdl.  It clearly has the attribute that SoupUI asserts as missing.  What am I doing wrong?

 

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
xmlns:tns="https://test.connect.boomi.com/ws/soap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
targetNamespace="https://test.connect.boomi.com/ws/soap"
name="TestResultsService">

  • richie's avatar
    richie
    6 years ago

    Hi,

     

    The first thing I do before I try importing a .wsdl is to check that it's wellformed and schema valid.  If the file is malformed xml or invalid, this will cause problems.

     

    I had a quick look (after Id removed those annoying emojis that automatically generate) and noticed 2 instances of you referencing elements to the ns1 namespace - but the namespace declarations immediately below the prolog dont include a namespace with the identifier ns1.

     

    Once I'd fixed that - I pointed them to the tns namespace as I think that's what they should be pointing at - I started finding more schema invalid issues.  Each one I tried fixing just lead onto another - I'm sorry - I don't know what your .wsdl is supposed to look like to fix all the issues I'm afraid

     

    You'll need to fix these before the .wsdl can be loaded into SoapUI - this is why you're getting the invalid wsdl error - the file is schema invalid.

     

    I suggest you go back to whoever supplied the .wsdl and ask them to try and validate it, then they'll see the various problems I found that will need to be fixed before this can successfully be loaded into SoapUI.

     

    Sorry I can't be more help,

     

    Cheers,

     

    richie

10 Replies

  • Calvin_Liang's avatar
    Calvin_Liang
    SmartBear Alumni (Retired)

    Hey there,

     

    1) What version of ReadyAPI/SoapUI are you using?

    2) Could you upload your .wsdl file and any error logs?

     

    Best,

    Calvin

  • mickey-icix's avatar
    mickey-icix
    Occasional Contributor

    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsp="http://www.w3.org/ns/ws-policy"
    xmlns:tns="https://test.connect.boomi.com/ws/soap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    targetNamespace="https://test.connect.boomi.com/ws/soap"
    name="TestResultsService">
    <types>
    <xs:schema xmlns:tns="https://test.connect.boomi.com/ws/soap"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    version="1.0"
    targetNamespace="https://test.connect.boomi.com/ws/soap">

    <xs:element name="Response" type="tns:response"/>
    <xs:element name="TestResult" type="tns:testResult"/>
    <xs:element name="TestResults" type="tns:testResults"/>
    <xs:element name="testCitation" type="tns:testCitation"/>
    <xs:element name="testProperty" type="tns:testProperty"/>
    <xs:complexType name="testResults">
    <xs:sequence>
    <xs:element ref="tns:TestResult" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="testResult">
    <xs:sequence>
    <xs:element name="requestId" type="xs:int" default="0" />
    <xs:element name="testResultId" type="xs:int" default="0" />
    <xs:element name="labOrgId" type="xs:int" default="0" />
    <xs:element name="labBuyerNumber" type="xs:string" minOccurs="0"/>
    <xs:element name="buyerOrgId" type="xs:int" default="0" />
    <xs:element name="reportNumber" type="xs:string" minOccurs="1"/>
    <xs:element name="productDescription" type="xs:string" minOccurs="1"/>
    <xs:element name="supplierItemNumber" type="xs:string" minOccurs="1"/>
    <xs:element name="departmentNumber" type="xs:string" minOccurs="0"/>
    <xs:element name="supplierId" type="xs:string" minOccurs="1"/>
    <xs:element name="factoryId" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorNumber" type="xs:string" minOccurs="1"/>
    <xs:element name="buyerItemNumbers" minOccurs="0">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="buyerItemNumber" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="UPCNumbers" minOccurs="1">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="UPCNumber" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="countryOfOrigin" type="xs:string" minOccurs="0"/>
    <xs:element name="productSource" type="xs:string" minOccurs="0"/>
    <xs:element name="purchaseOrderNumber" type="xs:string" minOccurs="0"/>
    <xs:element name="overallRating" type="tns:PassFail" minOccurs="1"/>
    <xs:element name="executiveSummary" type="xs:string" minOccurs="0"/>
    <xs:element name="conditionalApproval" type="xs:string" minOccurs="0"/>
    <xs:element name="testCitations" minOccurs="0">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="tns:testCitation" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="importerOfRecord" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryName" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryFullAddress" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryAddress" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryCity" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryState" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryPostCode" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryCountryCode" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryPhoneNumber" type="xs:string" minOccurs="0"/>
    <xs:element name="factoryEmail" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorName" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorAddress" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorCity" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorState" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorPostCode" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorCountryCode" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorPhoneNumber" type="xs:string" minOccurs="0"/>
    <xs:element name="vendorEmail" type="xs:string" minOccurs="0"/>
    <xs:element name="labName" type="xs:string" minOccurs="0"/>
    <xs:element name="labFullAddress" type="xs:string" minOccurs="0"/>
    <xs:element name="labPhoneNumber" type="xs:string" minOccurs="0"/>
    <xs:element name="dateManufactured" type="xs:date" minOccurs="0"/>
    <xs:element name="dateOut" type="xs:date" minOccurs="0"/>
    <xs:element name="testPhase" type="xs:string" minOccurs="0"/>
    <xs:element name="isChildrensProduct" type="xs:boolean" default="false"/>
    <xs:element name="fileName" type="xs:string" minOccurs="0"/>
    <xs:element name="certificateRequired" minOccurs="0">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="certificate" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="meetsBuyerTestingRequirements" type="xs:boolean" default="false"/>
    <xs:element name="testProperties" minOccurs="0">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="tns:testProperty" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="testCitation">
    <xs:sequence>
    <xs:element name="citationId" type="xs:int" default="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="testProperty">
    <xs:sequence>
    <xs:element name="testPropertyId" type="xs:int" default="0"/>
    <xs:element name="testResult" type="xs:string" minOccurs="0"/>
    <xs:element name="federalStateRegulation" type="xs:boolean" default="false"/>
    <xs:element name="industryVoluntaryStandards" type="xs:boolean" default="false"/>
    <xs:element name="productSpecification" type="xs:boolean" default="false"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="response">
    <xs:sequence>
    <xs:element name="responseStatus" type="xs:string"/>
    <xs:element name="errorCode" type="xs:int" default="0"/>
    <xs:element name="errorDescription" type="xs:string" minOccurs="0"/>
    <xs:element name="transactionId" type="xs:string" minOccurs="0"/>
    <xs:element name="transactionUrl" type="xs:string" minOccurs="0"/>
    <xs:element name="transactionDetail" type="xs:string" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="PassFail">
    <xs:restriction base="xs:string">
    <xs:enumeration value="Pass"/>
    <xs:enumeration value="Fail"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
    <xs:element name="updateTestResultComplete" type="tns:updateTestResultComplete"/>
    <xs:element name="updateTestResultCompleteResponse" type="tns:updateTestResultCompleteResponse"/>
    <xs:complexType name="updateTestResultComplete">
    <xs:sequence>
    <xs:element name="username" type="xs:string" minOccurs="0"/>
    <xs:element name="password" type="xs:string" minOccurs="0"/>
    <xs:element ref="ns1:TestResults" minOccurs="0"/>
    <xs:element name="fileName" type="xs:string" minOccurs="0"/>
    <xs:element name="fileData" type="xs:base64Binary" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="updateTestResultCompleteResponse">
    <xs:sequence>
    <xs:element name="updateTestResultCompleteResult" type="ns1:response" form="qualified" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    </types>
    <message name="updateTestResultComplete">
    <part name="parameters" element="tns:updateTestResultComplete"/>
    </message>
    <message name="updateTestResultCompleteResponse">
    <part name="parameters" element="tns:updateTestResultCompleteResponse"/>
    </message>
    <portType name="TestResultsIngesterService">
    <operation name="updateTestResultComplete">
    <input message="tns:updateTestResultComplete"/>
    <output message="tns:updateTestResultCompleteResponse"/>
    </operation>
    </portType>
    <binding name="TestResultsPortBinding" type="tns:TestResultsIngesterService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="updateTestResultComplete">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="TestResultsService">
    <port name="TestResultsPort" binding="tns:TestResultsPortBinding">
    <soap:address location="https://test.connect.boomi.com/ws/soap"/>
    </port>
    </service>
    </definitions>

    • Calvin_Liang's avatar
      Calvin_Liang
      SmartBear Alumni (Retired)

      Hello Mickey,

       

      Thank you for your wsdl file. May I please have your error logs that I requested as well?

       

      They should be located within the SoapUI bin directory (path should look like so: C:\Program Files\SmartBear\SoapUI-5.4.0\bin\soapui-errors.log)

       

      Best,

      Calvin

    • Calvin_Liang's avatar
      Calvin_Liang
      SmartBear Alumni (Retired)

      Hi Mickey,

       

      Thank you for the error log. Strangely I do not see the invalid_wsdl error in your error log. Does this error occur/pop up when you try to import your wsdl to SoapUI or something else perhaps like running it? Could you take a screenshot of this pop up? Could I also have you restart SoapUI, click on the error log on the bottom, import/run your wsdl file, then take a screenshot of the error that pops up please?

       

      Best,

      Calvin

    • richie's avatar
      richie
      Community Hero

      Hi,

       

      The first thing I do before I try importing a .wsdl is to check that it's wellformed and schema valid.  If the file is malformed xml or invalid, this will cause problems.

       

      I had a quick look (after Id removed those annoying emojis that automatically generate) and noticed 2 instances of you referencing elements to the ns1 namespace - but the namespace declarations immediately below the prolog dont include a namespace with the identifier ns1.

       

      Once I'd fixed that - I pointed them to the tns namespace as I think that's what they should be pointing at - I started finding more schema invalid issues.  Each one I tried fixing just lead onto another - I'm sorry - I don't know what your .wsdl is supposed to look like to fix all the issues I'm afraid

       

      You'll need to fix these before the .wsdl can be loaded into SoapUI - this is why you're getting the invalid wsdl error - the file is schema invalid.

       

      I suggest you go back to whoever supplied the .wsdl and ask them to try and validate it, then they'll see the various problems I found that will need to be fixed before this can successfully be loaded into SoapUI.

       

      Sorry I can't be more help,

       

      Cheers,

       

      richie