We have been working on an integration, wherein we imported the WSDL provided by middleware to get Information out of SAP. We are facing an issue there on multiple values which are sent by middleware but not recieved by Salesforce. Please check the screenshot of WSDL for more information.

enter image description here Middleware is sending 'contract price' with type as 'cpf:amountType' . If you check this type, it has an xsd:extension of double along with an attribute for currency which has type of String. When we import WSDL below patch is created from WSDLtoApex

public class amountType {
public String currency_x;
private String[] currency_x_att_info = new String[]{'currency'};
private String[] apex_schema_type_info = new String[]{'https://mwb2b.pb.com/CommonInterface/Contract-2.0','false','false'};
private String[] field_order_type_info = new String[]{};

So essentially MW is sending something as
< contractPrice currency="USD">84600.00< /contractPrice>
But there is no way to read the value 84600.00. Preliminary analysis tell that xsd:extension is not in list of supported tag for Salesforce.

  1. https://stackoverflow.com/questions/4413631/salesforce-wsdl-import-of-simplecontent-w-extension (Exactly our issue)
  2. Problem with wsdl2apex and namespaces in the the callout body
  3. https://developer.salesforce.com/forums/?id=906F000000091SrIAI

    Tried multiple workarounds but in vain. Any input on this will be helpful.
  • Is there any class generated with the name contractHeaderType as inner class? If so, does it have variable contractprice of type amountType inner class? Jul 8, 2015 at 9:55
  • its yes to both. Jul 9, 2015 at 6:38

1 Answer 1


You are correct that the native version of Wsdl2Apex doesn't support xsd:extension. See Wsdl2Apex - Supported WSDL Features

I've built my own (free) tool at work called the FuseIT SFDC Explorer. It has a component that provides an alternative implementation of Wsdl2Apex. Part of this is improved support for xsd:extension. In most of that cases I've tests this has been around one complex type extending another complex type.

If you don't care about the currency attribute you could probably massage the WSDL so that only the amountType element is read as a double.

Basically you would replace any references to the cpf:amountType type with type="xsd:double".

If that doesn't work, are you able to share the complete WSDL? (Feel free to obscure the endpoint URL).

  • Sounds good. But still the main issue is this happens with multiple fields, I just mentioned one 'ContractPrice' so I have to care about the attribute for other fields atleast if not this one.let me try this out and come back again. Jul 9, 2015 at 6:37

You must log in to answer this question.

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