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
michelle emanuel 59michelle emanuel 59 

Generating Code from WSDL


Error: Failed to parse wsdl: Parse error: Found invalid XML. could not determine namespace bound to element prefix wsdl (position: START_DOCUMENT seen ... name="ParksImplService" targetNamespace="http://parks.services/">... @1:83)

From the trailhed I copy and pasted the code into an xml file verified that there were no extra characters and when I attempted to generate the code I go this error.
<wsdl:definitions name="ParksImplService" targetNamespace="http://parks.services/">
	<wsdl:types>
		<xs:schema elementFormDefault="unqualified" targetNamespace="http://parks.services/" version="1.0">
			<xs:element name="byCountry" type="tns:byCountry"/>
			<xs:element name="byCountryResponse" type="tns:byCountryResponse"/>
			<xs:complexType name="byCountry">
				<xs:sequence>
					<xs:element minOccurs="0" name="arg0" type="xs:string"/>
				</xs:sequence>
			</xs:complexType>
			<xs:complexType name="byCountryResponse">
				<xs:sequence>
					<xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="xs:string"/>
				</xs:sequence>
			</xs:complexType>
		</xs:schema>
	</wsdl:types>
	<wsdl:message name="byCountry">
		<wsdl:part element="tns:byCountry" name="parameters">
		</wsdl:part>
	</wsdl:message>
	<wsdl:message name="byCountryResponse">
		<wsdl:part element="tns:byCountryResponse" name="parameters">
		</wsdl:part>
	</wsdl:message>
	<wsdl:portType name="Parks">
		<wsdl:operation name="byCountry">
			<wsdl:input message="tns:byCountry" name="byCountry">
			</wsdl:input>
			<wsdl:output message="tns:byCountryResponse" name="byCountryResponse">
			</wsdl:output>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="ParksImplServiceSoapBinding" type="tns:Parks">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="byCountry">
			<soap:operation soapAction="" style="document"/>
			<wsdl:input name="byCountry">
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output name="byCountryResponse">
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="ParksImplService">
		<wsdl:port binding="tns:ParksImplServiceSoapBinding" name="ParksImplPort">
			<soap:address location="https://th-apex-soap-service.herokuapp.com/service/parks"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

 
Thierry JORANDThierry JORAND
Did you include the xml header <?xml version='1.0' encoding='UTF-8'?> in the xml file ?
michelle emanuel 59michelle emanuel 59
Yes still the same answer 'Error: Failed to parse wsdl: Parse error: Found invalid XML. could not determine namespace bound to element prefix wsdl (position: START_DOCUMENT seen ... name="ParksImplService" targetNamespace="http://parks.services/">... @2:84)". An XML declaration is not required in all XML documents and is usually not required especially if it is UTF-8. However, I did try it and it did not make a difference as I suspected.  thank you for the suggestion. I found this with both the exercise and the examples.