2

I have a situation where I need to include a basic type with a value in the SOAP Header.

The class generated with Fuse IT Explorer. Class:

public class Action_element {
    public String Action;
    private String[] Action_type_info = new String[]{'Action','http://schemas.xmlsoap.org/ws/2004/08/addressing','xsd:string','-1','-1','false'};

    private String[] apex_schema_type_info = new String[]{'','true','true'};
    private String[] field_order_type_info = new String[]{'Action'};
}

Generated the following element in the Header:

<env:Header><m:Action xmlns:m="http://schemas.xmlsoap.org/ws/2004/08/addressing"><Action>urn:getSingleTicket</Action>

If I use the original class generated from WSDL:

public class Action_element {
    private String[] apex_schema_type_info = new String[]{'','true','true'};
    private String[] field_order_type_info = new String[]{''};
}

I get an empty action element.

Does anyone have a suggestion how to do this in order to get:

<env:Header><m:Action xmlns:m="http://schemas.xmlsoap.org/ws/2004/08/addressing">urn:getSingleTicket</m:Action>

I know the Header tag is not close here but this is deliberate in the actual request it is closed.

  • Is this possible at all? – zokito Nov 19 '15 at 12:09
  • Please help, anyone? – zokito Nov 19 '15 at 14:37
1

I don't believe it is possible using WebServiceCallout.invoke. It will always try and wrap the value in an element based on the *_type_info fields.

Since you already have our FuseIT SFDC Explorer product, try using the "SOAP and HTTP" option under Select Method Type on the step where you select the Apex methods to generate.

This will create the code required to use a HttpRequest, which will be easier for you to modify manually to get the header you want.

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.