As an example, let's put the calculatorServices class from the Apex SOAP Callouts Trailhead Unit on the table. Considering any of the inner classes, for instance doAdd:

public class doAdd {
    public Double arg0;
    public Double arg1;
    private String[] arg0_type_info = new String[]{'arg0','http://calculator.services/',null,'0','1','false'};
    private String[] arg1_type_info = new String[]{'arg1','http://calculator.services/',null,'0','1','false'};
    private String[] apex_schema_type_info = new String[]{'http://calculator.services/','false','false'};
    private String[] field_order_type_info = new String[]{'arg0','arg1'};

There are always 3 types of type_info variables:

  • element-specific (arg0_type_info, arg1_type_info etc.)
  • apex_schema_type_info
  • field_order_type_info

All of these are described by elements of String arrays.


Does anyone know what's the description/names/meanings of each of these array elements? I couldn't find anything among SF documentation, SF blogs or other SO posts.

What I've got so far:

  • first array element in ELEMENT_type_info is basically its name
  • second array element in ELEMENT_type_info is either tns or targetNamespace
  • first array element in apex_schema_type_info is either tns or targetNamespace
  • field_order_type_info array's meaning is obvious

The reason behind my question is that due to WSDL2Apex generator limitations I'm forced to write my own Apex SOAP classes manually (inb4: yes, I saw FuseIT generator, it crashes for my WSDL). I have managed to write some basic (and working!) code already, but I'm not sure if leaving all these null, '0', '1', 'false' values is fine or I should change some of them due to things I'm just not aware of.

Any help appreciated, thanks :)


The details are fairly well covered in What are the parameters for the Salesforce WebServiceCallout.invoke method?

From Jeremy's answer:

If the variable represents another XML element or a text node, then there needs to be a matching _type_info String[] e.g. bar_type_info. The elements of this array are:

  1. XML element name
  2. Schema
  3. XML type
  4. minOccurs
  5. maxOccurs (set to '-1' for unbounded)
  6. isNillable

If in doubt, Salesforce made their version of WSDL2Apex open source, so you can see how it is setting the array elements.

private String typeInfo(Element element) {
    String elemNs =
            element.getRef() == null ? element.getSchema().getTargetNamespace() : element.getRef()

    StringBuilder sb = new StringBuilder();
    sb.append("new String[]{");
    sb.append(",").append("null"); // Was the element's type, no longer used.
    return sb.toString();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.