+ Start a Discussion
NewportNewport 

Error: Failed to parse wsdl: Unable to find element for ...

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

I'm getting the above error when trying generate New Apex Code from WSDL.

Without me publishing my entire WSDL... any idea what could cause this? I've been fiddling with my WSDL for hours trying to make it work...

Can't find the answer here or anywhere.

Thanks!
KevinPKevinP
Not all wsdl's are supported.Short of seeing the entire wsdl we'll be unable to help.
NewportNewport
Just tried to post it... answer cannot have more than 32,000 characters... or something like that. Can I post it some other way?
KevinPKevinP
Try gist.github.com --  Kevin Poorman Sent with Airmail
NewportNewport
Never used that before. Am I supposed to post the URL like this?

https://gist.github.com/221df65009580e381d79.git

Hmmm... I guess that takes you nowhere, doesn't it? Well I pasted it in there and got a "Gist", then copied the URL from the side of the page there. Oh man, can you please tell me what I'm doing wrong with github?
NewportNewport
Well, if it's not too much trouble, maybe you could send an email to me? I can email it to you?... or anyone else who wants to help...

transcendentalfeeling@yahoo.com
NewportNewport
OK. So now I've pared the WSDL way down... and I'm getting a different error: Failed to parse wsdl: Unsupported Schema element found http://schemas.xmlsoap.org/wsdl/:message. At: 56:51

I'll try to paste the WSDL right here...

<wsdl:definitions 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://tempuri.org/"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:s1="http://microsoft.com/wsdl/types/"
                  xmlns:s="http://www.w3.org/2001/XMLSchema"
                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  targetNamespace="http://tempuri.org/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:import namespace="http://microsoft.com/wsdl/types/"/>
     
      <s:element name="SetUserAccountExpiration">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="userToken" type="s:string"/>
            <s:element minOccurs="0" maxOccurs="1" name="loginId" type="s:string"/>
            <s:element minOccurs="1" maxOccurs="1" name="accountExpiration" nillable="true" type="s:dateTime"/>
            <s:element minOccurs="0" maxOccurs="1" name="updatedBy" type="s:string"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="SetUserAccountExpirationResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="SetUserAccountExpirationResult" type="s:string"/>
          </s:sequence>
        </s:complexType>
      </s:element>
     
    </s:schema>
  </wsdl:types>
 
  <wsdl:message name="SetUserAccountExpirationSoapIn">
    <wsdl:part name="parameters" element="tns:SetUserAccountExpiration"/>
  </wsdl:message>
  <wsdl:message name="SetUserAccountExpirationSoapOut">
    <wsdl:part name="parameters" element="tns:SetUserAccountExpirationResponse"/>
  </wsdl:message>
 
 
  <wsdl:portType name="wsAdvisysConnectorSoap">
    <wsdl:operation name="SetUserAccountExpiration">
      <wsdl:input message="tns:SetUserAccountExpirationSoapIn"/>
      <wsdl:output message="tns:SetUserAccountExpirationSoapOut"/>
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="wsAdvisysConnectorSoap" type="tns:wsAdvisysConnectorSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
   
    <wsdl:operation name="SetUserAccountExpiration">
      <soap:operation soapAction="http://tempuri.org/SetUserAccountExpiration" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>   
  </wsdl:binding>
 
  <wsdl:service name="wsAdvisysConnector">
    <wsdl:port name="wsAdvisysConnectorSoap" binding="tns:wsAdvisysConnectorSoap">
      <soap:address location="https://stagingservice.echowealth.com/ws/wsAdvisysConnector.asmx"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
NewportNewport
...OK, for anyone else struggling with such a problem, the problem there, was that I had a couple of unclosed tags, which apparently caused the parser to thing that a <wsdl:message> tag was within an <s:schema> tag when it shouldn't have been.

So, I added
</s:schema>  
  </wsdl:types>
in the appropriate place (before the <wsdl:message> tag and am now on to a new error: "Failed to parse wsdl: Unknown element: operation"


NewportNewport
So, basically, made sure that all the tags were closed, and had to make sure there was only one port type, and my WSDL worked!