+ Start a Discussion
mikefmikef 

WSDL to Apex Parsing error

Hi I am trying to parse a very simple web service and getting this error:

Error: Failed to parse wsdl: Unable to find schema for element; {http://www.w3.org/2001/XMLSchema}schema

 

Here is the wsdl:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:import namespace="http://www.w3.org/2001/XMLSchema" />
      <s:element name="GetQuery">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="DEA" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="BAC" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="BASC" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="ExpirationDate" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="Company" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="Zip" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="MaxRows" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="GetQueryResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetQueryResult">
              <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="DataSet" nillable="true">
        <s:complexType>
          <s:sequence>
            <s:element ref="s:schema" />
            <s:any />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="GetQuerySoapIn">
    <wsdl:part name="parameters" element="tns:GetQuery" />
  </wsdl:message>
  <wsdl:message name="GetQuerySoapOut">
    <wsdl:part name="parameters" element="tns:GetQueryResponse" />
  </wsdl:message>
  <wsdl:message name="GetQueryHttpGetIn">
    <wsdl:part name="UserName" type="s:string" />
    <wsdl:part name="Password" type="s:string" />
    <wsdl:part name="DEA" type="s:string" />
    <wsdl:part name="BAC" type="s:string" />
    <wsdl:part name="BASC" type="s:string" />
    <wsdl:part name="ExpirationDate" type="s:string" />
    <wsdl:part name="Company" type="s:string" />
    <wsdl:part name="Zip" type="s:string" />
    <wsdl:part name="State" type="s:string" />
    <wsdl:part name="MaxRows" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetQueryHttpGetOut">
    <wsdl:part name="Body" element="tns:DataSet" />
  </wsdl:message>
  <wsdl:message name="GetQueryHttpPostIn">
    <wsdl:part name="UserName" type="s:string" />
    <wsdl:part name="Password" type="s:string" />
    <wsdl:part name="DEA" type="s:string" />
    <wsdl:part name="BAC" type="s:string" />
    <wsdl:part name="BASC" type="s:string" />
    <wsdl:part name="ExpirationDate" type="s:string" />
    <wsdl:part name="Company" type="s:string" />
    <wsdl:part name="Zip" type="s:string" />
    <wsdl:part name="State" type="s:string" />
    <wsdl:part name="MaxRows" type="s:string" />
  </wsdl:message>
  <wsdl:message name="GetQueryHttpPostOut">
    <wsdl:part name="Body" element="tns:DataSet" />
  </wsdl:message>
  <wsdl:portType name="DEAWebsvcClassSoap">
    <wsdl:operation name="GetQuery">
      <wsdl:input message="tns:GetQuerySoapIn" />
      <wsdl:output message="tns:GetQuerySoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:portType name="DEAWebsvcClassHttpGet">
    <wsdl:operation name="GetQuery">
      <wsdl:input message="tns:GetQueryHttpGetIn" />
      <wsdl:output message="tns:GetQueryHttpGetOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:portType name="DEAWebsvcClassHttpPost">
    <wsdl:operation name="GetQuery">
      <wsdl:input message="tns:GetQueryHttpPostIn" />
      <wsdl:output message="tns:GetQueryHttpPostOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="DEAWebsvcClassSoap" type="tns:DEAWebsvcClassSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <wsdl:operation name="GetQuery">
      <soap:operation soapAction="http://tempuri.org/GetQuery" 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="DEAWebsvcClassHttpGet" type="tns:DEAWebsvcClassHttpGet">
    <http:binding verb="GET" />
    <wsdl:operation name="GetQuery">
      <http:operation location="/GetQuery" />
      <wsdl:input>
        <http:urlEncoded />
      </wsdl:input>
      <wsdl:output>
        <mime:mimeXml part="Body" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="DEAWebsvcClassHttpPost" type="tns:DEAWebsvcClassHttpPost">
    <http:binding verb="POST" />
    <wsdl:operation name="GetQuery">
      <http:operation location="/GetQuery" />
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded" />
      </wsdl:input>
      <wsdl:output>
        <mime:mimeXml part="Body" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="DEAWebsvcClass">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    <wsdl:port name="DEAWebsvcClassSoap" binding="tns:DEAWebsvcClassSoap">
      <soap:address location="http://www.deanumber.com/Websvc/deaWebsvc.asmx" />
    </wsdl:port>
    <wsdl:port name="DEAWebsvcClassHttpGet" binding="tns:DEAWebsvcClassHttpGet">
      <http:address location="http://www.deanumber.com/Websvc/deaWebsvc.asmx" />
    </wsdl:port>
    <wsdl:port name="DEAWebsvcClassHttpPost" binding="tns:DEAWebsvcClassHttpPost">
      <http:address location="http://www.deanumber.com/Websvc/deaWebsvc.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

 I found this post. And simple type is not supported, so this wsdl uses complexType, could that be the issue?

 

Thanks.


 

paul-lmipaul-lmi

not sure about the error, but WSDL2Apex does support complex type.  the webservice we integrate with uses it.

mikefmikef

So what was your work around if the WSDL uses Complex Type?