1

I would like to generate apex classes for this WSDL:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://ipg-online.com/ipgapi/schemas/ipgapi" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ipg-online.com/ipgapi/schemas/ipgapi" targetNamespace="http://ipg-online.com/ipgapi/schemas/ipgapi">
<wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:a1="http://ipg-online.com/ipgapi/schemas/a1" xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi" xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1" elementFormDefault="qualified" targetNamespace="http://ipg-online.com/ipgapi/schemas/ipgapi">
<xs:import xmlns:xs="http://www.w3.org/2001/XMLSchema" namespace="http://ipg-online.com/ipgapi/schemas/v1" schemaLocation="../schemas/v1.xsd"/>
<xs:import xmlns:xs="http://www.w3.org/2001/XMLSchema" namespace="http://ipg-online.com/ipgapi/schemas/a1" schemaLocation="../schemas/a1.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrderResponse">
<wsdl:part xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" element="tns:IPGApiOrderResponse" name="IPGApiOrderResponse"/>
</wsdl:message>
<wsdl:message xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiActionRequest">
<wsdl:part xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" element="tns:IPGApiActionRequest" name="IPGApiActionRequest"/>
</wsdl:message>
<wsdl:message xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrderRequest">
<wsdl:part xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" element="tns:IPGApiOrderRequest" name="IPGApiOrderRequest"/>
</wsdl:message>
<wsdl:message xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiActionResponse">
<wsdl:part xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" element="tns:IPGApiActionResponse" name="IPGApiActionResponse"/>
</wsdl:message>
<wsdl:portType xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrder">
<wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrder">
<wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" message="tns:IPGApiOrderRequest" name="IPGApiOrderRequest"/>
<wsdl:output xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" message="tns:IPGApiOrderResponse" name="IPGApiOrderResponse"/>
</wsdl:operation>
<wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiAction">
<wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" message="tns:IPGApiActionRequest" name="IPGApiActionRequest"/>
<wsdl:output xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" message="tns:IPGApiActionResponse" name="IPGApiActionResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrderSoap11" type="tns:IPGApiOrder">
<soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrder">
<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction=""/>
<wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrderRequest">
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</wsdl:input>
<wsdl:output xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrderResponse">
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiAction">
<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction=""/>
<wsdl:input xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiActionRequest">
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</wsdl:input>
<wsdl:output xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiActionResponse">
<soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="IPGApiOrderService">
<wsdl:port xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" binding="tns:IPGApiOrderSoap11" name="IPGApiOrderSoap11">
<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="https://test.ipg-online.com:443/ipgapi/services"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

But I get this error message:

Jan 08, 2019 5:37:04 PM com.salesforce.ide.wsdl2apex.core.WSDL2Apex doParse SEVERE: Failed to parse wsdl: Found schema import from location ../schemas/v1.xsd. External schema import not supported

Exception in thread "main" java.lang.RuntimeException: Failed to parse wsdl: Found schema import from location ../schemas/v1.xsd. External schema import not supported

at com.salesforce.ide.wsdl2apex.core.WSDL2Apex.doParse(WSDL2Apex.java:314)
at com.salesforce.ide.wsdl2apex.core.WSDL2Apex.parseAndGenerate(WSDL2Apex.java:408)
at com.salesforce.ide.wsdl2apex.core.WSDL2ApexGenerator.main(WSDL2ApexGenerator.java:16)

I get the same message when I use FuseIT WSDL2Apex.

Is it possible to generate the WSDL?

Or should I handcode the XML and use Http?

3

1 Answer 1

1

This is a particularly difficult WSDL to process directly from Apex. Not only does it include schema imports, it also includes:

  1. multiple xs:group elements
  2. xs:extension elements
  3. xsd:choice elements
  4. elements with no defined type. See GetLastResult within InitiateClearing in a1.xsd.
  5. imports importing further schema, including circular references.

I pulled the WSDL and imported xsd's down to my local machine and redid the schemaLocations to match my local file structure.

I then manually expanded the xs:group reference elements out with the sequence elements from the groups. Ideally in the future this would be automated, but it requires compiling the schema in .NET, which won't allow for any errors.

Beyond that I relied on the FuseIT SFDC Explorer tooling to handle the other challenges.

The output was far to big to include directly in this answer, so I bundled it into a GIST - https://gist.github.com/FishOfPrey/28bfab8c50664b582f60336486f67bc5

There are still further problems to refine.

For instance, in the ipgOnlineComIpgapiSchemasA1 class the ClientLocale_Element is incorrectly being resolved to the same class, rather than ipgOnlineComIpgapiSchemasV1.

1
  • holy moly! the code generated was epic! thanks for doing that.
    – Robs
    Jan 9, 2019 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .