facebook

Error when generating WS Client from WSDL

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #294829 Reply

    maestr0
    Member

    I’m trying to generate WS client for webservice which was created in MS .NET (what, in theory, is not supposed to be important ). WSDL file, you can see below, has been generated in .NET and it works well for .NET WS client and has been positively tested in SoapUI (good piece of software for testing WS). The webservice is also working well.

    When I’m trying to generate client for the webservice in MyEclipse 7.0 I’m getting an error which says

    src-resolve.4.2: Error resolving component ‘s:schema’. It was detected
    that ‘s:schema’ is in namespace ‘http://www.w3.org/2001/XMLSchema’, but components
    from this namespace are not referenceable from schema document
    ‘ivr.wsdl’.

    How to force WS java client generator to use this WSDL without any complains? .Net WS generator can cope with the wsdl file, so why MyEclipse can’t do it ? How can I modify the file to make it working ?

    
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="XXXYYYZZZ" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="XXXYYYZZZ" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
      <s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" />  
        <s:schema elementFormDefault="qualified" targetNamespace="XXXYYYZZZ">
          <s:element name="ustaw_komunikat">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="1" maxOccurs="1" name="lp" type="s:int" />
                <s:element minOccurs="1" maxOccurs="1" name="pozycja" type="s:int" />
                <s:element minOccurs="0" maxOccurs="1" name="uzytkownik" type="s:string" />
    
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="ustaw_komunikatResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ustaw_komunikatResult" type="s:string" />
              </s:sequence>
            </s:complexType>
    
          </s:element>
          <s:element name="lista_komunikatow">
            <s:complexType />
          </s:element>
          <s:element name="lista_komunikatowResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="lista_komunikatowResult">
                  <s:complexType>
                    <s:sequence>
                      <s:element ref="s:schema"/>
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
            </s:complexType>
          </s:element>
    
          <s:element name="lista_komunikatow_parametr">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="1" maxOccurs="1" name="pozycja" type="s:int" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="lista_komunikatow_parametrResponse">
            <s:complexType>
    
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="lista_komunikatow_parametrResult">
                  <s:complexType>
                    <s:sequence>
                      <s:element ref="s:schema" />
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
    
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="lista_pozycji">
            <s:complexType />
          </s:element>
          <s:element name="lista_pozycjiResponse">
            <s:complexType>
              <s:sequence>
    
                <s:element minOccurs="0" maxOccurs="1" name="lista_pozycjiResult">
                  <s:complexType>
                    <s:sequence>
                      <s:element ref="s:schema" />
                      <s:any />
                    </s:sequence>
                  </s:complexType>
                </s:element>
              </s:sequence>
    
            </s:complexType>
          </s:element>
        </s:schema>
      </wsdl:types>
      <wsdl:message name="ustaw_komunikatSoapIn">
        <wsdl:part name="parameters" element="tns:ustaw_komunikat" />
      </wsdl:message>
      <wsdl:message name="ustaw_komunikatSoapOut">
        <wsdl:part name="parameters" element="tns:ustaw_komunikatResponse" />
    
      </wsdl:message>
      <wsdl:message name="lista_komunikatowSoapIn">
        <wsdl:part name="parameters" element="tns:lista_komunikatow" />
      </wsdl:message>
      <wsdl:message name="lista_komunikatowSoapOut">
        <wsdl:part name="parameters" element="tns:lista_komunikatowResponse" />
      </wsdl:message>
      <wsdl:message name="lista_komunikatow_parametrSoapIn">
        <wsdl:part name="parameters" element="tns:lista_komunikatow_parametr" />
    
      </wsdl:message>
      <wsdl:message name="lista_komunikatow_parametrSoapOut">
        <wsdl:part name="parameters" element="tns:lista_komunikatow_parametrResponse" />
      </wsdl:message>
      <wsdl:message name="lista_pozycjiSoapIn">
        <wsdl:part name="parameters" element="tns:lista_pozycji" />
      </wsdl:message>
      <wsdl:message name="lista_pozycjiSoapOut">
        <wsdl:part name="parameters" element="tns:lista_pozycjiResponse" />
    
      </wsdl:message>
      <wsdl:portType name="ivrSoap">
        <wsdl:operation name="ustaw_komunikat">
          <wsdl:input message="tns:ustaw_komunikatSoapIn" />
          <wsdl:output message="tns:ustaw_komunikatSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="lista_komunikatow">
          <wsdl:input message="tns:lista_komunikatowSoapIn" />
          <wsdl:output message="tns:lista_komunikatowSoapOut" />
    
        </wsdl:operation>
        <wsdl:operation name="lista_komunikatow_parametr">
          <wsdl:input message="tns:lista_komunikatow_parametrSoapIn" />
          <wsdl:output message="tns:lista_komunikatow_parametrSoapOut" />
        </wsdl:operation>
        <wsdl:operation name="lista_pozycji">
          <wsdl:input message="tns:lista_pozycjiSoapIn" />
          <wsdl:output message="tns:lista_pozycjiSoapOut" />
        </wsdl:operation>
    
      </wsdl:portType>
      <wsdl:binding name="ivrSoap" type="tns:ivrSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="ustaw_komunikat">
          <soap:operation soapAction="XXXYYYZZZ/ustaw_komunikat" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
    
            <soap:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="lista_komunikatow">
          <soap:operation soapAction="XXXYYYZZZ/lista_komunikatow" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
    
            <soap:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="lista_komunikatow_parametr">
          <soap:operation soapAction="XXXYYYZZZ/lista_komunikatow_parametr" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
    
            <soap:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="lista_pozycji">
          <soap:operation soapAction="XXXYYYZZZ/lista_pozycji" 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="ivrSoap12" type="tns:ivrSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="ustaw_komunikat">
          <soap12:operation soapAction="XXXYYYZZZ/ustaw_komunikat" style="document" />
          <wsdl:input>
    
            <soap12:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="lista_komunikatow">
          <soap12:operation soapAction="XXXYYYZZZ/lista_komunikatow" style="document" />
          <wsdl:input>
    
            <soap12:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="lista_komunikatow_parametr">
          <soap12:operation soapAction="XXXYYYZZZ/lista_komunikatow_parametr" style="document" />
          <wsdl:input>
    
            <soap12:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="lista_pozycji">
          <soap12:operation soapAction="XXXYYYZZZ/lista_pozycji" 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="ivr">
        <wsdl:port name="ivrSoap" binding="tns:ivrSoap">
    
          <soap:address location="http://192.168.1.246/ws/ivr.asmx" />
        </wsdl:port>
        <wsdl:port name="ivrSoap12" binding="tns:ivrSoap12">
          <soap12:address location="http://192.168.1.246/ws/ivr.asmx" />
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    
    #294853 Reply

    Brian Fernandes
    Moderator

    maestr0,

    You need to move the import element such that it is a child of your schema element not a child of the <wsdl:types> element as it is now.
    Use:

    <s:schema elementFormDefault="qualified" targetNamespace="XXXYYYZZZ">
    <s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" /> 

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Error when generating WS Client from WSDL

You must be logged in to post in the forum log in