In a callout, I expect a response like this :

enter image description here

Why when I generate this part of the wsdl :img of wsdl

In the generated apex class, it doesn't give me the reference of the ResultResponse in the CompleteOfferResponse? : img of generated apex class

The issue being that the callout should receive the result response in the CompleteOfferResponse and I'm not able to translate that into the apex. Can I hardcode the reference maybe ?

Also, (almost) same topic, does anyone know how to remove the xsi:nil="true" in the soap request without passing a value ? Example

<Box xsi:nil="true"/> should become <Box/>

That sounds strange but I need it to comply with the wsdl validation.

  • Please try to stick to one question per question.
    – Adrian Larson
    Feb 6 '18 at 13:41

The problem is the xs:extension in the WSDL and the lack of support for it from the native version of WSDL2Apex.

You could try and manually modify the generated CompleteOfferResponse class to include the arributes from the ResultResponse class. It would mostly be a copy and paste job except for the apex_schema_type_info and field_order_type_info.

Another option would be to take the manual process you performed and automate it in the open source version of WSDL2Apex.

Alternatively, you could try the FuseIT version of WSDL2Apex (Disclaimer: this is a free tool from my current employer). In this version I've automated the process for handling complex type extensions in a way that is supported by WebServiceCallout.invoke

  • 1
    I already tried with FuseIt SFDC Explorer, I had an error message from it. I'll check if I can pm you the wsdl so you can see it. Thanks for the solutions, the first one did the trick. Although it means that we have to change it manually if ever the wsdl should change from the other side. Feb 7 '18 at 9:25
  • Glad to hear you got it working. It is a pain to apply the fix manually, which is why I tried to automate the process. If you use the support links from the app to submit the WSDL it should reach me. Feb 7 '18 at 18:41

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.