HMRC Gateway API – Optional is Not Necessarily Optional

As a part of our business and industry expertise we program a number of HMRC tax reporting solutions, which utilize GovTalk, for our clients. In the request message there are two optional parameters: TransformationSpecified and CorrelationID.

The system was developed by our über-senior guy Alex. He used the code below in test application:

And even he faced the problem: if those parameters are not set he got the following error message:

Here is the example of the response:

That was misleading and took quite some time to clarify that the issue might be in a different place.
What we had to do is avoid this very error even if the client code did not set those optional parameters.

Remember, DevOps, not always optional can be trusted.