function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
micchrismicchris 

"Failed to parse wsdl:target Name space not specified in wsdl:definitions" with workaround

I received "Failed to parse wsdl:target Name space not specified in wsdl:definitions" error when attempting to generate Apex from a WSDL. The WSDL definitions tag looked fine:

 

<wsdl:definitions
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://myserver.com/salesforce/CreditAuthorizationService"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://myserver.com/salesforce/CreditAuthorizationService">

 

However, only by making this little change – moving the first attribute to the first attribute to the same line as the tag start – the parser accepted the WSDL:

 

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://myserver.com/salesforce/CreditAuthorizationService"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://myserver.com/salesforce/CreditAuthorizationService">