+ Start a Discussion
SFDCAdmin73SFDCAdmin73 

Parsing failed when I tried to generate an Apex Class from WSDL file - Need Help

The parsing failed when I tried to generate an Apex Class from WSDL file. 
 
This is the error that I received - External schema import not supported.
 
Based on what I am reading in the forum, I need to do the following:
 
1. Inside <wsdl:types> (below the last <schema>) paste each referenced .xsd file content. Paste only <schema></schema>
2. Once all schemas are in the WSDL then comment all <xsd:import> using <!-- -->. They are no longer needed.
3. Please save changes and send back to me.

I am not the one who created the XML file and not sure how to update it with the instructions listed above? I apreciate any help!

Thanks!
 
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
     name="SerialInquiry"
     targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/QLogicConsolidatedApplication/QLSerialInquiryService/SerialInquiry"
     xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/http/QLogicConsolidatedApplication/QLSerialInquiryService/SerialInquiry"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:msg_in_out="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
    <wsdl:documentation>
        <abstractWSDL>https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService!1.0/SerialInquiry.wsdl</abstractWSDL>
    </wsdl:documentation>
    <plt:partnerLinkType name="Request_Response_plt">
        <plt:role name="Request-Response_role">
            <plt:portType name="tns:Request_Response_ptt"/>
        </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
                 schemaLocation="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry?XSD=xsd/QLSerialInquiryServiceSchema.xsd"/>
        </schema>
    </wsdl:types>
    <wsdl:message name="SerialInquiryRequest_msg_in">
        <wsdl:part name="SerialInquiryRequest" element="msg_in_out:SerialInquiryRequest"/>
    </wsdl:message>
    <wsdl:message name="SerialInquiryResponse_msg_out">
        <wsdl:part name="SerialInquiryResponse" element="msg_in_out:SerialInquiryResponse"/>
    </wsdl:message>
    <wsdl:portType name="Request_Response_ptt">
        <wsdl:operation name="Request-Response">
            <wsdl:input message="tns:SerialInquiryRequest_msg_in"/>
            <wsdl:output message="tns:SerialInquiryResponse_msg_out"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Request_Response_pttBinding" type="tns:Request_Response_ptt">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="Request-Response">
            <soap:operation style="document" soapAction="Request-Response"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="Request_Response_ptHttpPOST" type="tns:Request_Response_ptt">
        <http:binding xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" verb="POST"/>
        <wsdl:operation name="Request-Response">
            <http:operation xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" location=""/>
            <wsdl:input>
                <mime:content xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" type="text/xml"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" type="text/xml"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SerialInquiry">
        <wsdl:port name="Request_Response_pt" binding="tns:Request_Response_ptHttpPOST">
            <http:address xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" location="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry"/>
        </wsdl:port>
        <wsdl:port name="Request_Response_pt_soappt" binding="tns:Request_Response_pttBinding">
            <soap:address location="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

 
Best Answer chosen by SFDCAdmin73
Martijn SchwarzerMartijn Schwarzer
Hi SFDCAdmin73,

If you combine the two files, you get the following WSDL:
 
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
     name="SerialInquiry"
     targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/QLogicConsolidatedApplication/QLSerialInquiryService/SerialInquiry"
     xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/http/QLogicConsolidatedApplication/QLSerialInquiryService/SerialInquiry"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:msg_in_out="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
	<wsdl:documentation>
		<abstractWSDL>https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService!1.0/SerialInquiry.wsdl</abstractWSDL>
	</wsdl:documentation>
	<plt:partnerLinkType name="Request_Response_plt">
		<plt:role name="Request-Response_role">
			<plt:portType name="tns:Request_Response_ptt"/>
		</plt:role>
	</plt:partnerLinkType>
	<wsdl:types>
		<schema xmlns="http://www.w3.org/2001/XMLSchema"
			xmlns:tns="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
			targetNamespace="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
			elementFormDefault="qualified">
			<element name="SerialInquiryRequest">
				<complexType>
					<sequence>
						<element name="serialNumber" type="string"/>
					</sequence>
				</complexType>
			</element>
			<element name="SerialInquiryResponse">
				<complexType>
					<sequence>
						<element name="SerialNumber" type="string"/>
						<element name="ItemNumber" type="string"/>
						<element name="Description" type="string"/>
						<element name="InstallationInfo" minOccurs="0" maxOccurs="unbounded">
							<complexType>
								<sequence>
									<element name="ItemDescription" type="string"/>
									<element name="ItemNumber" type="string"/>
									<element name="SerialNumber" type="string"/>
									<element name="Status" type="string"/>
									<element name="Quantity" type="string"/>
									<element name="StartDate" type="string"/>
									<element name="OwnerPartyName" type="string"/>
								</sequence>
							</complexType>
						</element>
						<element name="Contracts" minOccurs="0" maxOccurs="unbounded">
							<complexType>
								<sequence>
									<element name="ContractNumber" type="string"/>
									<element name="CoverageName" type="string"/>
									<element name="CoverageDescription" type="string"/>
									<element name="ServiceName" type="string"/>
									<element name="ServiceDescription" type="string"/>
									<element name="Warranty" type="string"/>
									<element name="Status" type="string"/>
									<element name="StartDate" type="string"/>
									<element name="EndDate" type="string"/>
									<element name="TerminationDate" type="string"/>
								</sequence>
							</complexType>
						</element>
					</sequence>
				</complexType>
			</element>
		</schema>
	</wsdl:types>
	<wsdl:message name="SerialInquiryRequest_msg_in">
		<wsdl:part name="SerialInquiryRequest" element="msg_in_out:SerialInquiryRequest"/>
	</wsdl:message>
	<wsdl:message name="SerialInquiryResponse_msg_out">
		<wsdl:part name="SerialInquiryResponse" element="msg_in_out:SerialInquiryResponse"/>
	</wsdl:message>
	<wsdl:portType name="Request_Response_ptt">
		<wsdl:operation name="Request-Response">
			<wsdl:input message="tns:SerialInquiryRequest_msg_in"/>
			<wsdl:output message="tns:SerialInquiryResponse_msg_out"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="Request_Response_pttBinding" type="tns:Request_Response_ptt">
		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="Request-Response">
			<soap:operation style="document" soapAction="Request-Response"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:binding name="Request_Response_ptHttpPOST" type="tns:Request_Response_ptt">
		<http:binding xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" verb="POST"/>
		<wsdl:operation name="Request-Response">
			<http:operation xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" location=""/>
			<wsdl:input>
				<mime:content xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" type="text/xml"/>
			</wsdl:input>
			<wsdl:output>
				<mime:content xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" type="text/xml"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="SerialInquiry">
		<wsdl:port name="Request_Response_pt" binding="tns:Request_Response_ptHttpPOST">
			<http:address xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" location="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry"/>
		</wsdl:port>
		<wsdl:port name="Request_Response_pt_soappt" binding="tns:Request_Response_pttBinding">
			<soap:address location="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

However, this will still not parse, since there are 2 wsdl:binding tags, where only 1 is allowed if you generate the apex code from the WSDL.

I would advise you to contact your IT person again, and ask him if it's possible to get a WSDL with only 1 binding. Then you can parse the WSDL in Salesforce.

An other option would be to use SoapUI or a similar tool to generate the web service requests. If you use that as a template for your code, you can call the web services from Apex.

Good luck!

Best regards,
Martijn Schwärzer
 

All Answers

Martijn SchwarzerMartijn Schwarzer
Hi Admin73,

Your WSDL consists of multiple parts. One part is referenced with the "import" tag. It exists on the following link:

https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry?XSD=xsd/QLSerialInquiryServiceSchema.xsd

If you can download that xsd and post it here, we can help you further. That URL is not accessible by me, so I need your help to help you.

Thanks!

Martijn Schwärzer
SFDCAdmin73SFDCAdmin73
Hi Martijn,

Thank you so much for responding to my post. I am not able to access it either. I reached out to my IT person who created the file. This is what they sent me. Is this what you are looking for?
 
<?xml version="1.0" encoding="windows-1252" ?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:tns="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
        targetNamespace="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
        elementFormDefault="qualified">
  <element name="SerialInquiryRequest">
    <complexType>
      <sequence>
        <element name="serialNumber" type="string"/>
      </sequence>
    </complexType>
  </element>
  <element name="SerialInquiryResponse">
    <complexType>
      <sequence>
        <element name="SerialNumber" type="string"/>
        <element name="ItemNumber" type="string"/>
        <element name="Description" type="string"/>
        <element name="InstallationInfo" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <element name="ItemDescription" type="string"/>
              <element name="ItemNumber" type="string"/>
              <element name="SerialNumber" type="string"/>
              <element name="Status" type="string"/>
              <element name="Quantity" type="string"/>
              <element name="StartDate" type="string"/>
              <element name="OwnerPartyName" type="string"/>
            </sequence>
          </complexType>
        </element>
        <element name="Contracts" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <element name="ContractNumber" type="string"/>
              <element name="CoverageName" type="string"/>
              <element name="CoverageDescription" type="string"/>
              <element name="ServiceName" type="string"/>
              <element name="ServiceDescription" type="string"/>
              <element name="Warranty" type="string"/>
              <element name="Status" type="string"/>
              <element name="StartDate" type="string"/>
              <element name="EndDate" type="string"/>
              <element name="TerminationDate" type="string"/>
            </sequence>
          </complexType>
        </element>
      </sequence>
    </complexType>
  </element>
</schema>





Thanks!
SFDCAdmin73
SFDCAdmin73SFDCAdmin73
Can anyone help with this?
Martijn SchwarzerMartijn Schwarzer
Hi SFDCAdmin73,

If you combine the two files, you get the following WSDL:
 
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions
     name="SerialInquiry"
     targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/QLogicConsolidatedApplication/QLSerialInquiryService/SerialInquiry"
     xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/http/QLogicConsolidatedApplication/QLSerialInquiryService/SerialInquiry"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:msg_in_out="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
	<wsdl:documentation>
		<abstractWSDL>https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService!1.0/SerialInquiry.wsdl</abstractWSDL>
	</wsdl:documentation>
	<plt:partnerLinkType name="Request_Response_plt">
		<plt:role name="Request-Response_role">
			<plt:portType name="tns:Request_Response_ptt"/>
		</plt:role>
	</plt:partnerLinkType>
	<wsdl:types>
		<schema xmlns="http://www.w3.org/2001/XMLSchema"
			xmlns:tns="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
			targetNamespace="http://www.qlogic.com/soaintegrations/Oracle/xsd/QLSerialInquiryServiceSchema"
			elementFormDefault="qualified">
			<element name="SerialInquiryRequest">
				<complexType>
					<sequence>
						<element name="serialNumber" type="string"/>
					</sequence>
				</complexType>
			</element>
			<element name="SerialInquiryResponse">
				<complexType>
					<sequence>
						<element name="SerialNumber" type="string"/>
						<element name="ItemNumber" type="string"/>
						<element name="Description" type="string"/>
						<element name="InstallationInfo" minOccurs="0" maxOccurs="unbounded">
							<complexType>
								<sequence>
									<element name="ItemDescription" type="string"/>
									<element name="ItemNumber" type="string"/>
									<element name="SerialNumber" type="string"/>
									<element name="Status" type="string"/>
									<element name="Quantity" type="string"/>
									<element name="StartDate" type="string"/>
									<element name="OwnerPartyName" type="string"/>
								</sequence>
							</complexType>
						</element>
						<element name="Contracts" minOccurs="0" maxOccurs="unbounded">
							<complexType>
								<sequence>
									<element name="ContractNumber" type="string"/>
									<element name="CoverageName" type="string"/>
									<element name="CoverageDescription" type="string"/>
									<element name="ServiceName" type="string"/>
									<element name="ServiceDescription" type="string"/>
									<element name="Warranty" type="string"/>
									<element name="Status" type="string"/>
									<element name="StartDate" type="string"/>
									<element name="EndDate" type="string"/>
									<element name="TerminationDate" type="string"/>
								</sequence>
							</complexType>
						</element>
					</sequence>
				</complexType>
			</element>
		</schema>
	</wsdl:types>
	<wsdl:message name="SerialInquiryRequest_msg_in">
		<wsdl:part name="SerialInquiryRequest" element="msg_in_out:SerialInquiryRequest"/>
	</wsdl:message>
	<wsdl:message name="SerialInquiryResponse_msg_out">
		<wsdl:part name="SerialInquiryResponse" element="msg_in_out:SerialInquiryResponse"/>
	</wsdl:message>
	<wsdl:portType name="Request_Response_ptt">
		<wsdl:operation name="Request-Response">
			<wsdl:input message="tns:SerialInquiryRequest_msg_in"/>
			<wsdl:output message="tns:SerialInquiryResponse_msg_out"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="Request_Response_pttBinding" type="tns:Request_Response_ptt">
		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="Request-Response">
			<soap:operation style="document" soapAction="Request-Response"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:binding name="Request_Response_ptHttpPOST" type="tns:Request_Response_ptt">
		<http:binding xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" verb="POST"/>
		<wsdl:operation name="Request-Response">
			<http:operation xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" location=""/>
			<wsdl:input>
				<mime:content xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" type="text/xml"/>
			</wsdl:input>
			<wsdl:output>
				<mime:content xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" type="text/xml"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="SerialInquiry">
		<wsdl:port name="Request_Response_pt" binding="tns:Request_Response_ptHttpPOST">
			<http:address xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" location="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry"/>
		</wsdl:port>
		<wsdl:port name="Request_Response_pt_soappt" binding="tns:Request_Response_pttBinding">
			<soap:address location="https://fmwtest.qlc.com:8080/soa-infra/services/default/QLSerialInquiryService/SerialInquiry"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

However, this will still not parse, since there are 2 wsdl:binding tags, where only 1 is allowed if you generate the apex code from the WSDL.

I would advise you to contact your IT person again, and ask him if it's possible to get a WSDL with only 1 binding. Then you can parse the WSDL in Salesforce.

An other option would be to use SoapUI or a similar tool to generate the web service requests. If you use that as a template for your code, you can call the web services from Apex.

Good luck!

Best regards,
Martijn Schwärzer
 
This was selected as the best answer
SFDCAdmin73SFDCAdmin73
Thank you so much for the help! I really appreciate it!!

Thank you!
SFAdmin73