You need to sign in to do that
Don't have an account?
Eyal Pinkas
apex class generate from WSDL breaks on the slightest change of WSDL
I wrote an integration with a 3rd party vendor, in apex.
The 3rd party vendor supplies me with a WSDL, which I use to generate apex classes ("generate from WSDL" button in "apex class").
I use the generated class to call the 3rd party web-service. It works perfect.
In practice, the code eventually calls "WebServiceCallout.invoke()".
Here's the problem -
Every now and then, the 3rd party vendor adds a field to one of their response objects. When that happens - my integration with them breaks.
I get a message like this:
"System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element CardName"
Now, I don't care at all about their new field ("CardName" in this case) - I'm happy to ignore it!
But WebServiceCallout.invoke() won't ignore it. It fails the entire flow over that unfamiliar field.
The consequence is that every time this happens, I need to update the WSDL (which is easy), and then replay all the the flows that failed, and there may be hundreds of them.
I've tried to search for a way to make WebServiceCallout.invoke() more lenient, but couldn't find anything useful.
The 3rd party vendor supplies me with a WSDL, which I use to generate apex classes ("generate from WSDL" button in "apex class").
I use the generated class to call the 3rd party web-service. It works perfect.
In practice, the code eventually calls "WebServiceCallout.invoke()".
Here's the problem -
Every now and then, the 3rd party vendor adds a field to one of their response objects. When that happens - my integration with them breaks.
I get a message like this:
"System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element CardName"
Now, I don't care at all about their new field ("CardName" in this case) - I'm happy to ignore it!
But WebServiceCallout.invoke() won't ignore it. It fails the entire flow over that unfamiliar field.
The consequence is that every time this happens, I need to update the WSDL (which is easy), and then replay all the the flows that failed, and there may be hundreds of them.
I've tried to search for a way to make WebServiceCallout.invoke() more lenient, but couldn't find anything useful.
I really think this is an important issue...
Soap is not reliable unless there's a workaround.
BTW,
JSON.deserialize() solves this exact problem, for jsons:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Json.htm
"...this method ignores extraneous attributes and parses the rest of the JSON content."