ifuwannaride
ifuwannaride

Reputation: 121

WSDL validation in Eclipse fails for namespace

I've made a WSDL file and I intend to create top down web service out of it. Unfortunately, Eclipse throws this error:

"A problem occurred while running the WSDL validator for namespace http://schemas.xmlsoap.org/wsdl/"

I've made some research and it looks like it's happening because of some Eclipse wsdl-validation bug, explained here

Some guy there claims that he fixed this error with patch, and I've applied it, but the error stays and I'm starting to think that there's some problem with my wsdl file itself.

WebService is supposed to take a list(column) of ID's and return a 2-column table data based on those ID's.

Can you help me find out what is wrong with it?

Eclipse Java EE IDE for Web Developers. Version: Mars.2 Release (4.5.2) Build id: 20160218-0600 WTP 1.2.1.20150819-2220

Here's WSDL file:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions 
  targetNamespace="reb.ecm.ws.RebUtilsService"
        xmlns="reb.ecm.ws.RebUtilsService"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
        xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">


    <wsdl:types>
      <xsd:complexType name='DPList'>
        <xsd:element
          minOccurs='0'
          maxOccurs='unbounded'
          name='DP'
          type='DP'/>
      </xsd:complexType>
      <xsd:complexType name='DP'>
        <xsd:all>
          <xsd:element
            minOccurs='0'
            maxOccurs='1'
            name='DPID'
            type='xsd:int'/>
        </xsd:all>
      </xsd:complexType>
      <xsd:complexType name='WSInfoList'>
        <xsd:element
          minOccurs='0'
          maxOccurs='unbounded'
          name='WSInfoItem'
          type='WSInfoItem'/>
      </xsd:complexType>
      <xsd:complexType name='WSInfoItem'>
        <xsd:all>
          <xsd:element
            minOccurs='0'
            maxOccurs='1'
            name='DPID'
            type='xsd:int'/>
        </xsd:all>
        <xsd:all>
          <xsd:element
            minOccurs='0'
            maxOccurs='1'
            name='WSID'
            type='xsd:int'/>
        </xsd:all>
      </xsd:complexType>
    </wsdl:types>

    <wsdl:message name="inMessage">
        <wsdl:part name="DPList" type="DPList" />
    </wsdl:message>

    <wsdl:message name="outMessage">
        <wsdl:part name="WSInfoList" type="WSInfoList" />
    </wsdl:message>
    <wsdl:portType name="RebUtilsServicePortType">
        <wsdl:operation name="GetActualWSIDbyDPID"  >
            <wsdl:input message="inMessage" />
            <wsdl:output message="outMessage" />
        </wsdl:operation>
                    </wsdl:portType>

    <wsdl:binding name="RebUtilsServiceHTTPBinding" 
            type="RebUtilsServicePortType">
        <wsdlsoap:binding style="document" 
            transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="GetActualWSIDbyDPID">
            <wsdlsoap:operation soapAction=""/>
             <wsdl:input>
                <wsdlsoap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <wsdlsoap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

    <wsdl:service name="RebUtilsServicePorts">
        <wsdl:port binding="RebUtilsServiceHTTPBinding"  name="RebUtilsService">
            <wsdlsoap:address 
                location="http://localhost:9084/RebUtilsService/RebUtilsServicePorts"/>
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>

UPDATE: There were no problem with Eclipse. At least patch, mentioned earlier fixed something.

Upvotes: 2

Views: 3105

Answers (1)

Praveen Kumar K S
Praveen Kumar K S

Reputation: 3074

Answer

  1. Your schema is not properly defined. Please see the below image. datatypeError
  2. Kindly change it to your corrected datatype element which is defined in your schema definitions, Please change in Eclipse WSDL Design view. correctedSchema
  3. Regenerate your client and let know the results.
  4. You should have seperate XSD schema files and should be mapped based on your requirement, that's why it is failing and please have a look into the exploded design view.schema mapping

General Rule

  1. While creating a SOAP Service, Please define your required input/output XSD schemas

  2. Using schema as in input you need to generate the WSDL file using your IDE/Maven/any build tool.

  3. For easier manipulations/Edits, please choose Eclipse WSDL Editor.

Upvotes: 2

Related Questions